Solstice Disksuite command line reference( 二 )


This way the smallest hotspare capable of replacing a disk will kick in.

# metahs -s all c1t1d0s4

adds a slice to all pools


# metaparam -h hsp001 d1
makes a hot spare pool available to the metadevice d1 {submirror or RAID5}


# metahs -e c1t1d0s4
reenables a a hot spare that was previously unavailable

# metahs -r hsp001 c1t1d0s4 c2t1d0s4
replaces the first disk listed with the second

# metahs -d all c1t1d0s4
removes a disk from all hot spare pools

# metahs -d hsp001 c1t1d0s4
removes a slice from hsp001

# metahs -d hsp001
removes a hot spare pool

# metahs -i
# metastat

tell you the status






Mirrors
-------

# metainit d0 -m d1
makes a one-way mirror. d0 is the device to mount, but d1 is the only one associated with an actual device.
A "one-way mirror" is not really a mirror yet. There"s only one place where the data is actually stored, namely d1.

# metattach d0 d2
attaches d2 to the d0 mirror. Now there are 2 places where the data are stored, d1 and d2. But you mount the metadevice d0.

# metadetach d0 d1
detaches d1 from the d0 mirror

# metaoffline d0 d2
# metaonline d0 d2
suspends/resumes use of d2 device on d0 mirror

# metareplace d0 c1t0d0s2 c4t1d0s2
replaces first disk listed with second on the d0 mirror

# metareplace -e d0 c1t1d0s2
re-enables a disk that has been errored.







Mirroring root
--------------

You must take a few extra steps to mirror the root partition

# metainit d1 1 1 c0t3d0s0 <-- the root partition
# metainit d0 -m d1
# metaroot d0

the metaroot command updates /etc/system and /etc/vfstab so that the device /dev/md/dsk/d0 is now the root device.

# reboot

you must do this to have d0 be the mounted device. Otherwise if you do the next step, data corruption will occur because of the round robin manner in which data is written

# metainit d2 1 1 c0t4d0s0
# metattach d0 d2

Now d2 is attached and data is mirrored on d1 and d2. The device to mount is d0.



RAID 5
------

# metainit d1 -r c0t1d0s2 c1t1d0s2 c2t1d0s2 -i 16k

sets up a RAID 5 configuration.
The -i option is the same as in striping.

# metareplace d1 c2t3d0s2 c3t1d0s2
# metareplace -e d1 c0t1d0s2
replacing disks as in the mirror.

# metattach d1 c4t3d0s2
concatenates a disk to the end of the RAID 5 configuration.

# metaparam -h hsp001 d1
adds a hot spare pool

# metaclear d1
removes a metadevice

# metastat
tells status






UFS logging
-----------

# metainit d0 -t d1 d2

sets up a trans device d0 with d1 as the master and d2 as the logging device.
recommended 1MB logging/1GB data on master

# metainit d0 -t c0t1d0s2 c3t2d0s5
same as above

# metattach d0 d1
# metattach d0 c3t1d0s5
# metadetach d0
attaching and detaching







Disksets
--------

# command -soptions

you can do almost everything the same way, except specify -s

metadevices in shared diskset are called /dev/md//{dsk|rdsk}/dn

hot spare pools within a shared diskset are named /hspnnn

disksets are only supported on SSA disks and disks are repartitioned when put into a diskset unless slice 2 is zeroed out and slice 7 has cylinders 0-4 or 0-5 allocated to it for the diskset metadb

# metaset -s-a -h
adds hosts to a set

# metaset -s-a c2t0d0 c2t1d0 c2t2d0 c2t3d0
adds drives to a set. Notice we do not specify slice.

# metaset -s-d c2t3d0
# metaset -s-d -h
removes hosts and drives

# metaset -s-t
take control of a diskset. the -f option will force control but will panic other Machine, unless it has been released from other host.

# metaset -s-r
releases control of a diskset

推荐阅读