Default btrfs mount options and subvolume layout

Thanks, I’ll look into this

@Chrysostomus I read that the latest Qonos release has optimised Btrfs subvolume configuration.

Swapfile is now created in its own root subvolume. Why?
The only reason to create a subvolume of it is because you need to exclude it from its parent subvolume (@). Isn’t that what nested subvolumes are for?

Also, Calamares is still misleading when selecting BTRFS. Because:

  1. You still have 2 options that don’t make sense: partitioning.
  2. There is no option to correctly setup hibernation. The one that exist uses partitioning. The whole idea of subvolumes is you don’t need a separate partition for swap.

If one wants BTRFS and hibernation, that only place containing the correct info for it is here:
[HowTo] Enable and configure hibernation with BTRFS the script in the first post.

Could the option for “swapfile (with hibernation)” be added and the partition options be disabled when BTRFS is selected? That would make more sense.

It is only a “design decision” to make a “nested subvolume” or a “root subvolume”.

  • But flat layouts are easier to maintain
  • And more people do understand that a subvolume in a flat layout is completely independent from all other subvolumes

Btrfs

https://wiki.manjaro.org/index.php/Btrfs

1 Like

Not sure if it is the right place question, but it is related to BTRFS and calamares, so fingers crossed.
I have just made a new VM to play around with manjaro BTRFS (my rig is running manjaro on ext4 now). I also have a notebook with arch & btrfs on it. I tried moving my @home around, and so I wanted to edit the fstab (/mnt/@/etc/fstab), and when I compared my arch and my VM fstab-s, I noticed that none of my mounts use the following baseline settings:
space_cache
subvolid
I wonder if the lack of former is optimal, and I wonder if the lack of the latter is significant

Thanks.

subvol=@… is better then subvolid

I don’t use space_cache

... /         	btrfs       rw,noatime,compress=zstd:9,commit=300,subvol=@	0 0
... /home     	btrfs     	rw,noatime,compress=zstd:9,commit=300,subvol=@home	0 0

You find best infos in https://btrfs.wiki.kernel.org/

As Andreas say’d you should use subvol=xyz mounts because later when you have done some rollbacks the subvolume id’s are now changed but not they subvolume names. With the use of subvolid you have on each rollback to update your fstab. The only usecase for subvolid i have is the mount of the btrfs root. I mount this root on /btrfs folder to get easier access to the btrfs filesystem for maintenance.

I even don’t use space_cache and ssd options because btrfs should automatical detect this. With one exception: on external attached SSDs (USB to SATA dongle) the system does not detect it right. Then i use sdd,space_cache, and only space_cache not they versions like space_cache=v2 and so on because this doesn’t work correctly.

I still don’t understand why Calamares still allows for improper configuration of swap (on partition) and faulty hibernation :frowning:

Thanks for the info, it’s long time ago as i have tested Timeshift, then one point of my above statement is irrelevant.

Another way i make rollbacks

sudo mv /btrfs/@ /btrfs/@snapshots/old_root
sudo btrfs su sn /btrfs/@snapshots/root/15/snapshot /btrfs/@

where /btrfs/@snpashots/root/15/snapshot is the currently booted ro-snapshot. This save the damaged subvolume, now as snapshot in @snapshots. You can even exchange @ from a running system (started from @), and reboot or remount into the new setup.

Last case i tried self and it seemed to work properly, but would not trust it eighter :slight_smile:
The nice thing with this way is that any setup/config of FSTAB, GRUB, initramfs and kernels that’s stored into a snapshots remains correctly after rollback of @. You need only to know that in FSTAB we have to work only with subvol=@ mounts, not subvolid=xxx mounts. After a genfstab >> /etc/fstab we have to edit these mounts. There is only one point to consider: any later changes on partition, UUIDs, mountpoints and so on are forbidden, because we break the system configuration stored in our snapshots.

A small script started on boot from a ro-snapshot, selected in GRUB, could do this Rollback automatical and reboot the machine. Like we can when GRUB start the UEFI Shell.
This script maybe ask the User if he wish to start the CLI or Desktop Environment or want to rollback the system and reboot. I think thats a small patch on grub-btrfs script.

But you’re right, the problem are the toolchain, in any case some small changes are needed to get a system which can be presented to common users, with small knowledge of BTRFS. But, in longer timescale the user have to learn BTRFS.

I remember my startup problems with BTRFS, the biggest one at beginning was: “how fu…ing should i setup my BTRFS layout ?”, “Have i to exclude /var or only partial like older suse setup with many subvolumes for /var ?” And on these question Manjaro Installer can give advise.

“Calamares can now handle swapfiles with btrfs automatically per user setting. It uses the swap subvolume”,

good to know, i use architect or easily clone my systems with rsync.

Last time i tried calamares i must overseen this feature, or is it new?


Welcome.

Out of curiosity:

Since this is your first post - which statement would that be?