root disk mirroring in solaris volume manager for solaris 10

Need a procedure document to do "root disk mirroring in solaris volume manager for solaris 10". I hope some one will help me asap. I need to do it production environment.

Let me know if you need any deatils on this.

Thanks,
Rama

Hi,

Hope this helps you.

Root Mirroring

Root disk - c1t8d0
Mirror disk - c0t8d0

Transfer the partition table
prtvtoc /dev/rdsk/c1t8d0s2 | fmthard -s - /dev/rdsk/c0t8d0s2

We don�t need to run newfs on the partitions as syncing will automatically take care of this later

Creation of meta databases
metadb -c2 -a -f /dev/dsk/c1t8d0s7 /dev/dsk/c0t8d0s7
Since its the initial creation of the metadbs, we need to force it with -f, -a adds the metadbs , and -c tells it how many to create

Initialising the meta devices
metainit -f d10 1 1 c1t8d0s0
metainit d20 1 1 c0t8d0s0
metainit -f d11 1 1 c1t8d0s1
metainit d21 1 1 c0t8d0s1
metainit -f d13 1 1 c1t8d0s3
metainit d23 1 1 c0t8d0s3
metainit -f d15 1 1 c1t8d0s5
metainit d25 1 1 c0t8d0s5

When we work on mounted file systems then we need to use -f option, above root disk is mounted and mirror is notWe are creating a one way concatenation of our actual slices and forming the needed sub mirrors

Creating the mirrors
metainit -f d0 -m d10
metainit d1 -m d11
metainit d3 -m d13
metainit d5 -m d15

Here the mirroring is initialised, -m says build a mirror as in column 1 with sub mirror as in column 3But this mirror is not active till now

Activating the mirror - this will change the system and vfstab file
cp /etc/vfstab /etc/vfstab.premirr
cp /etc/system /etc/system.premirr
metaroot d0

The vfstab and system files will be updated automatically for using metadevices as root disk

Modify the vfstab for other metadevice entries
We need to manually modify the entries for other metadevices to be used

Modify the system file

echo "set md:mirrored_root_flag=1" >> /etc/system

The above entry is added to system file to boot the system in case of root disk failureWhen the root disk will fail, then the meta dbs on that disk will also become unavailable, in that case Solaris will boot since the aboveentry in system file makes it to ignore the quota on metadbs [ atleast 50 % of the copies ]

Modify the OBP boot device to boot with the mirror
Add the correct physical paths for root and mirror disk to boot successfully

Install the boot block on the mirror disk
cd /usr/platform/`uname -i`/lib/fs/ufsinstallboot bootblk /dev/rdsk/c0t8d0s0

Reboot the system

Attaching the mirror disk sub mirrors
metattach d0 d20
metattach d1 d21
metattach d3 d23
metattach d5 d25

Regards,
Vishal