Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Slackware This Forum is for the discussion of Slackware Linux.


  Search this Thread
Old 09-11-2015, 09:10 AM   #1
LQ Newbie
Registered: Sep 2015
Distribution: Slackware64-current
Posts: 3

Rep: Reputation: Disabled
Is mkinitrd with Btrfs root subvolume still broken?

Hi everyone,

recently I decided to switch from the huge kernel to the generic kernel.
Usually I stick with the huge kernel because I'm too lazy to build an initrd and the huge kernel has always worked flawlessly for my needs (I don't use LUKS+LVM or any other configuration that needs an initrd).

Despite that, few days ago I decided to make the jump and I installed the generic kernel.
I used, I read /boot/README.initrd and I used mkinitrd --help in order to generate a proper command line.

But, when I rebooted my machine the boot failed because the initrd's init script was not able to launch /sbin/init, due to the fact that my root is on top of a Btrfs subvolume.

My current configuration is:
__current/ROOT ==> /
__current/HOME ==> /home
__snapshots/ROOT ==> /.snaps
__snapshots/HOME ==> /home/.snaps
<snapshots subvolumes>

In order to make the kernel aware of this configuration, I added the rootflags=subvol=__current/ROOT parameter to the boot command line, but the initrd seems to ignore it.

So, I decided to investigate and I noticed that the init script actually parses the command line from /proc/cmdline, but it ignores rootflags and it mounts the root with the only "ro" mount option.

And this behavior breaks the boot because /mnt will not contain the real root but the __current and __snapshots subvolumes.

There are two workarounds to avoid this bug:
1) Generating first /boot/initrd-tree, patching init and then generating the gz-compressed image;
2) Set __current/ROOT as the default subvolume in order to mount the subvolume automatically when no subvol flag is passed to the mount command line.

But there is a problem with the latter "solution": it does not really solve the bug.
Indeed if I boot from a snapshot the initrd will still mount __current/ROOT and not __snapshots/ROOT/ROOT@<description>, because it will still ignore the rootflags= parameter and it will mount my Btrfs pool with the default subvolume aka __current/ROOT.

So, the only viable workaround seems to be the first one.

Since it seems to be a known bug, are there any hopes to see it fixed?

Luca De Pandis


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with /home mount on a btrfs subvolume - systemd exvor Gentoo 1 06-19-2015 11:19 AM
install with BTRFS: subvolume/partition scheme? horizonbrave Linux - Newbie 5 01-05-2015 08:35 AM
[SOLVED] Btrfs: Moving a large chuck of data from filesystem to subvolume vinbob Linux - Software 1 09-18-2014 04:42 AM
btrfs subvolume quota phil.d.g Linux - Software 0 08-29-2011 12:18 AM
Slack current with btrfs root (seperate /boot) has mkinitrd issue rexregis Slackware 7 03-12-2011 08:21 AM > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 09:20 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration