On Thu, 27 Jul 2023 17:18:14 +0100, Michael wrote: > Although I've been using btrfs for the best part of 10 years I have not > really done justice to it, because I have neither explored nor used > enough most of its features. I am now thinking of installing Gentoo on > btrfs again, but this time I want to optimise the structure of btrfs > subvolumes, to simplify snapshots and backups. > > I see Ubuntu and derivates install the OS root fs under btrfs subvolume > "@" and /home under subvolume "@home". This makes storing snapshots of > the two subvolumes under the btrfs top-volume, which remains unmounted, > cleaner and reduces the chance of mixing up the fs you may end up in > and operate on (live, or snapshot). > > I have 3 partitions for /boot(ESP), / and /home, but have not yet > created additional partitions for general data storage and backups. > > What's your recommended approach and subvolume structure for the > deployment of btrfs on Gentoo for a personal PC, if the primary > objective is simplicity in maintenance, combined with ease of fs > recovery?
I too put everything on subvolumes, and set the one containing / to be the default when mounted without a subvolid. > Any gotchas I should be mindful of? > > Your favoured snapshot/backup strategy? I have a script, I can share it with you if you don't criticise my coding, that creates and destroys snapshots from cron. Based in principle on zfs-snapshot but written from scratch. > The impact of autodefrag on VM performance is noted, but then the > example given proceeds to mount a subvolume for VM storage with > 'autodefrag'. :-/ I disable COW on the subvolume containing my VM disk volumes. > Encryption is mentioned for VMs "... if the VM uses drive encryption, > the whole compression strategy gets blown out of the water" but doesn't > mention what type of encryption, or why/how this presents a problem. > > Given btrfs does not offer fs level encryption, what could/would work > to encrypt a subvolume, *without* requiring an initrd, or the > introduction of encryption becoming orthogonal with snapshots and > backups? I am not clear on the best strategy and components to achieve > this. I'm also concerned of introducing an additional complexity layer > in trying to recover btrfs when/if fs corruption creeps in. The lack of encryption is a problem. You have to encrypt the block device(s) containing btrfs, which means you will need an initrd. It also means each component of a RAID is encrypted separately. so I only use encryption on laptops. The alternative is to use ecryptfs for individual subvolumes or directories. -- Neil Bothwick If you got the words it does not mean you got the knowledge.
pgpkJpovqLKoi.pgp
Description: OpenPGP digital signature