btrfs subvolumes

anonymous_user0414

New Member
Nov 15, 2022
28
3
3
I have installed pve as btrfs raid1 and

don't understand why only the subvolume btrfs-local exists and not the complete root as / subvolume.

With this it is not possible to make snapshots of / ...

can someone please explain this to me?
 
Old thread with no answer so my2cents...
Because apparently they favour zfs or simply don't know how to setup a decent subvol structure !
See also the debian installer no decent structure either....
 
Actually, I'm using btrfs for the root and not for vm disks (for them I use lvmthin instead). I use for integrity and autorepair (with raid1) and in the future (shortly) also possible snapshot of the root for faster "rollback" in case of serious issue after system upgrade.

For the root part I also think it would be useful to have the root in a separate subvolume and for another thing that I know for now that it could be useful to have in a separate subvolume also /var/log so that you can take snapshots of the root without including local-btrfs and without the logs (both for less writing on the snapshots and occupied space and in case of restoring the root keep the logs is useful for debugging).
Are there any other sub-volumes that you think would be useful to have?

I saw that developers added compression support for btrfs in the installer (configurable) for the next version (from fast look to pve-installer git), another useful thing, maybe by reporting well what could be useful for the sub-volumes so they could improve that part too
 
  • Like
Reactions: intrax
Great idea as I'm a big btrfs fan!
I have only created a separate @home subvol, but your idea makes a lot of sense.
Could you share your subvolume structure?
 
Even if I have been using btrfs for about ten year on many volumes on servers and some on personal devices the use I made of it as root even if on many servers and some other cases has always been without snapshots in production, while snapshots and management of subvolumes only for backup disks or data archives.
Recently I'm getting better informed and doing other tests because soon I will use btrfs on root and with snapshots seriously on my new workstation and I would like to use it also on proxmox roots.
In both cases given the limited support for subvolumes (in installation) both in proxmox and for ubuntu 24.04 and debian unstable that I will use on my workstation I will have to make manual additions/modifications outside what the installation supports.

So I think it's useful to have the opinion of other users too, especially those with more experience using root with snapshots.

Basically from what I have learned in using snapshots for years for other cases and the notable impact, especially if not managed well it seems quite clear to me that the more targeted they are and the more they exclude unnecessary parts the less their impact on space and possibly also on performance will be.
So besides the need to have the root in a subvolume and also a separate subvolume for /var/log, for debugging in case of rollback, I think it would be useful to have other subvolumes too.
Based on the research done at the moment, I think the essential sub-volumes could be:
- for / (the root)
- for /var/log: both to keep them for debugging in case of root rollback and for the numerous writes on them
- for btrfs-local (already present)
Further ones that may be useful:
- for /var/cache, /var/tmp and /tmp: contain temporary files and caches. With Debian 13 /tmp will be tmpfs and subvolume for it will be not needed anymore.
- /var/spool: even maybe not very useful in the case of proxmox which seems to me to be little used, I suppose it would help to maintain only a few rare emails and the impact on both space and performance would be minimal.
- /root and /home: I think they generally are not very used in Proxmox, but they could be useful anyway, especially if there is a significant use of them in some cases.

Can anyone give their advice and opinions?
 
Last edited:
Not much response here as the proxmox community seems to be favouring ZFS.

I am using btrrfs on multiple systems both for business and private use and find it to be solid and reliable !

I would suggest following subvols in opensuse style:

-/ @ (the root)
-/.snapshots @snapshots
-/home @home
-/var/log @log
-/var/cache @cache
-/var/tmp @vartmp
-/tmp @tmp
-/var/lib/pve/local-btrfs (managed by proxmox)

Running snapper for timed snapshots on update or timer events also works really great.

I would like to see support for these subvols in the proxmox installer...

To boot into a snapshot on a failed update or other system mayhem you need to install grub-btrfs.
 
About the snapshots subvolume I think should be excluded by the install ones, as seems proxmox basically don't support snapshot/backup of the host, so it would be added by users who would like to do it and based on what they will use.
About grub-btrfs would be good to have it packaged on Debian but whoever initially volunteered in ITP didn't have time, I was thinking of doing it myself but I'm afraid I won't have enough time before Debian 13 freezes (I don't know when I'll have time, I have some things to do first in other packages I maintain)
however grub-btrfs and subvolumes would be just parts, obviously more is needed in order to have good snapshot support, their boot and possible fully functional restore.
Subvolumes would be a useful first step towards better management for some other things as well.
 
  • Like
Reactions: intrax
In addition to the subvolumes themselves I would say that the layout used should also be considered, at the moment as regards the volumes it creates they are nested and even if not optimal for manual management and in the rollback, being managed by proxmox it could also be fine, I have also used nested subvolumes for years with custom scripts and on data volumes, without particular needs and manual management can be fine.
However, I am seeing that in fact for the management of the root and any rollbacks it would be better to have a flat layout as many recommend.
Maybe it could be good to make a flat layout for the root-related subvolumes and the btrfs-local subvolume and leave the internal vm disk management as nested.
It would be good to have opinions from different people on this matter.


Here some docs related:
https://archive.kernel.org/oldwiki/btrfs.wiki.kernel.org/index.php/SysadminGuide.html#Layout
https://wiki.tnonline.net/w/Btrfs/Getting_Started#Subvolumes
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!