[CentOS] CentOS 4 Software Raid1 questions
Aleksandar Milivojevic
amilivojevic at pbl.ca
Mon May 2 19:43:28 UTC 2005
Les Mikesell wrote:
> I don't expect the kernel to be able to guess which conflicting
> label to use, or which set of disks become which md devices.
> Unfortunately, I haven't been able to find any documentation on
> how the md detection is supposed to work or how to provide the
> right info for the kernel when you are planning to move a set.
> There are times when it would be really useful to be able to
> pre-load them on a different box in order to have minimal downtime
> during the swap.
Well, again, it should be possible. Probable cause of the problem was
that you had two software RAID devices contending to become md0 (or md1,
md2, or whatever). The fix is relatively easy.
Once you move the drives, boot into rescue mode. When asked to mount
file systems, choose skip (you don't want Anaconda going out and
attempting to do the guesswork or trigger the kernel into doing guesswork).
When you get shell prompt is the time to do some manual repairing. Let
say your old arrays were md0 and md1, and the one you just moved over
was also md1 on different box. So you'd want to make this new one md2
(or any other md*).
You'd first find out the UUID of that array. You can do that by
querying any component of the array. Let say /dev/sda1 is one of the
components of the array you moved over:
# mdadm --examine /dev/sda1
mdadm will spit out lots of info, you are interested in one of the first
lines it prints. The UUID is long hex string. Can't miss it. Now,
reassemble the array as /dev/md2 using UUID to select partitions that
belong to this device out of all the partitions on the system, and
instruct mdadm to update super-minor hint in superblock (this is
important bit). This is all one command. I broke it in several lines
for readability. Use the UUID from the output of "examine" command.
# mdadm --assemble /dev/md2 --auto --config=partitions \
--uuid="12345678:87654321:12345678:87654321" \
--update=super-minor
And you are all done. You may reboot now.
Or, you could do this on the machine where you originally assembled the
array. Use "mdadm --examine" to find out UUID. Use "mdadm --stop" to
stop array. Use "mdadm --assemble" as described above to reassemble it
with device name that is not used on machine where you plan to move the
array (and obviously, that device name must be unused on machine where
you are doing this thing too).
Or just create array with correct super-minor in the first place ;-)
--
Aleksandar Milivojevic <amilivojevic at pbl.ca> Pollard Banknote Limited
Systems Administrator 1499 Buffalo Place
Tel: (204) 474-2323 ext 276 Winnipeg, MB R3T 1L7
More information about the CentOS
mailing list