Solaris Volume Manager

Display all device status	metastat
Display device status	metastat {metadevice}
Display condensed status	metastat -p
List metadb info	metadb -i
Create new metadevices	metainit {volume} {number-of-stripes} {components-per-stripe} {components}
Attach or grow device	metattach {metadevice} {size or new device}
Detach device	metadetach {metadevice} {submirror}
Place submirror offline	metaoffline {mirror} {submirror}
Place submirror online	metaonline {mirror} {submirror}

Howto: Expand a soft partition

metattach {metadevice} {size} growfs -M {mountpoint} /dev/md/rdsk/{metadevice}

Howto: Replace Failed Drive in Same Drive Slot

Look at output for signs of failed disk slice

metastat -c

Delete metadbs knowledge of dead drive so that we can format the new disk

metadb -i metadb -d /dev/dsk/c3t1d0s7

Force a detach of all failed submirrors

metadetach -f d0 d20 metadetach -f d1 d10

Remove knowledge of all failed submirrors from the database

metaclear d20 metaclear d10

Unconfigure the failed disk, use output from first command for second command

cfgadm -al Ap_Id Type Receptacle Occupant Condition c3::dsk/c3t1d0 disk connected configured unknown cfgadm -c unconfigure c3::dsk/c3t1d0

Replace failed disk

Configure new disk

cfgadm -c configure c3::dsk/c3t1d0 cfgadm -al Ap_Id Type Receptacle Occupant Condition c3::dsk/c3t1d0 disk connected configured unknown

Apply the working disk's format to the new disk and check that it worked.

prtvtoc /dev/rdsk/c3t0d0s0 | fmthard -s - /dev/rdsk/c3t1d0s0 fmthard: New volume table of contents now in place. prtvtoc /dev/rdsk/c3t1d0s0

Add 2 copies of the metadevice database to the new disk for backup purposes

metadb -c 2 -a /dev/dsk/c3t1d0s7

Re-create all submirrors

metainit d20 1 1 c3t1d0s0 metainit d10 1 1 c3t1d0s1

Re-attach all submirrors to mirrors, will automatically begin resyncing

metattach d0 d20 metattach d1 d10

Check to see percent of resync complete

metastat -c

Howto: Expand a filesystem on the fly from the global zone to the non-global zone virtual container

Add Disk to Existing Concat/Stripe RAID 0 Volume:

root@global.zone #> metattach {metadevice} /dev/dsk/{device_name}

Or, if using soft partitions and there is space available:

root@global.zone #> metattach {metadevice} <extra_space>

Find out how zone filesystem is mounted:

root@global.zone #> growfs /dev/md/rdsk/{metadevice} /dev/md/dsk/{metadevice} is mounted on /zones/global.zone/root/{mountpoint}; can't growfs

Grow existing non-global zone mounted filesystem from global zone:

root@global.zone #> growfs -M /zones/global.zone/root/{mountpoint} /dev/md/rdsk/<{metadevice}