Re: Crooked raid [solved]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all,

I finally solved my problem by booting with knoppix and recreating the raid from scratch.

From memory, the process might have looked like that:
boot with knoppix as single user
mdadm --zero-superblock /dev/hdg2
mdadm --zero-superblock /dev/hdg
mdadm --zero-superblock /dev/hdc2
mdadm --zero-superblock /dev/hdc
mdadm --create /dev/md0 --level 1 --raid-devices=2 missing /dev/hdg2
reboot in single user mode with /dev/hdc2 as root
mdadm --assemble /dev/md0 /dev/hdg2
mount /dev/md0 /mnt/md0 [mkinitrd needs /dev/md0 to be mounted to create a initrd.img that will load the raid correctly]
mkinitrd -o /boot/initrd-raid.img
edit lilo.conf to make an entry with /dev/md0 as root and uses initrd-raid.img
lilo -v
reboot and test this new lilo entry.
if it works, reboot with knoppix as single user
mount /dev/hdc2 /mnt/hdc2
mount /dev/md0 /mnt/md0
rsync -auHx --progress --exclude=/mnt/hdc2/proc/ /mnt/hdc2/* /mnt/md0/
[wait about 5 hours....]
edit /mnt/md0/etc/fstab to make /dev/md0 as root
reboot with the lilo entry that mounts /dev/md0 as root
mdadm /dev/md0 -a /dev/hdc2
[wait a while until the raid is in sync]
mkinitrd -o /boot/initrd.img
reboot, to be sure that it works.

After playing a lot with initrd and lilo, I think that the reason that md0 was trying to boot from hdc was that it was configured that way in initrd.img. I've since overwritten that file, but if I had to redo it, I would take a look at it:
mount /boot/initrd.img /mnt/inirtd -o loop
cat /mnt/initrd/script
There should be a line in there that starts with:
mdadm -A /dev/md/0 ...

Anyway, I certainly learned a lot from that experience! :-)

Cheers,
GFK's
--
Guillaume Filion, ing. jr
Logidac Tech., Beaumont, Québec, Canada - http://logidac.com/
PGP Key and more: http://guillaume.filion.org/
-
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux