Politics and Technology.

Friday, January 30, 2009

USB Drive on Solaris

This guide walks you through mounting a USB drive on a Solaris SPARC system. The idea is to get the Solaris SPARC to use a disk that is partitioned to be usable by Windows. This Windows "curse" is unavoidable, but Sun ships the right tools to deal with it.
The idea is to create a primary partition for Solaris. Solaris is them "fooled" into using this Windows partition as if it was just raw disk.
Fortunately I found a good blog entry that explained how to do this.

Solaris 10

This is written for Solaris 10. This was tested on a T5240.

Plug it in

Find a happy and available USB port. Plug your USB drive in. Run "dmesg" to confirm that it saw you add the drive to the USB bus.

Volume Management
It is a good idea to turn off Volume Management. It will force you to use the "psuedo" device to refer to the USB drive until you do. You can stop Volume Management in the old school way, and then run "svcs" to check to see if you were successful.


# /etc/init.d/volmgt stop
# svcs volfs



Formatting

Regular format doesn't cut the mustard here. It won't even see your USB drive. Fortunately, Solaris now ships with "rmformat" which will show you "removable" type devices. Use the "-l" option to have it list the removable drives and you should be able to pick out the USB drive. Note the cXtXdXsX.


bash-3.00# rmformat -l
Looking for devices...
1. Logical Node: /dev/rdsk/c0t0d0s2
Physical Node: /pci@400/pci@0/pci@1/pci@0/usb@0,2/storage@2/disk@0,0
Connected Device: TSSTcorp CD/DVDW TS-T632A SR03
Device Type: DVD Reader/Writer
2. Logical Node: /dev/rdsk/c2t0d0s2
Physical Node: /pci@400/pci@0/pci@1/pci@0/usb@0,2/storage@1/disk@0,0
Connected Device: Hitachi Easy Device
Device Type: Removable
bash-3.00#


Now that you know the cXtXdXsX of our target, we have to fdisk it


# fdisk /dev/rdsk/c4t0d0p0


I'll let the blog explain what to do here:

To create the main Solaris partition. If no partition were initially present, just answering yes to the subsequent question will assign 100% of the disk to Solaris. side note: some of you may remember that Linux & Solaris did not like to be on the same disk since Solaris uses the same file format type number than Linux...Well the good news is that one can (and should) use the Solaris2 type so as to avoid those conflicts.


After partitioning the disk, put Solaris partitions on it with the rmformat command. It's easiest to create a template file for it to use.
This file would create a single "backup" slice 2 disk.


# cat my_slices
slices: 2 = 0, 45GB, "wm" "backup"
#


Remember that this is a USB drive, not a StorEdge box so your read and write performance with the device will be pitiful. If you are using the drive to temporarily store some data, set your slice size to be about 20% bigger than your data set size. It will save a lot of time when you have to newfs it.
Now just run rmformat with this file and the USB device.


# rmformat -s /tmp/my_slices /dev/rdsk/c2t0d0s2


Now check your work with the familiar prtvtoc.


bash-3.00# prtvtoc /dev/rdsk/c2t0d0s2
* /dev/rdsk/c2t0d0s2 partition map
*
* Dimensions:
* 512 bytes/sector
* 63 sectors/track
* 255 tracks/cylinder
* 16065 sectors/cylinder
* 60801 cylinders
* 60801 accessible cylinders
*
* Flags:
* 1: unmountable
* 10: read-only
*
* Unallocated space:
* First Sector Last
* Sector Count Sector
* 0 976768065 976768064
*
* First Sector Last
* Partition Tag Flags Sector Count Sector Mount Directory
2 5 00 0 94371840 94371839
bash-3.00#


Filesystems

From this point, just treat it like you would any other disk.


# newfs -m 1 /dev/rdsk/c2t0d0s2
...
# mount /dev/dsk/c2t0d0s2 /mnt

Thursday, January 22, 2009

Adding a 2nd Secondary Site to VVR

