grml / grml-rescueboot

32 stars 14 forks source link

Fix booting from mdadm raid. #11

Closed sgf-dma closed 2 years ago

sgf-dma commented 2 years ago

Hi.

As subject states, grml can't boot from (local) mdadm raid.

The reason is simple: because hostname in initramfs (it's empty) does not match with the hostname of installed system, mdadm assembles arrays with different names, and there's no md device, which 42_grub has added to live-media=. E.g. when installed system has /dev/md/0 and hostname "debian11", mdadm from initramfs creates /dev/md126 and symlink /dev/md/debian11:0, but neither of them matches with /dev/md0 added into live-media= by 42_grub.

I've tried (too) many workarounds, but none of them worked:

So, patching 42_grub seems the only way.

There're probably two ways of fixing this: allowing to overwrite live-media= in CUSTOM_BOOTOPTIONS or just fixing autodetected mdadm array name. Here is implementation of the second one.

mika commented 2 years ago

Wow, very nice find! :partying_face: Looks like a sane option for me, thanks for the PR! :+1: