[bug?] Using generic kernel fails when using btrfs subvolumes in 14.2
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
[bug?] Using generic kernel fails when using btrfs subvolumes in 14.2
Installing a Slackware 14.2 system using btrfs subvolumes similar to the guide available here http://www.yodaconditions.com/dokuwi....install.btrfs doesn't work on 14.2. It fails to boot with a "No /sbin/init found on rootdev" error.
The reason this happens is that the mkinitrd script ignores the rootflags that are needed to mount the correct subvolume. The patch given in the following topic appears correct and fixes this problem for me: http://www.linuxquestions.org/questi...en-4175553213/
Could this fix be applied please as all guides for using btrfs as root for Slackware recommend the generic kernel, which doesn't work for 14.2 and the solution isn't that obvious.
Hi,
Did you try appendingrootflags= to the kernel command line?
I had forgotten about this topic until it bit me once again today on another btrfs on root install. I actually have those rootflags in my lilo config, but doing that doesn't help as also reported in the topic I linked to in my first post: http://www.linuxquestions.org/questi...en-4175553213/
I'm pretty sure it is a bug if I look at /boot/init-tree/init itself. The mount command used in that file is
Code:
mount -o ro -t $ROOTFS $ROOTDEV /dev
.
From that you can see that the information needed to select the correct btrfs subvolume isn't included as in my case the mount command would have to be
Code:
mount -o ro,subvol=system -t $ROOFTS $ROOTDEV /dev
. The patch I linked to should fix it, but I tend to be lazy and just fix that mount command after a clean run of mkinitrd. With that fix the system boot as expected.
In other words just passing the rootfs and rootdevice isn't enough for a btrfs drive with volumes as rootflags don't get passed on.
I'll second what moesasji said. I to use a btrfs subvolume as root and the only dependable fix I have found is to fix the mount statement in the initrd's init script. Its pain, would be nice if these patch which looks good and I will test next time I update my kernel could get rolled into the mainline!
I've patched the init script and I'm still getting
Code:
modprobe: ERROR: could not insert 'btrfs' : Cannot allocate memory
Your problem here is that it fails to load the btrfs module, which I haven't seen before. Are you booting of a generic kernel** that includes the btrfs module in initrd?
Yes, I saw that blog in my searches and it is very close to what I did. My steps were:
Format /dev/sda1 with mkfs.btfs
mount /dev/sda1 and create subolumes
unmount and mount the root subvolume
install Slackware
create initrd-tree by running
Code:
mkinitrd
patch the init script
then run mkinitrd with my options
I have many more modules included if I run the mkinitrd_command_generator.sh, but that shouldn't impact on this.
btw) I use lilo so I am using a separate /boot partition that isn't on the btrfs volume. That might indeed not be needed for grub, but I've never tried.
I was wondering if that could be the cause, running mkinitrd with no options first. I unfortunately don't have a good understanding of how mkinitrd works. I think I tried that in one iteration but I'll give it another shot and check back in.
As for a separate boot partition, that shouldn't be needed with grub and is why I have chosen to use it. I'll try an iteration using a separate boot partition and lilo as well just to see.
Thanks for the input thus far.
Okay, seems that grub was writing the config to default to the huge kernel. Once I switched it it the generic i seem to be good on the modprobe of btrfs. I still get this though:
Code:
mount: can't find /mnt in /etc/fstab
It seems to be unrelated to btrfs though. I may start a new thread for it.
I have had the same problem. I have to run mkinitrd and than edit init in the initrd-tree, than run mkinitrd or just use cpio directly to build the image with the edited file. Its an extra step but as rarely as I change kernels its not been a serious issue.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.