Thursday, February 05, 2009

SMI/EFI disk howto change the label

I am changing the disk on Sol 10 server Sun-Fire-V245 when I encounter a problem after I used the usual prtvtoc and fmthard command to copy the desired partition table on the new disk. Below is the error:
root@houic-u-s00019 # prtvtoc /dev/rdsk/c1t9d0s2 | fmthard -s - /dev/rdsk/c1t12d0s2
*Partition 0 not aligned on cylinder boundary: " 0 4 00 34 143358287 143358320"*
I did inform the Synstar Engineer about the issue and he then mentioned that the disk they have just installed has an SMI Label. Below I give the example on how to spot the difference between the SMI and EFI labelled disk. Notice that SMI used cylinders while EFI used sectors. Also notice that SMI uses 8 slices; numbered 0-7 with slice 2 being the whole disk.
SMI Labelled Disk:
partition> p
Current partition table (unnamed):
Total disk cylinders available: 14087 + 2 (reserved cylinders)
Part Tag Flag Cylinders Size Blocks
0 usr wm 0 - 11615 56.36GB (11616/0/0) 118204416
1 unassigned wm 0 0 (0/0/0) 0
2 unassigned wm 0 0 (0/0/0) 0
3 unassigned wm 0 0 (0/0/0) 0
4 unassigned wm 0 0 (0/0/0) 0
5 unassigned wm 0 0 (0/0/0) 0
6 unassigned wm 0 0 (0/0/0) 0
7 unassigned wm 0 0 (0/0/0) 0
partition>
EFI Labelled Disk:
partition> p
Current partition table (original):
Total disk sectors available: 143358320 + 16384 (reserved sectors)
Part Tag Flag First Sector Size Last Sector
0 unassigned wm 0 0 0
1 unassigned wm 0 0 0
2 unassigned wm 0 0 0
3 unassigned wm 0 0 0
4 unassigned wm 0 0 0
5 unassigned wm 0 0 0
6 unassigned wm 0 0 0
8 reserved wm 143358320 8.00MB 143374703
partition>
Below is the steps on how to change the Disk label from SMI to EFI.
1. Use format in expert mode: format -e
2. Then select the target disk.
3. Finaly inside format use label to change the disk label. Select 1. Voila! your disk label is now EFI.
4. Dont forget to verify the partition table using format.
Searching for disks...done
AVAILABLE DISK SELECTIONS:
8. c1t12d0
/pci@1f,700000/pci@0/scsi@2/sd@c,0
9. c1t13d0
/pci@1f,700000/pci@0/scsi@2/sd@d,0
Specify disk (enter its number): 8
selecting c1t12d0
[disk formatted]
----
----
format> label
[0] SMI Label
[1] EFI Label
Specify Label type[0]: 1
Warning: This disk has an SMI label. Changing to EFI label will erase all
current partitions.
Continue? y

format>
================================================================
Digging deep into the difference between SMI and EFI, I found the info below:
The advantage of the EFI label is that it supports LUNs over 1TB in size and prevents overlapping partitions by providing a whole-disk device called cxtydz rather than using cxtydzs2. Site below also explain further EFI advantage over SMI.

Solaris soltice Mini howto I shared with my group

