create initial state database replicas.
1. metadb -a -f c0t0d0s0
2. metadb
3. metadb -a c0t1d0s0 c0t2d0s0 c0t3d0s0
check the status of all state database replicas.
# metadb -i
delete state database replicas.
1. metadb -d c0t0d0s0
2. metadb -d -f c0t0d0s0
display solaris volume manager configuration
# metastat -p
raid 0
create a raid 0 (stripe) volume:
metainit d0 1 2 c0t0d0s0 c0t1d0s0 ( -i 32k ) # default is 16k
create a raid 0 (c volume:
metainit d1 1 1 c0t0d0s1
metainit d2 3 1 c0t0d0s0 1 c0t1d0s0 1 c0t2d0s0
expanding a file system by creating a concatenation:
# umount /docs (c0t0d0s0)
# metainit d0 2 1 c0t0d0s0 1 c0t1d0s0 # have original device as the first device
# mount /dev/md/dsk/d0 /docs
# growfs -m /docs /dev/md/rdsk/d0
expanding an existing raid0 volume file (dynamic):
1. create a c stripe by attaching a sigle slice.
# metattach d2 c1t2d0s2
2. create a c stripe by adding several slices.
# metattach d2 c1t2d0s2 c1t2d1s2 c1t2d3s2
3. growing a file system (without umount the fs)
# growfs -m /docs /dev/md/rdsk/d2
remove a volume:
1. umount the file system.
2. remove the volume:
# metaclear d2
raid 1
create a raid 1 volume:
1. create a raid 0 volume.
# metainit (-f) d0 c0t0d0s0 # -f for root fs
2. create the mirror ( -->; two way) with resynchronization.
# metainit d2 -m d0
# metattach d2 d1
3. create a two-way mirror without resynchronization.
# metainit d2 -m d0 d1
* if you are mirroring your root ( / ) file system, run "metaroot d0"
( it is same with /usr and swap mirroring. )
# metainit -f d0 1 1 c0t0d0s0
# metainit d2 -m d0
# metaroot d2 -->; auto-edit /etc/vfstab
# lockfs -fa -->; better than sync
# reboot
......
# metattach d2 d1
how to detach a submirror
# metadetach d2 d1
place a submirror offline and online
# metaoffline d2 d1
# meta d2 d1
change raid 1 volume read policy.
# metaparam -r geometric -w serial -p 5 d30
# metaparam d30
use a raid 1 volume to make an backup
# metastat
# lockfs -w /docs -->; lock
# metaoffline d2 d1
# lockfs -u /docs -->; unlock
# ufsdump ...
# meta d2 d1
soft partition
create a soft partition
# metainit d20 -p c0t0d0s3 4g
or metainit d20 -e -p c0t0d0 1g (whole disk)
expanding a soft partition
# mount /dev/md/dsk/d20 /docs
# metattach d20 10g
# growfs -m /docs /dev/md/rdsk/d20
raid 5 / hot spare
create a raid 5 volume
# metainit d45 -r c0t0d0s3 c0t0d0s4 c0t0d0s5
adding a hot spare to hot spare pool.
# metahs -a hsp1 c0t0d0s7
or metahs -a all c0t0d0s7
delete hot spare
# metahs -d hsp1 c0t0d0s7 c0t0d0s6
or metahs -d all c0t0d0s7
associated with raid 5 & submirrors
# metaparam -h hsp1 d10