Gentoo Archives: gentoo-user

From: Neil Bothwick <neil@××××××××××.uk>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] Organising btrfs subvolumes
Date: Tue, 27 May 2014 07:59:28
Message-Id: 20140527085910.32518df7@hactar.digimed.co.uk
In Reply to: Re: [gentoo-user] Organising btrfs subvolumes by "Stefan G. Weichinger"
1 On Fri, 23 May 2014 00:34:25 +0200, Stefan G. Weichinger wrote:
2
3 > > I'm working on this btrfs malarkey and have a question about best
4 > > practice. It is recommended to leave the root volume empty and
5 > > create a subvolume for the root filesystem which is set with btrfs
6 > > subvolume set-default, which I have done.
7 >
8 > Alternative: mount the subvol via option "subvolid" etc in fstab .... if
9 > you plan to mount different snapshots, for example.
10
11 I went with set-default for the root subvolume, if I need the root volume
12 I can mount it with subvolid=0.
13
14 > > What is the recommended way to create subvolumes that are mounted
15 > > further down the filesystem? Let's say I was usr and var on their
16 > > own subvolumes. Do I create them in the btrfs root, which means
17 > > they have to be mounted from /etc/fstab - or do I create hem below
18 > > the subvolume called root?
19 >
20 > I saw more examples mounting every dir via a
21 > separate line in fstab (which also adds the choice to mount them with
22 > different options, think compression etc).
23
24 That makes sense, and will be useful should we ever get encryption.
25
26 > My understanding is:
27 >
28 > * create and use subvols for entities you want to be able to snapshot
29 > and rollback individually.
30 >
31 > * create and use subvols for entities you want to apply special
32 > options to: compression, (no)COW, quota ...
33 >
34 > I would mount each subvol via extra line and create them in parallel ...
35
36 That's what i ended up doing, thanks. I did have an issue with systemd
37 failing to mount them because the correct symlinks hadn't been created
38 when I run cryptsetup in the initramfs, because it doesn't use udev, but
39 that was fairly easy to fix.
40
41 > > That raises another question. Assuming I've done it wrong (well, my
42 > > wife always does) is there an equivalent to the zfs rename command
43 > > to move or rename a subvolume?
44 >
45 > As far as I understand you are allowed to mount the root volume (or
46 > academic: any subvol in a higher level) and use plain "mv" to rename
47 > the subvols as if you renamed sub-dirs.
48
49 rust me to overlook the easy way of doing things, I was looking for an
50 equivalent to "zfs rename" and never considered mv. So far, btrfs looks
51 good on my laptop - time to think about putting it on my desktop.
52
53
54 --
55 Neil Bothwick
56
57 Ifyoucanreadthis,youspendtoomuchtimefiguringouttaglines.

Attachments

File name MIME type
signature.asc application/pgp-signature

Replies

Subject Author
Re: [gentoo-user] Organising btrfs subvolumes "Stefan G. Weichinger" <lists@×××××.at>