Using a software mirroring system on Solaris can be brutal. It is prone to configuration error and recovery can be a bitch. My personal point of view is buy as much central storage as you can afford and use a hardware raid, so you don't have to use to disksuite..
Since you are still reading, I guess you haven't splurged on the $50k raid NAS (Network Attached Storage). Let move on.
- DisksuiteLayout - Planning your installation.
- MirrorRaid1 - Good old mirrors.
- MirrorRaid5 - Gobs of disks cobbled together.
- DiskRecovery - Recovering your lost disksuite disks.
2006-08: Disk Mirroring
Mirror The Drives
Use the 256M slice 7 of the drive for the metadata partition. Naming convention
- d10: the metadisk slice name
- d11: the first copy of the d1 slice
- d12: the second copy of the d1 slice
Copy partition from one drive to another. The easiest way:
- run format, pick source disk.
- name the partition layout
- in format, pick dest. disk. partition, "select" and pick the partition name, run "label"
- we don't need to do "newfs"
Set up meta database
- metadb no args, "nothing defined
- metadb -f -a -c 3 c1t0d0s7 c1t1d0s7 (source and dest disks) three dbs per slice.
- metainit -f d11 1 1 c1t0d0s0 <-- one of the partitions you want to mirror
- 1 1 use one slice for it
- -f force if the disk is in use
- "d11" = slice 1, mirror 1
- metainit -f d12 1 1 c1t1d0s0
Repeat for each slice that we're going to use. Map the new drive to the metadrive name
- metainit d10 -m d11 <-- set up onesided mirror; repeat for each slice.
- metastat will show us current setup
Now, tell vfstab to boot off off the metadevice
- metaroot d10 - metaddrive name for / (it edits /etc/system and /etc/vfstab)
- edit /etc/vfstab manually, set /var to e.g. /dev/md/dsk/d30
- Reboot
- in /etc/vfstab, make swap the mirror, d20
- Now, sync up the mirrors; d10 was already attached to d11, now attach d12
- metattach d10 d12
- for a 70G drive, it'll take about 3 hours to complete the mirroring. This should be done during a quiet time.
Boot from either mirror
In the ROM monitor: ok>
- show-disks to get the logical names for the disks
- do nvalias to give the boot disks names, e.g. root-disk & root-mirror
- devalias will show the existing aliases
- now test that we can boot using the two aliases
- when Solaris is up, test it with metastat
- ok> setenv boot-device root-disk root-mirror
- on systems with a diag-device in ROM, must set that too
- do a reset-all to simulate power cycle
- set auto-boot true
- set local-mac-address to FALSE - all interfaces have the same MAC address
Replace A Drive
*Probably* all you need to do is
metareplace -e d10 c0t0d0s0
... which will replace the device and enable it.
Here's the much longer way:
To replace a disk:
- metadetach d10 d11 ——(remove d11 from the d10 mirror. Do this for all slices on the failed disk)
- metaclear d11 ——(Do this for all slices on the failed disk)
- metadb -d /dev/dsk/c0t0d0s1 ——(clear the meta databases off of the failed disk)
- –replace physical disk.
- Do whatever you need to do to AddAndRemoveDisk
- prtvtoc /dev/rdsk/c0t1d0s2 | fmthard -s - /dev/rdsk/c0t0d0s2 ——(copy the good disk's partition table to the new replacement disk)
- metadb -a -c 3 c0t0d0s2 ——(Recreate databases)
- metainit d11 1 1 c0t0d0s0 ——-(Recreate submirrors. Do this for all slices on the disk)
- metattach d10 d11 ——-(Reattach the new drive sub mirror to the mirror -- rebuilding starts!)