BTRFS and Qubes OS

That’s insecure (unless the ‘private’ volume hasn’t been initialized yet after creating the qube, or the volume has been cleared):

1 Like

Want to mount /home/user or even /home as a subvolume.

Should I add it in the fstab (I remember having huge issues with fstab and bind-dirs)

Or can this also work via the rc.local ( “mount /home” or can I somehow also append the lines from Inside the appvm to fstab?) ?

The ‘private’ volume is already the block device that’s hosting /home. More precisely it’s hosting the contents of /rw; and /home is a bind mount to /rw/home. So once you’ve converted the ‘private’ volume to Btrfs, you are free to create subvolumes anywhere in /rw (which is now the top level subvolume of that Btrfs filesystem), including anywhere in /home, /home/user, …, without having to change anything in fstab or rc.local.

I don’t know if that answers your question? Maybe I’m misunderstanding what you’re trying to do.

If you want to use subvolumes to have multiple versions of the whole home directory and switch between them, it might be easier to go even further and instead have multiple versions of the top level subvolume that’s mounted at /rw. That way you can select the active one using sudo btrfs subvolume set-default rather than by editing fstab (which would complicate things since it’s part of the TemplateVM, not of the AppVM).

bind-dirs and rc.local are too late in the boot process to set up the home directory.

I don’t want to mount the “root” of the btrfs partition directy to /home. I would like to create a home subdir and then mount the root under /btrfs_pool and mount the subdir home as /home. I wonder where I should put this:

UUID=df2d4761-d84b-4fea-af88-2dd5d7eeca4c /home btrfs subvol=home,ssd,compress=zstd,discard=async,x-systemd.device-timeout=0

UUID=df2d4761-d84b-4fea-af88-2dd5d7eeca4c /btrfs_pool 0 0 btrfs subvolid=5,ssd,compress=zstd,discard=async,x-systemd.device-timeout=0 0 0

I guess I would need a custom template if it’s to late ?

Mounting the root under /btrfs_pool should be possible in rc.local.

As for mounting a subvolume at /home, it seems unnecessarily painful. I’d just avoid doing that and find another way to use subvolumes.

I don’t really get why mounting subvolid=5 under /btrfs_pool should be possible but not /home but doesn’t really matter now.

Anyway thanks for you help. Works fine so far.
I am just going to restructure my stuff a little bit. Creating a subolume under /home/user/btrfs_something move everything I want into it and just create some sym-links.

Thanks for your help!

Just read your previous edited comment. And yeah I think I might go that route instead I think you were talking about this? Btrfs - ArchWiki

1 Like

Linus himself has threatened to remove bcachefs from the kernel not two weeks ago.

would be nice to install Qubes on root. ZFS is part of the battery of tests that Qubes undergoes. The installer could compile the module (it ships as source) and deploy it before first boot.

all my Qubes OS boxes run on ZFS. it works incredibly well and has saved my ass many, many times.

I am largely not involved with the Qubes OS project at this point.

1 Like

After using btrfs install for a few months, it doesn’t seem like that much of an improvement over my lvm default install.

It’s performance during shutdown of very large qubes (500+ gib database) slows down as the qube grows. I’ve done defrag on it but within a few days, it is back to taking 30-60 seconds. My lvm machine with the same qube is consistent

@rustybird said

the only thing I’m aware of that needs some tweaking in the installer and in qubes-dist-upgrade is not to hardcode discard[=sync] in fstab.)

Of course, that applies to dom0 fstab as well.

Also, this issue Working plan to have better qubesos btrfs settings from install · Issue #211 · tasket/wyng-backup · GitHub
(I gave up testing bees for now. Wyng/beesd would need /var/lib/qubes to be subvolume of rootfs, and dom0 would need to be either sepetate rootfs volume or root/private disk images as all other qubes to ease dom0 backup and restore…)

Feel free to comment in issues torward better implementation and installer defaults.

1 Like

A question for qubes users using btrfs. Has your performance stayed the same in the last 3-6 months ? My btrfs system is slower to start appvms (specifically taking a long time to allocate above minimum memory) while my lvm/ext system has stable performance. I’m not sure if it is btrfs or maybe an erratic nvme connection

Maybe you should try to defragment your btrfs volume, especially if it’s on a HDD or if it’s quite full (the more it’s used, the more fragmentation you have).

see btrfs filesystem defragment

see Solene'% : My BTRFS cheatsheet

1 Like

Be aware that this breaks dupes , subvolumes etc…

Archwiki:

Warning: Defragmenting a file which has a COW copy (either a snapshot copy or one made with cp or bcp) plus using the -c switch with a compression algorithm may result in two unrelated files effectively increasing the disk usage.
2 Likes

There is an ongoing long technical discussion on de-fragmentation vs. bees. If anyone is interested:

2 Likes