Recently, we've had to add a 2nd secondary VVR site to our RDS (RVG). Basically, this means we wanted to replicate from a single primary out to two secondaries. This is nothing out of the ordinary for Veritas' Volume Replicator, but it was something new to us.

As mentioned in a previous post, there is a VVR site in Orlando (with a two node cluster) and another in South Brunswick (a one node cluster). In this exercise, we added a third site in Secaucus (it, too, is a one node cluster). Below are the steps we took.

In this case, VCS is used, but we wanted to just add the 2nd secondary site in this go around, saving the VCS configuration in Secaucus for the next weekend.


1) Copied the dgids to all nodes in /etc/vx/vras/.rdg

2) Edit /etc/hosts on SEC, SBK and ORL

3) Check DNS on SBK and ORL

4) set routing table on servers for secdamsdbp1 vvr nics
a) /etc/sysconfig/network-scripts/route-bond1

5) add the routes between ORL, SBK and SEC

a) route add -net XXX.XXX.XXX.XXX netmask 255.255.255.0 gw XXX.XXX.XXX.XXX


6) plumb up secdamsdbp-vvr on bond1:0

7) Bring Down DAMSdbSG
a) orldamsdbp2 (vcs primary)

# hagrp -offline DAMSdbSG -sys orldamsdbp2


8) Bring Down VCS
a) orldamsdbp1 (vcs secondary)

# hastop -local

b) orldamsdbp2 (vcs primary, vvr primary)

# hastop -local -force

c) sbkdamsdbp1 (vcs primary, vvr secondary)

# hastop -local -force
# hastop -local -force


9) Check That SRL is clean
a) orldamsdbp2 (vvr primary)

# vradmin -g damsdg repstatus damsrvg


10) Check vxrlink
a) orldamsdbp2 (vvr primary)

# vxrlink -g damsdg status orl_to_sbk


11) Migrate VVR from ORL to SBK
a) orldamsdbp2 (vvr primary)

# vradmin -g damsdg migrate damsrvg sbkdamsdbp-vvr


12) Confirm migration
a) sbkdamsdbp1 (new vvr primary)

# vradmin -g damsdg repstatus damsrvg


13) Add SEC to the RDS, as viewed by SBK
a) sbkdamsdbp1 (vvr primary)

# vradmin -g damsdg addsec damsrvg sbkdamsdbp-vvr secdamsdbp-vvr prlink=sbk_to_sec srlink=sec_to_sbk


14) Confirm New Secondary VVR (it should be stopped and inconsistent)
a) sbkdamsdbp1 (vvr primary)

# vradmin -g damsdg repstatus damsrvg


15) Confirm New Rlink (should be unattached and STALE
a) sbkdamsdbp1 (vvr primary)

# vxrlink -g damsdg status sbk_to_sec


16) Stop replication to SEC (will probably not be replicating) SKIPPED
a) sbkdamsdbp1 (vvr primary)

# vradmin -g damsdg stoprep damsrvg secdamsdbp-vvr


17) Start syncing the data
a) sbkdamsdbp1 (vvr primary)

# vradmin -g damsdg -c friday_night_1 syncrvg damsrvg secdamsdbp-vvr


18) Go watch a movie

19) Verify the data
a) sbkdamsdbp1 (vvr primary) SKIP?

# vradmin -g damsdg -verify syncrvg damsrvg secdamsdbp-vvr


20) Finish the movie

21) Start the replication, with DCM autosync
a) sbkdamsdbp1 (vvr primary)

# vradmin -g damsdg -a startrep damsrvg secdamsdbp-vvr


22) Verify that replication completes, and is consistent and up to date
a) sbkdamsdbp1 (vvr primary)

# vradmin -g damsdg repstatus damsrvg


23) Create Rlink from ORL to SEC
a) orldamsdbp2 (vvr secondary)

# vxmake -g damsdg rlink orl_to_sec local_host=orldamsdbp-vvr remote_host=secdamsdbp-vvr remote_rlink=sec_to_orl remote_dg=damsdg

b) orldamsdbp2 (vvr secondary)

