Mirroring the root File System

This entry was posted in Linux, Solaris Administration and tagged on June 17, 2012, by

How to mirror the root file system on solaris

1. For mirroring of filesystem we need two hard drives of same make.

2. Make both the hard drive same. Command to make it same is as follow

# prtvtoc /dev/rdsk/c0t0d0s2 | fmthard -s /dev/rdsk/c0t1d0s2

3. Create sufficient number of state database replica, minimum of 3.

# /usr/sbin/metadb -a -c 3 -f c0t0d0s5 c0t1d0s5

where a=Specify to add or create state database replica.

f= to force the operation.

c= specify number of replica.

4.Create a RAID -0 volume for root file system’s primary submirror

# /usr/sbin/metainit -f d11 1 1 c0t0d0s0

where the stripe is d11 with single stripe number 1 and the stripe is compose of 1 slice.

5. Create a RAID-0 volume on secondary drive to use as root file system’s secondary sub-mirror

# /usr/sbin/metainit -f d12 1 1 c0t1d0s0

where the stripe is d12 with single stripe number 1 and the stripe is compose of 1 slice.

6. Create a RAID-1 volume as one way mirror using the root file system primary sub-mirror

#/usr/sbin/metainit d10 -m d11

where  d10 is the volume name

m = specify’s to create volume

d11= specifies the name of the first submirror in the mirror

7. Update the /etc/vfstab file to use RAID-1 volume as mount point for the root file system.

#/usr/sbin/metaroot d10

8. Reboot the system

# init 6

9. Attach the RAID-0 volume as root file system’s secondary sub-mirror to the RAID-1 volume

# /usr/sbin/metattach d10 d12

where d10= volume name

d12= submirror

10. Determine the path to the alternate root device

# ls -l /dev/dsk/c0t1d0s0

note down the path. It will be something like /pci@1f,0/pci@1,1/ide@3/dad@0,0:a ( this is an example of my ide drive , for your drive it will be different path )

11. Go to the Ok prompt

12. Determine the boot device variable.

ok show-devs

13. Create a backup root device alias

ok nvalias root-bckup (Can give name of your choice) path-to-alternate-root-device ( /pci@1f,0/pci@1,1/ide@3/dad@0,0:a )

for example:

ok nvalias root-bckup /pci@1f,0/pci@1,1/ide@3/dad@0,0:a

14. Add the backup root device alias to the boot -device variable

ok setenv boot-device disk root-bckup net

15. Check if it boots from secondary root sub-mirror

ok boot root-bckup

Leave a Reply

Your email address will not be published. Required fields are marked *

Copyright 2017 ©Aceadmins. All rights reserved.