Rebuilding the Solaris Device Tree

If you ever shift around any bootable drives within a Sun Solaris box, you may find that either the device names (cxtxd0sx) do not follow the disk position within the server, or, the system just fails to boot because it can’t mount the other disk slices.

Let’s assume you are booting off of target 8 (c1t8d0s0), but wish to move that disk to the appropriate slot to make it target 0 (c1t0d0s0). You have changed all references in the /etc/vfstab file to reflect the new disk position, physically moved the drive from the target 8 slot to the target 0 slot, and changed the boot-device variable within the OBP to the appropriate disk. You should now be all set to boot from the disk in target 0, right?

Not quite yet.

Solaris creates a device tree with links to all the disks it knows about, and these don’t get rebuilt upon reboot. If you simply tried to boot the disk now in target 0, it would find the kernel, but fail to mount any of the other filesystems, because these device links are still pointing to the disk slices on target 8.

In order to boot off the drive in the new position, you will have to remove these device links and rebuild them. Here is how we do that:

1. Insert a Solaris 8, 9 or 10 cd into the hosts cdrom

2. From the ok prompt, enter boot cdrom -s

ok> boot cdrom -s

3. fsck the boot disk

# fsck -y /dev/rdsk/c1t0d0s0

Remember that your boot disk may differ than the example above. Since in our example above, we have put the disk into the slot for target 0 (c1t0d0), that is what we are using here.

4. Mount the root slice on /mnt

# mount /dev/dsk/c1t0d0s0 /mnt

Note that your root slice may differ than the above example.

5. Move path_to_inst

# mv /mnt/etc/path_to_inst /mnt/etc/PATH_TO_INST_ORIG

6. Remove all old device links

# rm /mnt/dev/rdsk/c* ; rm /mnt/dev/dsk/c* ; rm /mnt/dev/rmt/* ; rm
/mnt/dev/cfg/c*

7. Rebuild path_to_inst and devices

# devfsadm -r /a -p /mnt/etc/path_to_inst

8. Unmount the root slice and reboot

# umount /mnt ; init 6

You should now be able to boot off your old drive in its new slot.

What The Heck is RAID 10?

Earlier this month, a company came along and asked for a RAID 10 array. Understanding that RAID 10 is a cooler sounding way of saying RAID 1+0, I understood it as a mirror set that is striped across another mirror set. Simple enough… Just concatenate a couple of mirrors, and you’ve got RAID 10.

Indeed, RAID 10 is simply one or more RAID 1 arrays (mirrored sets) striped together (RAID 0).

RAID 1 creates an exact copy (or mirror) of all of data on two or more disks, while RAID 0 splits data evenly across two or more disks with no parity information for redundancy. By combining the two into a RAID 10 array, you are able to take advantage of the faster write speed offered by RAID 0, while protecting your data against drive failures with mirroring.

This method of RAID is pretty costly, but useful if you find yourself in a situation where you need a lot of throughput combined with a lot of data protection.