----------------------------------------------------------
1. Create identical partitioning on the second disk
#dd if=/dev/rdsk/c0t0d0s2 of=/dev/rdsk/c0t1d0s2 count=16
(Here you can use prtvtoc and fmthard command too)
2. Setup the state databases with 3 backups per slice on each disk
#metadb -a -f -c 3 c0t0d0s7 c0t1d0s7
Description Mirror Name Device Name
1st mirror d10 c0t0d0s0
2nd mirror d20 c0t1d0s0
Metamirror d0 /dev/md/dsk/d0
1. Create submirrors for the mirrors
a) #metainit -f d10 1 1 c0t0d0s0
b) #metainit d0 -m d10
c) #metainit d20 1 1 c0t1d0s0
2. Make a backup of the /etc/vfstab file
3. Let the metaroot command make the /etc/vfstab and /etc/system changes for you
#metaroot d0
4. Run lockfs to prevent problems
#lockfs -fa
5. Shutdown the server
#/usr/sbin/shutdown -y -g0 -i0
6. From the boot prompt, run
OK>show-disks
7. Pick your mirrored disk from the list and then setup an alias like so
OK>nvalias mirror ^y (that is a
8. Change your boot-device to first try the normal disk alias,
then use your mirror disk
OK>setenv boot-device disk mirror
9. Reset/reboot the server
OK>reset-all
10. Attach the submirror to the metamirror
#metattach d0 d20
(NOTE: There will be lots of disk I/O)
11. Do ls and copy the info down as this is the alternate boot path
#ls -l /dev/rdsk/c0t1d0s0
NOTE: With an eye towards recovery in case of a future disaster it may be a good idea to find out the physical device path of the root partition on the second disk in order to create an Open Boot PROM (OBP) device alias to ease booting the system if the primary disk fails. In order to find the physical device path, simply do the following:
# ls -l /dev/dsk/c0t1d0s0
This should return something similar to the following:
/sbus@3,0/SUNW,fas@3,8800000/sd@1,0:a
Using this information, create a device alias using an easy to remember name such as altboot. To create this alias, do the following in the Open Boot PROM:
ok nvalias altboot /sbus@3,0/SUNW,fas@3,8800000/sd@1,0:a
If you only have two mirrored root disks, put this setting in your /etc/system:
set md:mirrored_root_flag=1
All right so you may need to do same for rest of the filesystems like /var, /home etc.
For all slices except root
--------------------------
Description Mirror Name Device Name
1st mirror d40 c0t0d0s4
2nd mirror d50 c0t1d0s4
Metamirror d3 /dev/md/dsk/d3
1. Create submirrors for the mirrors
a) #metainit -f d40 1 1 c0t0d0s4
b) #metainit d3 -m d4
c) #metainit d50 1 1 c0t1d0s4
2. Make a backup of the /etc/vfstab file before editing it
3. Make the following change in the /etc/vfstab file
/dev/md/dsk/d3 /dev/md/rdsk/d3 /var ufs 1 no logging
4. #reboot
5. Attach the submirror to the metamirror
#metattach d3 d50
(NOTE: There will be lots of disk I/O)
Just for a ref. here is the config.
mirror configuration example
========================================================
d0 - mirror of /, composed of two submirrors:
d20 - c0t0d0s0 (master)
d10 - c0t1d0s0 (replica)
d1 - mirror of /usr, composed of two submirrors:
d21 - c0t0d0s1 (master)
d31 - c0t1d0s1 (replica)
d3 - mirror of /var, composed of two submirrors:
d23 - c0t0d0s4 (master)
d13 - c0t1d0s4 (replica)
d4 - mirror of swap, composed of two submirrors:
d24 - c0t0d0s6 (master)
d14 - c0t1d0s6 (replica)
I hope it will help someone!
No comments:
Post a Comment