Root Mirroring (Solaris Volume Manager) in the Solaris 9 and 10 OS

Saturday, August 8, 2009 at 8:58 AM
Procedure for mirroring root with Solaris Volume Manager. For the Solaris 10 OS, SVM Version 3.0, REV=2005., and for the Solaris 9 OS SVM version 1.0, REV=2002. (Note: Results may vary.)


Run the format command; below is an example of the output:

0. c3t2d0
1. c3t3d0
In my example, I'm mirroring the root partitions along with the other partitions from the disk drive.

Drives c3t2d0 and c3t3d0.

Procedure for root Mirroring

First, partition your primary drive, typically the one that the Solaris OS is currently running on. (In my case, this is drive 0, c3t2d0.)

Transfer the partition table from one drive to another

prtvtoc /dev/rdsk/c3t2d0s2 | fmthard -s - /dev/rdsk/c3t3d0s2

Note: Notice the use of s2, which is typically the overlap partition; if you changed this on the disk, please substitute the proper slice in its place.


Two disks looking the same, execute the following:

metadb -a -c 3 -f c3t2d0s7 c3t3d0s7

The -c 3 creates three copies of the metastat database in this space, just in case a single copy gets corrupted (which is never good).


Initialize the disk that makes up the root partition by doing the following. Using s0 because this is root partition

metainit -f d11 1 1 c3t2d0s0
metainit -f d12 1 1 c3t3d0s0


Create the actual mirror:

metainit d10 -m d11

completed the preceding steps, need to run the following command, which will automatically update /etc/system and /etc/vfstab to let it know that you are using a metadevice as your root disk.

metaroot d10


Init 6

After you have executed the commands above, you need to reboot the machine before attaching the other half of the mirror to the root device. You can't attach a currently mounted device, or the machine will go crazy. In order to attach the device you will need to do the following:


metattach d10 d12

To check on the status of the mirror, you can do the following:

metastat d10

You will want to update the Openboot with the prior alias for the boot devices. You can do this by doing the following:

ls -l /dev/dsk/c0t0d0s0

Your output will look similar to the following

lrwxrwxrwx 1 root root 42 Jul 12 2007 /dev/dsk/c0t0d0s0 -> ../../devices/pci@1e,600000/ide@d/sd@0,0:a


You will need to update the bold part above, with your output. You will then run the following command from the OS

eeprom "nvramrc=devalias mirror /pci@1e,600000/ide@d/sd@0,0:a devalias mirror-a /pci@1e,600000/ide@d/sd@1,0:a"

eeprom boot-device="mirror mirror-a"

eeprom "use-nvramrc?=true"

The below commands for doing this are from the OK prompt, don't do this else wise.

"nvalias mirror /pci@1e,600000/ide@d/sd@0,0:a mirror-a /pci@1e,600000/ide@d/sd@1,0:a"

"setenv boot-device mirror mirror-a"


If you are mirroring just the two internal drives, you will want to add the following line to /etc/system to allow it to boot from a single drive. This will bypass the SVM Quorum rule

set md:mirrored_root_flag = 1

Please note that if you are running a Sparc platform you can use the installboot command in order to install the boot blocks onto the head of the drive.


For a UFS based File system you will use the below command.

installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c1t0d0s0

And on a ZFS based File System you will use the below command

installboot -F zfs /usr/platform/`uname -i`/lib/fs/zfs/bootblk /dev/rdsk/c0t1d0s0

If you are on a X86 Platform you will want to use installgrub to do similar functions, below you will find references for that

/sbin/installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c0d0s0


Post a Comment

Solaris | Powered by Blogger | Entries (RSS) | Comments (RSS) | Designed by MB Web Design | XML Coded By