How do I configure grub to boot another linux distribution off an lvm partition?
1
vote
2
answers
2699
views
(I no longer have this setup so I cannot test new answers, sorry. I had to switch computers and am now only using arch; I am leaving the question as it is though since I'd love to know a solution if it occurs again, grub has been very hostile towards me these past few months)
I have fedora 23 as my main OS with custom partitioning (all physical partitions)
/boot/efi=/dev/sda1
root=/dev/sda3
. Then on /dev/Sda2 I just set up an LVM physical partition, and created an LVM group (arch
) and volume (root
) and then I installed Arch Linux (without bootloader) on /dev/arch/root
I have /dev/sda
(GPT), /dev/sdb
(GPT) then grub also seems to detect a hd2
and gives errors about being unable to load it (I assume this is the LVM physical partition) anyhow, I use os-prober
and grub2-mkconfig
to detect my arch installation, which it successfully does (and does so two times, I get two menu entries for it); but when I try to boot it I get the following errors:
error: failure reading sector 0x0fc from 'hd2'.
error: failure reading sector 0x0e0 from 'hd2'.
error: failure reading sector 0x0 from 'hd2'.
error: can't find command 'linux'.
error: can't find command 'initrd'.
I only get the sector reading errors on the first boot attempt (for the record, fsck reports the drive to be clean) any retries only give me the can't find command errors.
This is the grub.conf menuentry:
### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Arch (on /dev/mapper/arch-Root)' --class gnu-linux --class gnu --class os $menuentry_id_option 'osprober-gnulinux-simple-38305dfb-279b-4490-948b-480b81fef81f' {
insmod part_gpt
insmod lvm
insmod ext2
set root='lvmid/6ZmQFy-ijXr-mYra-3Gp9-l0dh-J4Wi-GSHXhd/WGN2VN-t34t-rYWi-kvje-2BfF-WoD4-4NinnP'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint='lvmid/6ZmQFy-ijXr-mYra-3Gp9-l0dh-J4Wi-GSHXhd/WGN2VN-t34t-rYWi-kvje-2BfF-WoD4-4NinnP' 38305dfb-279b-4490-948b-480b81fef81f
else
search --no-floppy --fs-uuid --set=root 38305dfb-279b-4490-948b-480b81fef81f
fi
linux /boot/vmlinuz-linux root=UUID=38305dfb-279b-4490-948b-480b81fef81f rw quiet
initrd /boot/initramfs-linux.img
}
Anyone got any ideas how to fix this? Any solution that will allow me to boot into arch (besides reinstalling the bootloader from arch instead of fedora) will be fine; I don't mind getting my hands dirty editing the grub.cfg file by hand.
Asked by Cestarian
(2438 rep)
Mar 7, 2016, 07:00 PM
Last activity: Jun 26, 2025, 03:03 PM
Last activity: Jun 26, 2025, 03:03 PM