Solaris 10 Disk Mirroring

if you don't need metadevices, you also don't need the metadb's. but if you want to setup other raid devices in your system with slvm you will need the metadb!

When I set up a system with Solaris, I always make a slice 7 with about 100 Megs. Then if I later want to mirror the disk I have a slice ready to go. But there is no point in setting up a meta data base to tell the system that you have no meta devices.

i've been goin over to reserve 256MB for slice 6 and 7. slice 6 for /globaldevices (maybe the server will be a cluster sometimes...) and 7 for metadb's. the 256MB is only needed for a large amount of metadevices and metasets. but bigger is better ;). you'll never know what comes next!

Attached is the step for Solaris 8 , I have try on Solaris 10.

Solaris disksuite mirror

I just documented mine for Solaris 8. This is using Solstice Disk Suite. The drives are c1t0d0 and c1t1d0. Hope this helps.

Install Solstice disksuite from Solaris Software, disk 2 of 2.
#cd /cdrom/sol_8_202_sparc_2/Solaris_8/EA/products/DiskSuite_4.2.1

  1. run ./installer
  2. default install (place in /usr/sbin) and allow reboot
    Run commands below:
    # prtvtoc /dev/rdsk/c1t0d0s2 | fmthard -s - /dev/rdsk/c1t1d0s2
    (This causes the mirrored disk to have the exact format as the main root disk).
    Run format and check that BOTH internal disks match exactly. If not, this will fail.

BOTH internal drives need to match exactly.

# metadb -a -f c1t0d0s7
# metadb -a c1t1d0s7
# metainit -f d10 1 1 c1t0d0s0
d10: Concat/Stripe is setup
# metainit -f d20 1 1 c1t1d0s0
d20: Concat/Stripe is setup
# metainit d0 -m d10
d0: Mirror is setup
# metaroot d0
# metainit -f d11 1 1 c1t0d0s1
d11: Concat/Stripe is setup
# metainit -f d21 1 1 c1t1d0s1
d21: Concat/Stripe is setup
# metainit -f d13 1 1 c1t0d0s3
d13: Concat/Stripe is setup
# metainit -f d23 1 1 c1t1d0s3
d23: Concat/Stripe is setup
# metainit d1 -m d11
d1: Mirror is setup
# metainit d3 -m d13
d3: Mirror is setup
# metainit -f d14 1 1 c1t0d0s4
d14: Concat/Stripe is setup
# metainit -f d24 1 1 c1t1d0s4
d24: Concat/Stripe is setup
# metainit d4 -m d14
d4: Mirror is setup
# metainit -f d15 1 1 c1t0d0s5
d15: Concat/Stripe is setup
# metainit -f d25 1 1 c1t1d0s5
d25: Concat/Stripe is setup
# metainit d5 -m d15
d5: Mirror is setup
# metainit -f d16 1 1 c1t0d0s6
d16: Concat/Stripe is setup
# metainit -f d26 1 1 c1t1d0s6
d26: Concat/Stripe is setup
# metainit d6 -m d16
d6: Mirror is setup

# echo �set md:mirrored_root_flag=1� >> /etc/system

edit /etc/vfstab. Use the /dev/md/dsk/d0 (or 1/3/4/5/6) instead of c1t0d0s0 (or 1/3/4/5/6)
reboot

run following commands:
# metattach d0 d20
d0: submirror d20 is attached
# metattach d1 d21
d1: submirror d21 is attached
# metattach d3 d23
d3: submirror d23 is attached
# metattach d4 d24
d4: submirror d24 is attached
# metattach d5 d25
d5: submirror d25 is attached
# metattach d6 d26
d6: submirror d25 is attached

Check progress of mirror sync. The mirroring takes 2-3 hours.
# metastat|grep -i progress

While waiting, run metastat -p | tee /etc/lvm/md.tab (captures DiskSuite config)

Then run # dumpadm -d /dev/md/dsk/d1

Hmmm, don't forget the `installboot` command, else your auto-failover may not be so auto :wink: If your boot mirror is c1t0d0s0, then:

installboot /usr/platform/`uname -i`/lib/fs/ufs/bootblk /dev/rdsk/c1t0d0s0

Also be sure your boot-device is appended correctly in openboot.

If using x86 hardware, and boot mirror is c1d0s0, then:

installgrub /boot/grub/stage1 /boot/grub/stage2 /dev/rdsk/c1d0s0

Also, Veritas can not encapsulate boot devices on x86 hardware (at least when I attempted it with v5.0). I think there's a little comment in /etc/vx/bin/vxrootmir (or one of the other scripts in there, can't recall).

@diabolist

"installboot" is not needed if you mirror the disks with slvm...