Friday, June 15, 2012

how to recover the metadb on a system that only uses one drive

I have a server with one disk, there is a metadb running on it. if a have a copy of the drive it will not boot. If i modify the system file removing everything between begin Mdd root info and endd mdd root info, modify the vfstab file and over write the md.confmddb.cf and md.cf files with files from a system that is running a svm, i can get the drive to boot. the question now is how do i restore the metadb. I've attemped a couple of the examples i found, but these are system that are runing two drives, im my case the mirror is running on the same drive in a diffrent partitions. anyone have any ideas on how to restore.
Hi, 

If you have managed to change your vfstab to use cXtYdZsN devices and 
you are happy that you have access to all of your filesystems, then the 
easiest way to restore the metadb is to re-create it from scratch using 
the metadb command. On the assumption that you just want to rebuild 2 
mirrored disks, here's a brief lowdown using 2 disks, c0t0d0 and c1t0d0, 
with the metadb in slice 7, root in slice 0, swap in slice 1 and 
export/home in slice 6:- 

## initialise the metadb 
# metadb -a -f c0t0d0s7 
# metadb -a c1t0d0s7 

## Create metadevices stripes for 1st half of mirror 
# metainit -f d10 1 1 c0t0d0s0 
# metainit -f d11 1 1 c0t0d0s1 
# metainit -f d16 1 1 c0t0d0s6 

## Define metadevice mirror devices 
# metainit d0 -m d10 
# metainit d1 -m d11 
# metainit d6 -m d16 

## configure d0 as root fs 
# metaroot d0 

## edit /etc/vfstab to modify swap volume to use metadevice d1 
# vi /etc/vfstab 

## reboot the system 
# shutdown -i6 -g0 -y 

## create metadevice stripes for 2nd half of mirror 
# metainit -f d20 1 1 c1t0d0s0 
# metainit -f d21 1 1 c1t0d0s1 
# metainit -f d26 1 1 c1t0d0s6 

## attach metadevices stripes to mirror 
# metattach d0 d20 
# metattach d1 d21 
# metattach d6 d26 

## Check status of resilver 
# metastat -i 

Regards, 

0 comments:

Post a Comment

 
Design by BABU | Dedicated to grandfather | welcome to BABU-UNIX-FORUM