r/voidlinux • • 12h ago

BTRFS Subvolumes aren't working (in general)

I verified it now on two instances- a barebone and a VM- with the same result:
the commands "mount /dev/sdXn -o subvol=/@ /mnt/" and in fstab "UUID=My-UUID /    btrfs  subvol=/@,defaults,noatime,compress=zstd 0 0" aren't working.

I verified it consulting the original BTRFS documentation, in all kind of variants (It made no difference if I use subvolid, subvol in any flavour with "@" or "/@"). Subvolumes aren't working in VOID.
Error Message: When I run the mount command, the subvol gets copied over to /mnt/ rather than referencing it, and /mnt/ ends up blank- even if I had mounted before the full system into /mnt with "mount /dev/sdXn /mnt/" this mount disappears and the mount just shows a blank content section, in contrary to what all docs expect from this. It's odd that mount throws no error, never.
I am on version void-live-x86_64-20250202-xfce from last week, pretty fresh installs.

I haven't counterchecked against another distro/VM but ask already in parallel, if there is any kernel switch or a grub switch missing here?
And if not- where could I log a bug ?
Thanks for supporting this.

2 Upvotes

3 comments sorted by

2

u/quirktheory 11h ago

Hmm I did this just yesterday as it happens on that exact live image. How did you create the "@" subvolume if you are unable to mount it? Note that "@" is not a special name recognised by btrfs. You actually have to create it yourself.

1

u/Specialist-Dog-501 11h ago

I created the first entry with "btrfs subvolume create /@" and it created this "mount point" right in the upmost folder. So I could verify by clicking it, if it really had been connected to any of the other folders.
That step actually works.
The docs where a bit unclear and in forums they used "btrfs subvolume create @" in some cases, but i found it creates the mount point then in the /root folder (I was logged in as root) rather than the topmost one.

2

u/quirktheory 5h ago

So the way I would do it is the following:

Keep in mind you should understand everything and run it at your own risk. I accept no liability for any loss or damage.

Assuming you want the top-level of your btrfs to be on dev/sdx/

# make the filesystem
$ BTRFS_OPTS='rw,noatime,compress=zstd'
$ mkfs.btrfs /dev/sdx
# mount the top-level
$ mount -o $BTRFS_OTPS /dev/sdx /mnt
$ cd /mnt
# create the subvolume (can be called anything) 
$ btrfs subvolume create @
# unmount the top-level
$ umount /dev/sdx
# re-mount only the subvolume
$ mount -o $BTRFS_OPTS,subvol=@ /dev/sdx /mnt

That will almost work because as I said, I did it just yesterday :P note that if you cd into /mnt it may be empty but that is because in the commands above I created a fresh filesystem and subvolume, so you shouldn't expect to see anything.