/etc/system, /etc/lvm/mddb.cf, /etc/lvm/md.cf
metadb raw devices
use dd to backup one of the slices listed in 'metadb'
dd if=/dev/rdsk/c0t0d0s7 of=/opt/sun/sdsbackup/metadb.c0t0d0s7.dd bs=2048k
“metaset” for disks list in the metaset.
"metastat -p" and "metastat –p -s <setname>" for each metaset
HOW TO RECOVER :
Recovering /etc/system or /etc/lvm/mddb.cf
If there is a problem with the metadb information in /etc/system ,add the line into
/etc/system based on /etc/lvm/mddb.cf.
#metadevice database location file do not hand edit
#driver minor_t daddr_t checksum
dad 7 16 -278
dad 7 1050 -1312
dad 7 2084 -2346
Then, you can add the line into /etc/system:
set md:mddb_bootlist1="dad:7:16 dad:7:1050 dad:7:2084"
If there is a problem with /etc/lvm/mddb.cf or both files, they will need to be
restored from backup.
In the event that all copies of the metadb have a problem, use dd to restore the dd backup.
dd if= /opt/sun/sdsbackup/metadb.c0t0d0s7.dd of=/dev/rdsk/c0t0d0s7 bs=2048k
Alternatively, initialise an empty metadb, and recreate all the local metadevices manually.
Recover metadevice configuration.
When metadevice configuration lost, the recover steps should keep in high careful, this may cause data lost. And all recover steps should based on original backup of /etc/lvm/md.cf file or metastat –p’s output.
# more md.cf (from backup)
# metadevice configuration file
# do not hand edit
d20 -m d21 d22 1
d21 1 1 c0t0d0s1
d22 1 1 c0t1d0s1
d81 -r c2t16d0s2 c2t17d0s2 c2t18d0s2 c2t19d0s2 c2t20d0s2 -i 32b
Recover d20 steps:
# metainit d21 1 1 c0t0d0s1
# metainit d22 1 1 c0t1d0s1
# metainit d20 –m d21
and confirm d20 data correct, if no problem do following:
# metattach d20 d22
If d20 data not ok, then try the other half mirror:
# metaclear d20
# metainit d20 –m d22
and test d20 data again, if confirm data ok:
# metattach d20 d21
Recover d81 (Radi 5)steps:
# metainit d81 –r -k c2t16d0s2 c2t17d0s2 c2t18d0s2 c2t19d0s2 c2t20d0s2 -i 32b
For metaset example:
# metastat –s testset –p (from backup)
d10 -m d11 d12 1
d11 1 1 c0t0d0s0
d12 1 1 c0t1d0s0
# metainit –s testset d11 1 1 c0t0d0s0
# metainit –s testset d12 1 1 c0t1d0s0
# metainit –s testset d10 –m d11
confirm d10’s data, follow the d20 recover steps.
RAID5 metadevices should be recreated using the metainit "-k" option so that it does
not re-initialize the data.
Mirror metadevices should be recreated with only one submirror, and once the data
is confirmed to be ok, the second submirror can be metattach'ed
If only one disk in a metaset fails, delete and re-add the disk into the metaset. This will re-initialise the 'private' slice, and copy the metaset's . Then use metareplace to recover any affected metadevices.
If the whole metaset is lost, re-initialise the disks into an empty metaset, and recreate all the metaset's metadevices manually. There is no equivalent of /etc/lvm/md.cf for metasets, so this requires that the output from "metastat -s <setname> -p" has been saved from before the failure.
RAID5 metadevices should be recreated using the metainit "-k" option so that it does not re-initialize the data.
Mirror metadevices should be recreated with only one submirror, and once the data is confirmed to be ok, the second submirror can be metattach'ed
Recover soft partition
Because soft partition just separate metadevice into little ones, but not cause any data init, just backup all soft partition make command, and after recover the non-softpartition metadevice and use the same commands to recover the soft partitions.