# vxrlink -g damsdg assoc damsrvg orl_to_sec


24) Create Rlink from SEC to ORL
a) secdamsdbp1 (vvr secondary)

# vxmake -g damsdg rlink sec_to_orl local_host=secdamsdbp-vvr remote_host=orldamsdbp-vvr remote_rlink=orl_to_sec remote_dg=damsdg

b) secdamsdbp2 (vvr secondary)

# vxrlink -g damsdg assoc damsrvg sec_to_orl


25) Verify replication status and vxprint -Pl on all three nodes
a) orldamsdbp2 (vvr secondary)

# vradmin -g damsdg repstatus damsrvg
# vxprint -Pl

a) sbkdamsdbp1 (vvr primary)

# vradmin -g damsdg repstatus damsrvg
# vxprint -Pl

a) secdamsdbp1 (vvr secondary)

# vradmin -g damsdg repstatus damsrvg
# vxprint -Pl


26) Test migration from SBK to ORL, orl to sec should be inconsistent
a) sbkdamsdbp1 (vvr primary)

# vradmin -g damsdg migrate damsrvg orldamsdbp-vvr
# vradmin -g damsdg repstatus damsrvg

b) orldamsdbp2 (new vvr primary)

# vradmin -g damsdg -a startrep damsrvg secdamsdbp-vvr


27) Test migration from ORL to SEC, sec to sbk should be consistent and stale
a) orldamsdbp1 (vvr primary)

# vradmin -g damsdg migrate damsrvg secdamsdbp-vvr
# vradmin -g damsdg repstatus damsrvg

b) secdamsdbp1 (new vvr primary)

# vradmin -g damsdg -a startrep damsrvg sbkdamsdbp-vvr


28) Test migration from SEC to ORL, orl to sbk should be consistent and stale
a) secdamsdbp1 (vvr primary)

# vradmin -g damsdg migrate damsrvg orldamsdbp-vvr
# vradmin -g damsdg repstatus damsrvg

b) orldamsdbp2 (new vvr primary)

# vradmin -g damsdg -a startrep damsrvg sbkdamsdbp-vvr


29) Test migration from ORL to SBK
a) orldamsdbp1 (vvr primary)

# vradmin -g damsdg migrate damsrvg sbkdamsdbp-vvr
# vradmin -g damsdg repstatus damsrvg

b) sbkdamsdbp1 (new vvr primary)

# vradmin -g damsdg -a startrep damsrvg secdamsdbp-vvr


30) Migrate from SBK to SEC
a) sbkdamsdbp1 (vvr primary)

# vradmin -g damsdg migrate damsrvg secdamsdbp-vvr
# vradmin -g damsdg repstatus damsrvg

b) secdamsdbp1 (new vvr primary)

# vradmin -g damsdg -a startrep damsrvg orldamsdbp-vvr


31) Migrate from SEC to ORL
a) secdamsdbp1 (vvr primary)

# vradmin -g damsdg migrate damsrvg orldamsdbp-vvr
# vradmin -g damsdg repstatus damsrvg

b) orldamsdbp2 (new vvr primary)

# vradmin -g damsdg -a startrep damsrvg sbkdamsdbp-vvr


32) Bring up VCS
a) orldamsdbp2 (vcs primary, vvr primary)

# hastart

b) orldamsdbp1 (vcs secondary)

# hastart

c) sbkdamsdbp1 (vcs primary, vvr secondary); if it shows as stale, run force the startup.

# hastart -onenode
# hasys -force


33) Start the DAMSdbSG service group
a) orldamsdbp2

# hagrp -online DAMSdbSG -sys orldamsdbp2

Unix Time Event

GEEK ALERT: My buddy Walt pointed out to me that in a few weeks, there will be a special event in Unix Time.


[dj715559@sbkdamsdbp1 ~]$ python -c 'import time; print time.ctime(1234567890)'
Fri Feb 13 18:31:30 2009
[dj715559@sbkdamsdbp1 ~]$

