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

Get raid working in initrd after changing partitions



Hi,

I had to change my partition layout and afterwards my Fedora does not boot anymore due to a problem in the initrd (does not start RAID).

* I use RAID-1 with LVM on top and a plain RAID-1 boot partition
* I recreated partitions and raid from scratch so all UUIDs changed (and
   the VG name because I wanted to mount both the old and the new disks
   to ease copying data).
* Changed kernel root parameter in grub
* After I selected the right kernel with grub, Llnux (kernel) starts but
  when initrd's init scripts runs, there is a problem. First my VG name
  changed so of course the old initrd script did not work anymore.

What I did (using the Fedora Live CD):
- Wipe out /etc/lvm/cache/.cache
- Change /etc/mdadm.conf so that the raid UUID matches the newly created
  raid.
- Removed+Installed the latest kernel with a chroot (because I hoped it
  would generate a good initrd)-

However I found out that the automatically generated initrd does not work because it does not include any raid functionality - of course it can not find my VG.

What I did then:
- Extract the old (working in the old setup) and the new initrd.
- diff'd the file list
- Completed the new initrd: Changed (in the initrd) /etc/mdadm.conf,
  added mdadm to /bin, copied missing ko files for raid, adapted the
  init script.
- Built a new initrd image

This works - kind of:
- initrd is accepted by grub, I can see my changes (e.g. echo XYZ).
- Unfortunately mdadm does not start my (degraded) RAID 1 so of course
  not luck mounting the VG later.

This is the error I see:
# Executed command:
# mdadm --assemble --scan --auto=yes --run /dev/md1 /dev/sda5
mdadm: no devices found for /dev/md1
mdadm: /dev/sda5 not identified in config file.

My /etc/mdadm.conf (from the initrd):
DEVICE partitions
# I tried to replace this with "/dev/sda* /dev/sdb*" but to no avail.
...
ARRAY /dev/md1 level=raid1 num-devices=2 metadata=0.90 UUID=(good uuid)
...

(Just to be sure, I generated the ARRAY line with 'mdadmin --detail --misc --scan' just replaced the /dev/md name,


However, I still does not work and I'm a bit at a loss here because I seriously don't know what is wrong...

Can this be due to the partition labels (I don't have any)? Some kind of cache that I need to delete? Anything else? Assume that my setup is quite standard, just the RAID 1 with LVM on top.

Thank you very much for you help...

fs



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