linux icon indicating copy to clipboard operation
linux copied to clipboard

Unable to boot from Btrfs subvolume without specifying the partition

Open dariox86 opened this issue 2 years ago • 10 comments

Thanks to Discoverable Partitions Specification, on stock Parabola GNU/Linux-libre kernel I can boot my system with the following command: efibootmgr --bootnum 0 --disk /dev/nvme0n1 --create --label "Parabola GNU/Linux-libre" --loader /vmlinuz-linux-libre --unicode 'rootflags=noatime,subvol=root initrd=\initramfs-linux-libre.img' Being my Btrfs partition flagged as Linux root (x86-64) I don't need to specify root=/dev/nvme0n1p2 in the kernel parameter. This is not the case with XanMod. If I try to boot XanMod with this: efibootmgr --bootnum 0 --disk /dev/nvme0n1 --create --label "Parabola GNU/Linux-libre" --loader /vmlinuz-linux-xanmod --unicode 'rootflags=noatime,subvol=root initrd=\initramfs-linux-xanmod.img' I get: IMG20210731163857 To avoid this issue I need to boot XanMod like this: efibootmgr --bootnum 0 --disk /dev/nvme0n1 --create --label "Parabola GNU/Linux-libre" --loader /vmlinuz-linux-xanmod --unicode 'root=/dev/nvme0n1p2 rootflags=noatime,subvol=root initrd=\initramfs-linux-xanmod.img' Note the root=/dev/nvme0n1p2 in the line above. I would like to be able to leverage the Discoverable Partitions Specification by not specifying the root path just as with the stock kernel.

dariox86 avatar Jul 31 '21 15:07 dariox86

One point: This distribution is adapted to use a kernel with a base other than the mainline, in this case linux-libre. ~~The reason seems to be the way the kernel was packaged.~~

@figue, any suggestions?

xanmod avatar Jul 31 '21 17:07 xanmod

IDK why you need to pass root= to boot with Xanmod. @xanmod why you think is the package?

@dariox86 how do you installed Xanmod? Did you used stock config or some customs?

figue avatar Jul 31 '21 19:07 figue

I have tried on Arch Linux using both the package from AUR and a precompiled linux-xanmod package from here. Same outcome as above.

dariox86 avatar Aug 01 '21 14:08 dariox86

A couple of ideas:

Extracted from here https://wiki.gentoo.org/wiki/Knowledge_Base:Unable_to_mount_root_fs

When an initramfs is not used and the root filesystem specified on the kernel command line is on an MTD device (such as an NVME drive), it may be necessary to make the kernel wait for asynchronous initialization of the device by adding either rootdelay= (to timeout if the device is never detected) or rootwait (to wait without timeout).

The other, I was thinking if you have btrfs included in MODULES() array in /etc/mkinitcpio.conf. Maybe linux-libre and xanmod has different settings for BTRFS.

figue avatar Aug 02 '21 02:08 figue

Mind that the latest tests were made on Arch Linux with its stock kernel, not linux-libre. As for the NVMe storage device, yes, I do have one, but Arch Linux with linux-xanmod shows the same behavior under QEMU with a virtualized SATA drive. My MODULES array is empty.

dariox86 avatar Aug 02 '21 08:08 dariox86

i tried linux-xanmod package compiled inside a QEMU image and it boots ok with default grub menu generation... Try to add btrfs to MODULES array and regenerate mkinitcpio and see if xanmod boots normally.

figue avatar Aug 02 '21 22:08 figue

Arch Linux in a virtual machine: it works. The weird thing is, after having removed btrfs module and regenerated the initramfs images it is still working... If you keep the issue open I will investigate further.

dariox86 avatar Aug 02 '21 22:08 dariox86

Sorry, I was wrong. It does not work without btrfs module in mkinitcpio.conf. Stock kernel does not need btrfs in mkinitcpio.conf.

dariox86 avatar Aug 03 '21 19:08 dariox86

That's weird because stock and Xanmod has btrfs as module, and in Archwiki it says you have to add that module to your array.

figue avatar Aug 03 '21 23:08 figue

Manually adding btrfs module is needed only in specific circumstances.

dariox86 avatar Aug 04 '21 17:08 dariox86