Hi all,
I recently started exploring Solaris 10.
I am testing metadevices now.
I have been reading about the state databases here:
6.State Database (Overview) (Solaris Volume Manager Administration Guide) - Sun Microsystems
So I created 3 metadbs on 2 slices (6 in total; c1t1d0s3 c1t1d0s5).
This is the setup:
c1t1d0s3 -> 3 replicas
c1t1d0s4 -> d1
c1t1d0s5 -> 3 replicas
c1t1d0s6 -> d2
d10 -> mirror of d1 and d2
After that I mounted this as /export/home and put it in vfstab.
Now I want to test what happens when a state db gets corrupt. So I used dd if=/dev/zero of=/dev/rdsk/c1t1d0s3.
First of all: is this a good way to test this?
When I type metadb -i all state databases seem ok. Does this command represents the current state of the meta dbs? I would think not.
Is there a possibility to see the current state? Are those state databases only used when mounting a filesystem? If it is only read when mounting then what is the difference between losing half and half+1 replicas as it has both the same meaning aka not being able to mount the filesystem?
/export/home is still mounted and I can still create files on it. Whenever I unmount, I cannot remount the partition. This is normal, right?
When I reboot the system does not goes to multiuser. Which is normal as it is stated in the aforementioned link. Then the replicas are shown as corrupt.
After deleting the replicas on c1t1d0s3 I still can't mount the metadevice. After a reboot, this does work. Is this normal? (I get messages about stale replicas)
Stale database: does this mean it is "corrupt" / "invalid" /...?
The second setup I tried:
c1t1d0s3 -> 4 replicas
c1t1d0s4 -> d1
c1t1d0s5 -> 3 replicas
c1t1d0s6 -> d2
d10 -> mirror of d1 and d2
Note the 4 replicas on c1t1d0s3.
So now when I corrupt 4 metadevices, the system should panic. As it is half+1 replicas.
After doing the dd command the machine does not panic. However that is what is mentioned on the aforementioned link :s I am confused here.
What am I doing wrong?
To recover from invalid/corrupt/... state replicas: should I just remove the old state replicas and create new ones and restart the machine?
From what I have read earlier I should create 3 replicas on each drive if I have 2 drives. I wonder why 3 and not 2. If I use 3 or 2 replicas doesn't seem to matter as in both situations when I loose half the replicas I will not be able to boot/mount. Or is this because when you delete the invalid/corrupt replicas you would have 2 and there should be a minimum of 3?
EDIT: "For a system with two to four drives: put two replicas on each drive." So seems I have misread.
However I wonder what is the difference as you still need to reboot after creating new replicas on the earlier failed drive. Otherwise you get a message about stale replicas.
I hope someone can give me some answers!
Kind regards