Location of components
----------------------
command line utilitIEs in /usr/opt/SUNWmd/sbin
driver modules in /kernel/drv and /kernel/misc
daemons in /usr/opt/SUNWmd/sbin
administrative files in /etc/opt/SUNWmd
metadevices are named /dev/md/{dsk|rdsk}/dn, with n from 0 to 127 by default
the packages are SUNWmd and SUNWmdg (the GUI)
Useful options
--------------
The -f option can be used with most commands to force the operation. This is needed when doing an operation on a mounted filesystem.
md.tab file
-----------
The /etc/opt/SUNWmd/md.tab file can be used to configure ODS automatically.
# metastat -p > <filename>
This will output your configuration in md.tab format
# metainit -a
This command reads the md.tab file and sets up the configuration accordingly
Creating replicas
-----------------
# metadb -a -f c0t3d0s7
Before you can use Disksuite software, you must create the metadevice state database. The replica can exist on a dedicated disk partition or within a concat, stripe, or logging metadevice.
There MUST be 3 replicas or Disksuite S/W cannot be used correctly.
Se Documentation for more info on replicas.
it modifies /etc/system, /etc/opt/SUNWmd/mddb.cf
you can also modify the md.tab file to create a configuration
Concatenation
-------------
# metainit d1 3 1 c0t1d0s2 1 c1t1d0s2 1 c2t1d0s2
where d1 is the metadevice, 3 is the number of components to concatenate and 1 is the number of components per device
Simple Stripe
-------------
# metainit d2 1 3 c0t1d0s2 c1t1d0s2 c2t1d0s2 -i 16k
where d2 is the metadevice, 1 is the number of components to concatenate and 3 is the number of slices to stripe across -i 16k indicates the amount of data to write to each disk in stripe before moving to next one
Concat/Stripe
-------------
# metainit d3 3 3 c0t1d0s2 c1t1d0s2 c2t1d0s2 -i 16k 3 c3t1d0s2 c4t1d0s2 c5t1d0s2 -i 16k 3 c6t1d0s2 c7t1d0s2 c8t1d0s2 -i 16k
Here there are three stripes concatenated together. d3 is the metadevice.
The first 3 is the number of components to concatenate.
The second and subsequent 3's indicate the number of slices to
stripe across. The options there are as in the simple stripe.
Extending a metadevice
----------------------
# metattach d1 c3t1d0s2
extends a metadevice by concatenating a slice to the end. It does not add a filesystem.
# growfs /dev/md/rdsk/d1
If the metadevice is not mounted, the above command extends the filesystem to include the added section. You cannot shrink this filesystem later.
# growfs -M /export/home /dev/md/rdsk/d1
If the metadevice is mounted, the above command will extend the filesystem to include the concatenated section. Again, you cannot shrink the filesystem later.
Removing a metadevice
---------------------
# metaclear d3
d3 is the metadevice.
# metaclear -a -f
clears all metadevices. Don't do this unless you want to blow away your entire configuration.
The devices cannot be open for use.., i.e. mounted
Viewing your configuration and status
-------------------------------------
# metastat
shows the configuration and status of all metadevices
# metastat d3
will tell the configuration and status of just metadevice d3
# metadb
tells the location and status of locally configured replicas
Hot Spare pools
---------------
# metainit hsp001
sets up a pool called hsp001. It contains no disks yet.
# metahs -a hsp001 c0t1d0s4
adds a slice to the hot spare pool.
NOTE: it is advisable to add disks/slices to the pool in order of smallest to largest.
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 -s <setname> options
you can do almost everything the same way, except specify -s <deskset>
metadevices in shared diskset are called /dev/md/<setname>/{dsk|rdsk}/dn
hot spare pools within a shared diskset are named <setname>/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 <setname> -a -h <hostname1> <hostname2>
adds hosts to a set
# metaset -s <setname> -a c2t0d0 c2t1d0 c2t2d0 c2t3d0
adds drives to a set. Notice we do not specify slice.
# metaset -s <setname> -d c2t3d0
# metaset -s <setname> -d -h <hostname>
removes hosts and drives
# metaset -s <setname> -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 <setname> -r
releases control of a diskset
Troubleshooting info to gather
------------------------------
output from following...
# metastat
# metadb -i
# prtvtoc on relevant devices
# mount
# /var/adm/messages
标签: