Friday, March 13, 2020

[qukndhwr] Installing Linux onto btrfs subvolumes

btrfs intriguingly has subvolumes, usable (among other ways) as an alternative to partitions.  For example, the Ubuntu installer, when the user chooses btrfs, sets up separate subvolumes for the root directory ("@") and home ("@home"), including configuring grub and initramfs the right way for this setup.

It seems one should be able to install different Linux installations all on the same btrfs filesystem, in different subvolumes, for dual (and more) booting.  This seems better than dedicating separate partitions for each Linux install because one doesn't have to dedicate a certain amount of disk to each install.  Each can flexibly grow into the shared space without need for manual intervention of resizing filesystems.

Will it work?  Neither the Ubuntu nor Debian installers have such a feature.  update-grub probably needs to be modified to search through subvolumes as possible boot options.

Even more radically, why do subvolumes when one can do subdirectories?  Then one don't even need btrfs.  One could either do things like boot-time bind-mounting the directories of the running OS into the standard locations, or, far more radically, have everything be relocatable.  Nothing assumes a standard location, but instead at most assumes a standard subdirectory of a user-specified prefix.

No comments :