You are not logged in.

#1 2017-08-03 07:05:28

casual
Member
Registered: 2016-04-04
Posts: 18

Specifying a btrfs subvolume as the root filesystem of a linux kernel

I installed arch on a subvolume of a new btrfs drive.

To familiarize myself with grub I decided to load the kernel using the command line shell it provides.  The process has been straightforward but I've reached a small problem I haven't been able to easily find the answer to.

This is as far as I've gotten with the kernel load command from the grub prompt:

linux ($root)/roots/arch/root/boot/vmlinuz-linux root=LABEL=linuxdistros init=/lib/systemd/systemd

The problem with this line is that it recognizes the btrfs device after boot (as intended) but of course it can't find /lib/systemd/systemd because it's searching from the top level and not the subvolume.  After some searching I haven't been able to find anything in the kernel documentation which indicates how to specify a subvolume for the root.

You can see in the documentation below that the "root=" option is further elaborated on in a "name_to_dev_t comment in init/do_mounts.c."
https://www.kernel.org/doc/Documentatio … meters.txt

And if we look at that comment we find there's no mention of anything related to subvolumes, only partitions and UUIDs:
https://github.com/torvalds/linux/blob/ … o_mounts.c

There's nothing obvious in the btrfs documentation I can find about this either.  Maybe I'm looking in the wrong places?

Offline

#2 2017-08-03 08:37:43

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: Specifying a btrfs subvolume as the root filesystem of a linux kernel

subvol=<derp> mount option   edit: rootflags=subvol=<derp> on the kernel parameter line
You can also set the default subvolume to avoid having to explicitly specify in fstab/bootloader config

Last edited by Mr.Elendig (2017-08-03 08:39:18)


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#3 2017-08-03 19:45:07

casual
Member
Registered: 2016-04-04
Posts: 18

Re: Specifying a btrfs subvolume as the root filesystem of a linux kernel

Yep that's it.  I totally overlooked the rootflags option right below it lol.  Thanks!

Offline

#4 2017-08-10 13:15:17

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,092

Re: Specifying a btrfs subvolume as the root filesystem of a linux kernel

Please mark your thread as [solved] then


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

Board footer

Powered by FluxBB