linux
linux copied to clipboard
Unable to boot from Btrfs subvolume without specifying the partition
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:
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.
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?
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?
I have tried on Arch Linux using both the package from AUR and a precompiled linux-xanmod package from here. Same outcome as above.
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.
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.
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.
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.
Sorry, I was wrong. It does not work without btrfs module in mkinitcpio.conf. Stock kernel does not need btrfs in mkinitcpio.conf.
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.
Manually adding btrfs module is needed only in specific circumstances.