Just want to share the mini howto I prepared in case you encounter an e-change to replace the defective disk on Solaris machine using Solaris volume manager.
Please ignore this howto if you already master the other way of changing the disk on solaris machines :D. Comments to improve this howto are very much welcome.
1) Run 'metadetach' to detach all submirrors on the failing disk from their respective mirrors, and then run 'metaclear' (**) on those submirror devices (see below). if you don't use -f option you will get the following message : "Attempt an operation on a submirror that has erred component"
In sample case the failed disk is c1t0d0
metadetach d0 d10
metadetach d1 d11
metaclear d10
metaclear d11
You can verify there are no existing metadevices left on the disk by
running '
metastat -p | grep c1t0d0
2.Next step is to remove the replicas on this disk c1t0d0
To view the replicas on this disk
$ metadb |grep c1t0d0
Wm p l 16 8192 /dev/dsk/c1t0d0s7
W p l 8208 8192 /dev/dsk/c1t0d0s7
If there are any replicas on this disk, remove them using
metadb -d c1t0d0s7
You can verify there are no existing replicas left on the disk by
running
metadb | grep c1t0d0
3. If there are any open filesystems on this disk (not under SVM control), unmount them.
4. Run the 'cfgadm' command to remove the failed disk.
cfgadm -c unconfigure c1::dsk/c1t0d0
5. Insert and configure in the new disk. Make sure the disk was inserted on the same location where the failed disk was pull-out.
cfgadm -cc configure c1::dsk/c1t0d0
cfgadm -al
Then try to run format to re verify if the OS already recognize the new disk
6. Run 'format' or 'prtvtoc' to put the desired partition table on the new disk .
Note : The VTOC (volume table of contents) on the root disk and root mirror must be the same. Copy the VTOC using prtvtoc and fmthard.
$ prtvtoc /dev/rdsk/c1t1d0s2 | fmthard -s - /dev/rdsk/c1t0d0s2
7. If necessary, recreate any replicas on the new disk:
metadb -a -c 3 c1t0d0s7
8. Recreate each metadevice to be used as submirrors, and use 'metattach' to attach those submirrors to the mirrors to start the resync. Note: If the submirror was something other than a simple one-slice concat device, the metainit command will be different than shown here.
metainit 1 1
metattach
metainit d10 1 1 c1t0d0s0
metattach d0 d10
metainit d11 1 1 c1t0d0s1
metattach d1 d11

Solaris 10 thingy trunking/aggregation

Recently, I was looking for information on what Ethernet cards will work with Nemo drivers for link aggregation/trunking. It was a long search and took me a while to figure out what is supported and what product/technologies should be used on what hardware. So, here are my notes for configuring trunking on various Solaris 10 systems.

The first thing you should do before even begin working on trunking on a Solaris 10 machine is to make sure it has latest patches.

Next, check what kind of Ethernet driver do you have. There are several ways you can find out. Here is one way:

dladm show-link

Look for the first word for each line. If you see any of the following driver types, then you can use Nemo drivers: bge, e1000g, xge, nge, rge, ixgb

If you have qfe, ge, or ce, then you should use Sun Trunking 1.3. See also support matrix.

Let’s say that you have Nemo supported drivers, then here are the steps to setup link aggregation:

1. Identify which ports you want to aggregate. dladm show-link should give you an idea what are available. I’ll assume you want to aggregate bge0 and bge1.
2. Run the following command to create an aggregation interface:

dladm create-aggr -d bge0 -d bge1 1

If you get an error, it is most likly you either attempting to use Nemo drivers on a not supported Ethernet driver or you do not have the latest patches for Solaris 10.
3. Plumb the interface. See example below:

ifconfig aggr1 plub 192.168.1.200 up

4. Check the configuration:

dladm show-aggr
ifconfig -a

If you decided that Sun Trunking 1.3 is what you need, then follow the steps below:

1. Download the binary.
2. Read the Installation Guide
3. After unzip the binary from step #1, follow the installation steps stated in page 46 (printed on the left corner on the page or page 56 according to your Acrobat reader) in the Installation guide.
4. Install the appripriate patches for the driver you use. See page 44 (printed on the page or 54 according to Acrobat reader) in the Installation Guide.
5. Set local-mac-address as root on the command-line:

eeprom local-mac-address?=true

6.Reboot
7. Make sure the interfacs that you want aggregate isn’t plumb. If not, use the following command to unplumb:

ifconfig ce0 unplumb

8 Create an aggregated interface

/etc/opt/SUNWconn/bin/nettr -setup 0 device ce  members=0,1

This should create an aggregated interface for use with switches (MAC based policy) If you want to use Round Robin for back to back connection, use the following command instead:

/etc/opt/SUNWconn/bin/nettr -setup 0 device ce members=0,1 policy=2

See Page 29 and 32 for further information about other policies.
9. Plumb the interface.

ifconfig ce0 plumb 192.168.1.200 up

10. Check config:

/etc/opt/SUNWconn/bin/nettr -conf