Popular Posts

Mar 6, 2020

Solaris SVM mirroring root disks with Solaris volume manager

Solaris SVM mirroring root / boot disks with Solaris volume manager

APPLIES TO :  Oracle Solaris 8, 9, 10

ISSUE :  NIL

GOAL :  Mirror the Solaris root disk

SOLUTION :  Find below steps to mirror the root disk of Solaris 10 server.  

Prerequisites :   NIL


               1. Copy Partition table from root to mirror disk..
                       prtvtoc /dev/rdsk/c0t0d0s2 | fmthard -s - /dev/rdsk/c0t0d1s2

               2. Create the metadb state databases
                       metadb -afc 3 /dev/dsk/c0t0d0s7 /dev/dsk/c0t0d1s7

               3. To see the new state database replicas we just created :
                       metadb

               4. Create two submirrors for the root volume
                       metainit -f d11 1 1 c0t0d0s0
                       metainit d12 1 1 c0t0d1s0

                       metainit -f d21 1 1 c0t0d0s1
                       metainit d22 1 1 c0t0d1s1

                       metainit -f d31 1 1 c0t0d0s3
                       metainit d32 1 1 c0t0d1s3

                       metainit -f d41 1 1 c0t0d0s4
                       metainit d42 1 1 c0t0d1s4

                       metainit -f d51 1 1 c0t0d0s5
                       metainit d52 1 1 c0t0d1s5

                       metainit -f d61 1 1 c0t0d0s6
                       metainit d62 1 1 c0t0d1s6

               5. Setup one way mirror OR create main mirror with primary disk's sub mirror
                       metainit -f d100 -m d11
                       metainit d200 -m d21
                       metainit d300 -m d31
                       metainit d400 -m d41
                       metainit d500 -m d51

                       metainit d600 -m d61

               6. Backup the configuration files
                       cp /etc/vfstab /etc/vfstab.premirr
                       cp /etc/system /etc/system.premirr

               7. Activiate the Mirror using the metaroot command which will update the /etc/system and /etc/vfstab files
                       metaroot d100
               8. Verify the configuration  file /etc/system and /etc/vfstab
                       cat /etc/system|grep "md"
                              rootdev:/pseudo/md@0:0,10,blk --> This extra line reflects the mirror configuration


                       cat /etc/vfstab|grep -i md
              dev/md/dsk/d100 /dev/md/rdsk/d100        /       ufs     1    --> the root volume entry in vfstab modified.                                        

               9. Modify the system file
                       echo "set md:mirrored_root_flag=1" >> /etc/system

               10. Modify the vfstab for other metadevice entries
                       /dev/md/dsk/d200 - - swap - no -
                       /dev/md/dsk/d100 /dev/md/rdsk/d100 / ufs 1 no -
                       /dev/md/dsk/d400 /dev/md/rdsk/d400 /usr ufs 1 no -
                       /dev/md/dsk/d300 /dev/md/rdsk/d300 /var ufs 1 no -
                       /dev/md/dsk/d500 /dev/md/rdsk/d500       /opt    ufs     2       yes     -
                       /dev/md/dsk/d600 /dev/md/rdsk/d600 /oracle ufs 2 yes logging

               11. Before rebooting, run the sync command multiple times and lockfs -fa command to flush the data to file system
                       sync
                       sync
                       sync

                       lockfs -fa

               12. Now we can reboot the system.
                       shutdown -i6 -g0 -y

               13. Attaching the other submirror to the main mirror and sync the data
                       metattach d100 d12
                       metattach d200 d22
                       metattach d300 d32
                       metattach d400 d42
                       metattach d500 d52
                       metattach d600 d62

               14. Change the swap partition from slice device to meta device
                       swap -l
                       swap -d /dev/dsk/c0t0d0s1
                       swap -a /dev/md/dsk/d0

               15. if the dump device shows any disk slice path change it to meta device path.
                       dumpadm
                       dumpadm -d /dev/md/dsk/d1

               16. The sync will start now. To check the status of the mirror 
                       metastat -cp

               17. Install the boot block on the mirror disk
                       installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c0t0d1s0

               18. Reboot the server with both primary and secondary disks to check the stability of the mirror functionality. 



~ Judi ~

1 comment:

Popular Posts