* generic name for volume and subvolume root?
@ 2017-09-09 8:35 Ulli Horlacher
2017-09-09 10:40 ` Qu Wenruo
` (2 more replies)
0 siblings, 3 replies; 8+ messages in thread
From: Ulli Horlacher @ 2017-09-09 8:35 UTC (permalink / raw)
To: linux-btrfs
As I am writing some documentation abount creating snapshots:
Is there a generic name for both volume and subvolume root?
Example:
root@fex:~# btrfs subvol show /mnt
ERROR: not a subvolume: /mnt
root@fex:~# btrfs subvol show /mnt/test
/mnt/test is toplevel subvolume
root@fex:~# btrfs subvol show /mnt/test/data
/mnt/test/data
Name: data
UUID: b32a5949-dfd6-ef45-8616-34ae4cdf6fb8
(...)
root@fex:~# btrfs subvol show /mnt/test/data/sw
ERROR: not a subvolume: /mnt/test/data/sw
I can create snapshots of /mnt/test and /mnt/test/data, but not of /mnt
and /mnt/test/data/sw
Is there a simple name for directories I can snapshot?
--
Ullrich Horlacher Server und Virtualisierung
Rechenzentrum TIK
Universitaet Stuttgart E-Mail: horlacher@tik.uni-stuttgart.de
Allmandring 30a Tel: ++49-711-68565868
70569 Stuttgart (Germany) WWW: http://www.tik.uni-stuttgart.de/
REF:<20170909083551.GC22060@rus.uni-stuttgart.de>
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: generic name for volume and subvolume root? 2017-09-09 8:35 generic name for volume and subvolume root? Ulli Horlacher @ 2017-09-09 10:40 ` Qu Wenruo 2017-09-09 10:48 ` Ulli Horlacher 2017-09-09 11:00 ` Hugo Mills 2017-09-10 14:21 ` Peter Grandi 2 siblings, 1 reply; 8+ messages in thread From: Qu Wenruo @ 2017-09-09 10:40 UTC (permalink / raw) To: linux-btrfs, framstag On 2017年09月09日 16:35, Ulli Horlacher wrote: > As I am writing some documentation abount creating snapshots: > Is there a generic name for both volume and subvolume root? > > Example: > > root@fex:~# btrfs subvol show /mnt > ERROR: not a subvolume: /mnt > > root@fex:~# btrfs subvol show /mnt/test > /mnt/test is toplevel subvolume > > root@fex:~# btrfs subvol show /mnt/test/data > /mnt/test/data > Name: data > UUID: b32a5949-dfd6-ef45-8616-34ae4cdf6fb8 > (...) > > root@fex:~# btrfs subvol show /mnt/test/data/sw > ERROR: not a subvolume: /mnt/test/data/sw > > > I can create snapshots of /mnt/test and /mnt/test/data, but not of /mnt > and /mnt/test/data/sw > > Is there a simple name for directories I can snapshot? > > Nope, subvolume (including snapshot) is not distinguished by its filename/path/directory name. And you can only do snapshot on subvolume (snapshot is one kind of subvolume) boundary. For user to determine where is the subvolume boundary, one should first determine there is the btrfs mounted and then use "btrfs subvol show" to determine the boundaries. Or, in a btrfs test the directory inode number. Subvolume/snapshot in btrfs will always have the same inode number 256, and regular file/directories/special files will not use that magic number. Thanks, Qu ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: generic name for volume and subvolume root? 2017-09-09 10:40 ` Qu Wenruo @ 2017-09-09 10:48 ` Ulli Horlacher 2017-09-09 10:58 ` Qu Wenruo 0 siblings, 1 reply; 8+ messages in thread From: Ulli Horlacher @ 2017-09-09 10:48 UTC (permalink / raw) To: linux-btrfs On Sat 2017-09-09 (18:40), Qu Wenruo wrote: > > Is there a generic name for both volume and subvolume root? > > Nope, subvolume (including snapshot) is not distinguished by its > filename/path/directory name. > > And you can only do snapshot on subvolume (snapshot is one kind of > subvolume) boundary. So, I can name a btrfs root volume also btrfs subvolume? I am talking about documentation, not coding! I just want yo use the correct terms. -- Ullrich Horlacher Server und Virtualisierung Rechenzentrum TIK Universitaet Stuttgart E-Mail: horlacher@tik.uni-stuttgart.de Allmandring 30a Tel: ++49-711-68565868 70569 Stuttgart (Germany) WWW: http://www.tik.uni-stuttgart.de/ REF:<48008a58-a82e-d9f7-327e-eeb905e18aa1@gmx.com> ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: generic name for volume and subvolume root? 2017-09-09 10:48 ` Ulli Horlacher @ 2017-09-09 10:58 ` Qu Wenruo 2017-09-09 11:06 ` Hugo Mills 0 siblings, 1 reply; 8+ messages in thread From: Qu Wenruo @ 2017-09-09 10:58 UTC (permalink / raw) To: linux-btrfs, framstag On 2017年09月09日 18:48, Ulli Horlacher wrote: > On Sat 2017-09-09 (18:40), Qu Wenruo wrote: > >>> Is there a generic name for both volume and subvolume root? >> >> Nope, subvolume (including snapshot) is not distinguished by its >> filename/path/directory name. >> >> And you can only do snapshot on subvolume (snapshot is one kind of >> subvolume) boundary. > > So, I can name a btrfs root volume also btrfs subvolume? Yes, root volume is also a subvolume, so just call "btrfs root volume" a "subvolume". > > I am talking about documentation, not coding! > > I just want yo use the correct terms. If you're referring to the term, I think subvolume is good enough. Which represents your original term, "directories one can snapshot". For the whole btrfs "volume", I would just call it "filesystem" to avoid the name "volume" or "subvolume" at all. Thanks, Qu ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: generic name for volume and subvolume root? 2017-09-09 10:58 ` Qu Wenruo @ 2017-09-09 11:06 ` Hugo Mills 2017-09-09 11:13 ` Hans van Kranenburg 0 siblings, 1 reply; 8+ messages in thread From: Hugo Mills @ 2017-09-09 11:06 UTC (permalink / raw) To: Qu Wenruo; +Cc: linux-btrfs, framstag [-- Attachment #1: Type: text/plain, Size: 1854 bytes --] On Sat, Sep 09, 2017 at 06:58:38PM +0800, Qu Wenruo wrote: > > > On 2017年09月09日 18:48, Ulli Horlacher wrote: > >On Sat 2017-09-09 (18:40), Qu Wenruo wrote: > > > >>>Is there a generic name for both volume and subvolume root? > >> > >>Nope, subvolume (including snapshot) is not distinguished by its > >>filename/path/directory name. > >> > >>And you can only do snapshot on subvolume (snapshot is one kind of > >>subvolume) boundary. > > > >So, I can name a btrfs root volume also btrfs subvolume? > > Yes, root volume is also a subvolume, so just call "btrfs root volume" > a "subvolume". I find it's best to avoid the word "root" entirely, as it's got several meanings, and it tends to get confusing in conversation. Instead, we have: - "the top level" (subvolid=5) - "/" (what you see at / in your running system) - "<top-level>/@" or similar names (the subvolume that's mounted at /) > >I am talking about documentation, not coding! > > > >I just want yo use the correct terms. > > If you're referring to the term, I think subvolume is good enough. > Which represents your original term, "directories one can snapshot". > > > For the whole btrfs "volume", I would just call it "filesystem" to > avoid the name "volume" or "subvolume" at all. Yes, it's a filesystem. (Although that does occasionally cause confusion between "the conceptual filesystem implemented by btrfs.ko" and "the concrete filesystem stored on /dev/sda1", but it's generally far less confusing than the overloading of "root"). Hugo. -- Hugo Mills | Well, you don't get to be a kernel hacker simply by hugo@... carfax.org.uk | looking good in Speedos. http://carfax.org.uk/ | PGP: E2AB1DE4 | Rusty Russell [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 836 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: generic name for volume and subvolume root? 2017-09-09 11:06 ` Hugo Mills @ 2017-09-09 11:13 ` Hans van Kranenburg 0 siblings, 0 replies; 8+ messages in thread From: Hans van Kranenburg @ 2017-09-09 11:13 UTC (permalink / raw) To: Hugo Mills, Qu Wenruo, linux-btrfs, framstag On 09/09/2017 01:06 PM, Hugo Mills wrote: > On Sat, Sep 09, 2017 at 06:58:38PM +0800, Qu Wenruo wrote: >> >> >> On 2017年09月09日 18:48, Ulli Horlacher wrote: >>> On Sat 2017-09-09 (18:40), Qu Wenruo wrote: >>> >>>>> Is there a generic name for both volume and subvolume root? >>>> >>>> Nope, subvolume (including snapshot) is not distinguished by its >>>> filename/path/directory name. >>>> >>>> And you can only do snapshot on subvolume (snapshot is one kind of >>>> subvolume) boundary. >>> >>> So, I can name a btrfs root volume also btrfs subvolume? >> >> Yes, root volume is also a subvolume, so just call "btrfs root volume" >> a "subvolume". > > I find it's best to avoid the word "root" entirely, as it's got > several meanings, and it tends to get confusing in conversation. > Instead, we have: > > - "the top level" (subvolid=5) > - "/" (what you see at / in your running system) > - "<top-level>/@" or similar names > (the subvolume that's mounted at /) > >>> I am talking about documentation, not coding! >>> >>> I just want yo use the correct terms. >> >> If you're referring to the term, I think subvolume is good enough. >> Which represents your original term, "directories one can snapshot". >> >> >> For the whole btrfs "volume", I would just call it "filesystem" to >> avoid the name "volume" or "subvolume" at all. > > Yes, it's a filesystem. (Although that does occasionally cause > confusion between "the conceptual filesystem implemented by btrfs.ko" > and "the concrete filesystem stored on /dev/sda1", but it's generally > far less confusing than the overloading of "root"). Yes, because every subvolume is a filesystem root! :-D https://i.imgur.com/2VzmC.gif -- Hans van Kranenburg ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: generic name for volume and subvolume root? 2017-09-09 8:35 generic name for volume and subvolume root? Ulli Horlacher 2017-09-09 10:40 ` Qu Wenruo @ 2017-09-09 11:00 ` Hugo Mills 2017-09-10 14:21 ` Peter Grandi 2 siblings, 0 replies; 8+ messages in thread From: Hugo Mills @ 2017-09-09 11:00 UTC (permalink / raw) To: linux-btrfs [-- Attachment #1: Type: text/plain, Size: 1372 bytes --] On Sat, Sep 09, 2017 at 10:35:51AM +0200, Ulli Horlacher wrote: > As I am writing some documentation abount creating snapshots: > Is there a generic name for both volume and subvolume root? > > Example: > > root@fex:~# btrfs subvol show /mnt > ERROR: not a subvolume: /mnt > > root@fex:~# btrfs subvol show /mnt/test > /mnt/test is toplevel subvolume > > root@fex:~# btrfs subvol show /mnt/test/data > /mnt/test/data > Name: data > UUID: b32a5949-dfd6-ef45-8616-34ae4cdf6fb8 > (...) > > root@fex:~# btrfs subvol show /mnt/test/data/sw > ERROR: not a subvolume: /mnt/test/data/sw > > > I can create snapshots of /mnt/test and /mnt/test/data, but not of /mnt > and /mnt/test/data/sw > > Is there a simple name for directories I can snapshot? Subvolume. If you can snapshot it, it's a subvolume. Some subvolumes are also snapshots. (And all snapshots are subvolumes). The subvolume with ID 5 (or ID 0, which is an alias) is the "top level subvolume", and has the unique property that it can't be renamed, deleted or replaced, where all other subvolumes can be. Hugo. -- Hugo Mills | Well, you don't get to be a kernel hacker simply by hugo@... carfax.org.uk | looking good in Speedos. http://carfax.org.uk/ | PGP: E2AB1DE4 | Rusty Russell [-- Attachment #2: Digital signature --] [-- Type: application/pgp-signature, Size: 836 bytes --] ^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: generic name for volume and subvolume root? 2017-09-09 8:35 generic name for volume and subvolume root? Ulli Horlacher 2017-09-09 10:40 ` Qu Wenruo 2017-09-09 11:00 ` Hugo Mills @ 2017-09-10 14:21 ` Peter Grandi 2 siblings, 0 replies; 8+ messages in thread From: Peter Grandi @ 2017-09-10 14:21 UTC (permalink / raw) To: Linux fs Btrfs > As I am writing some documentation abount creating snapshots: > Is there a generic name for both volume and subvolume root? Yes, it is from the UNIX side 'root directory' and from the Btrfs side 'subvolume'. Like some other things Btrfs, its terminology is often inconsistent, but "volume" *usually* means "the set of devices [and contained root directories] with the same Btrfs 'fsid'". I think that the top-level subvolume should not be called the "volume": while there is no reason why a UNIX-like filesystem should be limited to a single block-device, one of the fundamental properties of UNIX-like filesystems is that hard-links are only possible (if at all possible) within a filesystem, and that 'statfs' returns a different "device id" per filesystem. Therefore a Btrfs volume is not properly a filesystem, but potentially a filesystem forest, as it may contain multiple filesystems each with its own root directory. > Is there a simple name for directories I can snapshot? You can only snapshot *root directories*, of which in Btrfs there are two types: subvolumes (an unfortunate name perhaps) or snapshots. In UNIX-like OSes every filesystem has a "root directory" and some filesystem types like Btrfs, NILFS2, and potentially JFS can have more than one, and some can even mount more than one simultaneously. The root directory mounted as '/' is called the "system root directory". When unmounted all filesystem root directories have no names, just an inode number. Conceivably the root inode of a UNIX-like filesystem could be an inode of any type, but I have never seen a recent UNIX-like OS able to mount anything other than a directory-type root inode (Plan 9 is not a UNIX-like OS :->). As someone else observed, the word "root" is overloaded in UNIX-like OS discourse, like the word "filesystem", and that's unfortunate but can always be resolved verbosely by using the appropriate qualifier like "root directory", "system root directory", "'root' user", "uid 0 capabilities", etc. ^ permalink raw reply [flat|nested] 8+ messages in thread
end of thread, other threads:[~2017-09-10 14:21 UTC | newest] Thread overview: 8+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2017-09-09 8:35 generic name for volume and subvolume root? Ulli Horlacher 2017-09-09 10:40 ` Qu Wenruo 2017-09-09 10:48 ` Ulli Horlacher 2017-09-09 10:58 ` Qu Wenruo 2017-09-09 11:06 ` Hugo Mills 2017-09-09 11:13 ` Hans van Kranenburg 2017-09-09 11:00 ` Hugo Mills 2017-09-10 14:21 ` Peter Grandi
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox