You are not logged in.

#1 2022-01-25 17:31:19

randomxusr
Member
Registered: 2021-08-04
Posts: 30

BTRFS Use Cases, suggestions and Recommendations

Hi All,

Is there a recommended Filesystem layout for using a single block device/partition? Say for the Root filesystem.

Does it make sense to have a flat layout with @home, @var,@boot, and @usr and so on?  I think @usr is a poor choice, maybe because I've recently had issues with that one.

Does it make more sense on a single partition to have only a single Root subvol and snapshot the whole thing, or use other tools for back, not directly using snapshots?

Finally, what are the implications of a root filesystem using a flat layout vs a nested layout?

I've read the docks on the btrfs wiki, am studying the man pages, and looking for other resources to help with these questions, but wanted ask the experts and other users.

Thanks

Offline

#2 2022-01-25 19:15:04

ratcheer
Member
Registered: 2011-10-09
Posts: 912

Re: BTRFS Use Cases, suggestions and Recommendations

I will not declare myself a btrfs expert, but OTOH, I have been using it for several years on all of my hosts, I personally prefer the flat layout for two reasons. First, nested subvolumes are not snapshotted with their parent(s). Some people use that fact as a feature in order to prevent certain subvolumes from being snapshotted, but I do not. Second, if the nesting goes multiple layers deep, it can become confusing.

So, I have three drives on my system. My backup drive and my database storage drive each have one mounted subvolume. But my main system has two mounted subvolumes, / and /home. So, each is one level below the brtfs root, and I snapshot them individually.

Offline

#3 2022-04-06 20:23:13

dungeonseeker
Member
Registered: 2022-04-06
Posts: 7

Re: BTRFS Use Cases, suggestions and Recommendations

The general consensus is that the "Ubuntu Default" scheme is the one best suited to everyday use with just @ for root and @home for /home. This is the sane default used across most distros when the user chooses BTRFS (and is now the default on the arch guided installer as well). If you are wanting recovery snapshots with Timeshift then you MUST use this layout otherwise TS will only work in RSYNC mode.

BTW @boot is not possible (at least AFAIK) since EFI requires a FAT32 volume to boot from.

To create the layout (I'll use sda as my example, obvs change it to suit your setup), assuming you have partitioned and formatted a 300M F32 EFI (sda1) for boot, whatever for swap (sda2) and the rest as BTRFS (sda3):

mount /dev/sda3 /mnt
btrfs subvolume create /mnt/@
btrfs subvolume create /mnt/@home
umount -R /mnt
mount /dev/sda3 -o subvol=@ /mnt
mkdir /mnt/{boot,home}
mount /dev/sda3 -o subvol=@home /mnt/home
mount /dev/sda1 /mnt/boot
swapon /dev/sda2
pacstrap as usual
genfstab -U /mnt /mnt/etc/fstab

Last edited by dungeonseeker (2022-04-06 20:27:15)

Offline

Board footer

Powered by FluxBB