[SunHELP] Disk Suite

Brad Blix brad at cpinternet.com
Thu Mar 18 11:31:28 CST 2004


Alex,

Here are the procedures I use to mirror our disk drives. It's all 
command line since all of our systems are headless.

Below is how I layout my primary disk during the Solaris install. You 
may have different slices depending on how you installed Solaris. The 
important thing is that you MUST have a small, about 25 MB, empty slice 
to hold the meta databases. I use slice 4 for this.

/dev/dsk/c0t0d0s0      /
/dev/dsk/c0t0d0s1      /var
/dev/dsk/c0t0d0s3      swap
/dev/dsk/c0t0d0s4      metadb
/dev/dsk/c0t0d0s5      /opt
/dev/dsk/c0t0d0s6      /usr
/dev/dsk/c0t0d0s7      /export

Partition the second disk the exact same way as the first disk. Run 
format and select your primary disk,  enter partition and then print to 
see what the partition table looks like. Enter quit to exit the 
partition menu and then enter disk and select your secondary disk. Then 
enter partition and set up the secondary disk the same way as the 
primary disk.  There may be an easier way to do this but it works for me.

Create meta dbs on Slice 4 of both disks by running:

metadb -a -f -c 3 /dev/dsk/c0t0d0s4 /dev/dsk/c0t1d0s4
 
Mirror the /usr, /var, /export, and /opt partitions. Remember your 
partitions and slices may be different.

Edit /etc/lvm/md.tab and add the following lines:

d12 1 1 /dev/dsk/c0t0d0s6
d2 -m /dev/md/dsk/d12
d22 1 1 /dev/dsk/c0t1d0s6
d13 1 1 /dev/dsk/c0t0d0s5
d3 -m /dev/md/dsk/d13
d23 1 1 /dev/dsk/c0t1d0s5
d14 1 1 /dev/dsk/c0t0d0s1
d4 -m /dev/md/dsk/d14
d24 1 1 /dev/dsk/c0t1d0s1
d15 1 1 /dev/dsk/c0t0d0s7
d5 -m /dev/md/dsk/d15
d25 1 1 /dev/dsk/c0t1d0s7

Run:

metainit /dev/md/dsk/d22
metainit -f /dev/md/dsk/d12
metainit /dev/md/dsk/d2
metainit /dev/md/dsk/d23
metainit -f /dev/md/dsk/d13
metainit /dev/md/dsk/d3
metainit /dev/md/dsk/d24
metainit -f /dev/md/dsk/d14
metainit /dev/md/dsk/d4
metainit /dev/md/dsk/d25
metainit -f /dev/md/dsk/d15
metainit /dev/md/dsk/d5

Edit /etc/vfstab and change the device paths to the meta devices for the 
partitions. Since your disk layout may be different, remember to make 
sure that you change the physical device path to match the meta device 
in the md.tab file. For example, when you change /usr from 
/dev/dsk/c0t0d0s6 you want to change it to /dev/md/dsk/d2 because the d2 
is mapped to d12 and d12 is mapped to c0t0d0s6 which was what /usr is 
mapped to in the vfstab file.

/dev/md/dsk/d2  /dev/md/rdsk/d2  /usr    ufs  2   no   logging
/dev/md/dsk/d3  /dev/md/rdsk/d3  /opt    ufs  2   yes  logging
/dev/md/dsk/d4  /dev/md/rdsk/d4  /var    ufs  2   no   logging
/dev/md/dsk/d5  /dev/md/rdsk/d5  /export ufs  2   yes  logging
 
Reboot

Attach the second half of the mirrors by running:

metattach /dev/md/dsk/d2 /dev/md/dsk/d22
metattach /dev/md/dsk/d3 /dev/md/dsk/d23
metattach /dev/md/dsk/d4 /dev/md/dsk/d24
metattach /dev/md/dsk/d5 /dev/md/dsk/d25

Wait until /usr, /export, /opt, and /var partitions are done 
synchronizing by running metastat and look for the Status line in each 
meta device. If it says Resync in progress it's not done yet.
 
To mirror the / and swap partitions edit /etc/lvm/md.tab and add the 
following lines:

d10 1 1 /dev/dsk/c0t0d0s0
d11 1 1 /dev/dsk/c0t0d0s3
d0 -m /dev/md/dsk/d10
d1 -m /dev/md/dsk/d11
d20 1 1 /dev/dsk/c0t1d0s0
d21 1 1 /dev/dsk/c0t1d0s3

Set up the new root and swap meta devices by running:

metainit /dev/md/dsk/d20
metainit /dev/md/dsk/d21
metainit -f /dev/md/dsk/d10
metainit -f /dev/md/dsk/d11
metainit /dev/md/dsk/d0
metainit /dev/md/dsk/d1

Now you must run metaroot to let the system know that you are moving the 
boot device to a meta device by running:

metaroot /dev/md/dsk/d0
 
Edit /etc/vfstab to switch out the swap device to the mirrored meta device

/dev/md/dsk/d1   -   -   swap  -   no   logging

Reboot

Attach Sub-mirrors

metattach /dev/md/dsk/d0 /dev/md/dsk/d20
metattach /dev/md/dsk/d1 /dev/md/dsk/d21

and again wait until the mirrors are done syncing.

That's it.... If you have any questions you can e-mail me off list.

Brad

Brad Blix
Manager of Systems Engineering
CP Internet
209 West First Street
Duluth, MN 55802
(218) 336-1000 X117
Join me in the fight against stroke... 
<https://www.kintera.org/faf/donorReg/donorPledge.asp?ievent=36830&lis=1&kntae36830=E2C5641E42F1407DA62E6889C7CDDC5A&supId=15792159> 



More information about the SunHELP mailing list