RAID sata drive identification and other issues
I'm hoping to set up software raid (raid 1) on my linux box and so am doing a bit of testing first using vmware.
I have set up opensuse 11.1 on vmware machine with two disks A and B.
/dev/md0 is sda/b0 as swap
/dev/md1 is sda/b1 as /
Once installed I upgraded and then rebuilt both images with mkinitrd.
I then installed grub on both drives:
grub
root (hd0,1)
setup (hd0)
root (hd1,1)
setup (hd1)
All booting and working so I take a backup before testing.
If I shutdown machine and delete Disk A in vmware, all boots OK. /proc/mdstat shows that the /dev/md disks are made up of /dev/sda?, so that is what I would expect.
I then restore, and repeat deleting Disk B instead.
Again, all is OK on boot, but /proc/mdstat shows that it again thinks the MD volumes are made up with partitions from /dev/sda, but that was the drive I deleted. I'd have expected it to show /dev/sdb
Now I add another disk to replace Disk A. The result is the system will not boot, possibly because VMware will only try to boot from the first disk. Can anyone confirm if this would work on a real PC?
To get it to boot I switch the boot order in vmware bios, and it boots, but this is no good in a real failure, I'd want it to boot automatically. Can anyone confirm if this is just the way vmware works? If not, how can I get it to try booting from both drives?
ANyway, now it is working I look at /proc/mdstat I actually see that it now thinks /dev/sdb disks make up the mds, which what I'd expect, as disk A is just a blank unformatted disk.
Now my question. Is there a way to get mdadm to keep the same physical drive as /dev/sda and the same physical drive as /dev/sdb
One of the things I'd like to do is to break the mirror whenever I do a critical upgrade, and rebuild it once it is succesful. This is going to be really difficult when I dont know if I should be adding sda back into md or adding sdb into the md, and would give scope for error.
Now in reality I'd probably just mdadm to fail the drive, then mdadm to put it back in. Perhaps I wont see this movement of drive numbering in that case?
Maybe I'm getting confused about nothing, but can anyone explain if it is possible to have /dev/sda stay as the same physical drive, or with SATA will it just move all the time. Or again, am I not going to see this with a real machine.
I know you can use UUIDs in fstab, but mdstat doesn't use these does it?
Hope this makes sense.
Thanks
Last edited by newbuyer17; 06-18-2009 at 08:38 AM.
|