Wednesday, January 21, 2009

Edna On Mac, Followup #1

One thing I've noticed that can be annoying when using Edna, or any streaming media, is when the songs get cut up and choke due to poor network performance. I typically favor VLC Media Player as my streaming media client. I Google searched for a way to increase the default setting for the cache time associated with streams and was always frustrated. Today, I believe I found a hint for the solution on VideoLan's forum board.

Go to your preference pane, using the "Advanced" view (or "Show All Settings), choose Input Codecs -> Access Module -> HTTP(S). The default cache value can be set from there.

For me at work, I've set the cache value to 5000ms (5 seconds). There's a 5 second pause between songs, a pain when the songs are supposed to bleed together, but it's better than the alternative: cut up songs.

Thursday, January 8, 2009

The Corner Turned

The 3 year US treasury spread (difference between US 3 year treasuries rate and the interbank loan rate), at a low of 47.75 today, has hit a normal level. FINALLY!!! The "TED Spread" (same principle but with 3 month US treasuries), currently at 1.25, is still a bit high, but way down from its peak.

The US 3 year spread is probably ahead of the curve because the demand of these instruments is higher than the 3 month treasuries, driving prices up to meet the interbank loan rate, as opposed to the interbank loan rate dropping to meet it.

This still means that the cost to a business to get a loan is approaching normal levels indicating that the seizing of the financial gears of our economy has ended. I think this recession will be shorter than most predictions as money is now flowing into the private economy!

Let the record show that I spy the reversal of our misfortunes and it is during Bush's term!

You can bet that they'll still credit Obama.

Tuesday, January 6, 2009

As If 10 Vladivostoks Disappeared

Recently, there has been a lot of hoopla over Ex-KGB agent Igor Panarin predicting the demise of these United States of America.

In the Wall Street Journal's article (subscription required), there was a pretty picture that described the hypothetical boundaries of a dis-United States. What caught my eye as conspicuously missing was the Commonwealth of Puerto Rico. In searching through Google University, I can find no article that explains Prof. Panarin's vision that includes a reference to Puerto Rico at all.

This gnawed on me a bit as a big oversight in this Ruski's grand plan of an alternate universe of absurdity. Why? Well, PR is a mighty little island in the Caribbean with a relatively large economy. When compared against the States of our Republic, PR is often though of as the poor 2nd cousin you avoid lest he hits you up for some money. But when stacked up against the economies of the world, it would rank 57th out of 180, right between Slovakia and Morocco, with its $73 Billion GDP. This 2nd cousin isn't quite so poor after all, just good ol' blue-collar middle-class. In fact, its economy beats Hawaii's GDP of $48 Billion. Igor deigned to spell out a scenario where Hawaii became an Asian satellite puppet but wholly ignored Puerto Rico.

If the day ever came, heaven forbid, that Puerto Rico seceded from the Union it would immediately become the richest island nation in the Caribbean, nearly doubling the economy of its next contender, Cuba. (As far as I stand on Puerto Rico's future, they have the best of both worlds and should enjoy their special relationship to the US which gives them almost all of the advantages of a State, with none of the baggage).

To understand what a blunder it is for Professor 15-Minutes-Of-Fame to ignore PR, let's look at all of Russia's economic power: at $1.2 Trillion, this bear has bite. But it is all seemingly west of the Urals. If you took a look at the Russian Far East, including that gem of a city, Vladivostok, you'd find a GDP of less than $7 Billion. So for Igor Whats-his-name to forget Puerto Rico would be like he just ignoring 10 Vladivostoks!

You can't take Prof. KGB's analysis that seriously if he neglected a $73 Billion power in the middle of one of the most strategic seas in the world, especially when that margin of error outshines 10-fold a significant portion of his proposed inheritor of Pax Americana.

Anyhow, his hypothetical map has a Mexican influenced"Texas Republic" that stretches from the Navajo Nation to Savannah, GA. Any Texan will tell you they'd go it alone before hooking themselves again to the deep-south. Once bitten, twice shy, you know.