On Sun, Mar 13, 2011 at 1:33 PM, Urs Beyerle <[email protected]> wrote: >> >> As part of upgrade planning for my main workstation at home (an >> updated SL 5.2 system), I booted from the live CD just to see if all >> the major devices worked. Everything worked :). Unfortunately, that >> act rendered my existing system unbootable. >> >> When I booted from the live CD it found and started my md RAID1 >> partitions, including my system root partition. Nice, I had all my >> data there to play with. I noticed that where I had previously used >> /dev/md0, /dev/md1, etc..., the live CD system had created them as >> /dev/md122, /dev/md123, and so on, and not in the original order. I >> didn't think much of this, figuring my regular system would start them >> back in the original configuration, but apparently some metadata >> somewhere got changed by the live CD system and now the original >> system would not get past switching to the root file system with a 'no >> such device' error. I could see, just before going off the screen, >> where it had started my root partition as /dev/md125 rather than >> /dev/md0. >> >> I tried a couple of things to recover from this: I tried stopping and >> reassembling the RAID sets with the desired device names from the live >> CD system, and repackaging my initrd with device files for the >> /dev/md12* devices, but no luck. At that point I decided that, since I >> had already done my backups and was planning on eventually going to >> SL6, that I'd just push forward with a fresh install of SL6. It took a >> few hours that I hadn't planned on to get everything back up to speed, >> and I have one issue yet to work and a couple of minor things to >> configure. >> >> I have another retired box with the same RAID setup and it too, got >> hosed by the live CD. I'm going to play with this box to see if I can >> find a way to recover from this. >> >> Beware. > > Thanks for letting us know! > > I would be very interesting in a recovery procedure. > > I guess that it should be possible to re-assemble the raid device. So in > case /dev/md0 was renamed to /dev/125 and was setup with /dev/sda1 > /dev/sdb1, you may get /dev/md0 back, if you do > > mdadm --stop /dev/125 > mdadm --assemble /dev/md0 /dev/sda1 /dev/sdb1 > > Are your raid partition of the type 0xfd (Linux RAID autodetect) or 0x83 > (Linux)? > > If this is a general problem with the LiveCD and software raids, I would > like to fix it on the LiveCD.
Usually md devices are renamed/renumbered when "/etc/mdadm.conf" has "HOMEHOST <system>" set and the metadata in the superblock has a different homehost value. You can change the homehost "setting" in the superblock at assembly time with "--update=homehost" - assuming "hostname -s" returns the value that you want.
