FS#38566 - [grub] cannot boot a btrfs root partition (EFI system)
Attached to Project:
Arch Linux
Opened by John (graysky) - Saturday, 18 January 2014, 17:39 GMT
Last edited by Gerardo Exequiel Pozzi (djgera) - Thursday, 01 May 2014, 19:38 GMT
Opened by John (graysky) - Saturday, 18 January 2014, 17:39 GMT
Last edited by Gerardo Exequiel Pozzi (djgera) - Thursday, 01 May 2014, 19:38 GMT
|
Details
Using the autogenerated grub.cfg renders the system unable
to boot to a btrfs root partition. Downgrading to
1:2.00.1282.g5ae5c54-1 and regenerating grub.cfg restores
the functionality. The functional grub.cfg is attached for
comparison. I believe this flyspray differs from #38447 in
that I do not boot to a kernel panic.
Message displayed when attempting to boot to the autogenerated entry (either primary or fallback): ERROR: Boot device mounted successfully but /sbin/init does not exist. Bailling out, you are on your own. Good luck. sh: can't access tty: job control turned off [rootfs /]# Additional info: * package version(s) grub 1:2.02.beta2-1 Steps to reproduce: 1) Install package on an EFI system that uses a btrfs root partition (I cannot try on an non-EFI system as I do not own one). 2) Mount /boot/efi to $esp. 3) grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=grub --recheck 4) chmod -x /etc/grub.d/10_linux ### this is known to produce bogus entries, see flyspray #38455 5) grub-mkconfig -o /boot/grub/grub.cfg 6) Reboot and try to boot the system |
This task depends upon
Closed by Gerardo Exequiel Pozzi (djgera)
Thursday, 01 May 2014, 19:38 GMT
Reason for closing: Fixed
Additional comments about closing: grub-1:2.02.beta2-3
Thursday, 01 May 2014, 19:38 GMT
Reason for closing: Fixed
Additional comments about closing: grub-1:2.02.beta2-3
echo 'Loading Arch Linux pkg-linux kernel ...'
linux /boot/vmlinuz-linux root=UUID=3fa3d65b-9541-4081-ada2-0b3b6fda695d rw quiet radeon.dpm=1
echo 'Loading Arch Linux pkg-linux kernel initramfs ...'
initrd /boot/initramfs-linux.img
But it is missing the subvol from the image paths. So If I modify to this is boots correctly:
echo 'Loading Arch Linux pkg-linux kernel ...'
linux /__active/boot/vmlinuz-linux root=UUID=3fa3d65b-9541-4081-ada2-0b3b6fda695d rw quiet radeon.dpm=1
echo 'Loading Arch Linux pkg-linux kernel initramfs ...'
initrd /__active/boot/initramfs-linux.img
Just to mention, I do not need rootflags=subvol=__active since it is the default subvol.
Generating grub configuration file ...
/usr/bin/grub-mkrelpath: error: failed to get canonical path of `'.
/usr/bin/grub-mkrelpath '/boot'
Maybe the fix could be to put '.' instead of '' in the case of rootfs!=bootfs but I can't test this on my current setup:
else
SUBDIR="."
fi
Code is more or less copied from /etc/grub.d/10_linux
I have my root partition formatted as btrfs, on a non-default subvolume.
/boot is on a separate ext2 partition.
linux /__active/boot/vmlinuz-linux
initrd /__active/boot/initramfs-linux.img
The /__active or any subvolume name must be added before /boot.
10_archlinux does not prepend the subvolume name but 10_linux does. My initial patch added this prepend but it did not handle the case where SUBDIR was set to ''. I also wonder if the subvol_fix path would add the rootflags=subvol even when a default subvolume is set (it should probably not set it in that case).
It seems like your issue is a different one.
10_linux doesn't detect initramfs but append subvolume's name before /boot and add the subvol parameter.
10_archlinux detect initramfs but doesn't append subvolume's name and doesn't add the subvol parameter.
Keshav's updated script detect initramfs, append subvolume's name but doesn't add the subvol parameter.
I'm currently using Keshav's updated script and registered my "root subvolume" as default subvolume. Works well so far.
New 10_Archlinux detect initramfs, append subvolume's name before /boot but still doesn't add the subvol parameter.