Skip to content

Commit 07f039a

Browse files
committed
btrfs-progs: docs: add example for nested subvolumes
Make it more visible what the result of snapshotted subvolume is. This partially duplicates the other section. [ci skip] Issue: #644 Signed-off-by: David Sterba <dsterba@suse.com>
1 parent 68c1027 commit 07f039a

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

Documentation/ch-subvolume-intro.rst

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,32 @@ descendants of the toplevel one), or nested.
8686

8787
What should be mentioned early is that a snapshotting is not recursive, so a
8888
subvolume or a snapshot is effectively a barrier and no files in the nested
89-
appear in the snapshot. Instead there's a stub subvolume (also sometimes
89+
appear in the snapshot. Instead there's a stub subvolume (also sometimes called
9090
*empty subvolume* with the same name as original subvolume, with inode number
9191
2). This can be used intentionally but could be confusing in case of nested
9292
layouts.
9393

94+
.. code-block:: bash
95+
96+
$ btrfs subvolume create subvol1
97+
$ btrfs subvolume create subvol1/subvol2
98+
$ btrfs subvolume snapshot subvol1 snap1
99+
$ find -ls
100+
121093 0 drwxr-xr-x 1 user users 24 Jul 30 12:34 .
101+
256 0 drwxr-xr-x 1 user users 14 Jul 30 12:34 ./subvol1
102+
256 0 drwxr-xr-x 1 user users 0 Jul 30 12:34 ./subvol1/subvol2
103+
257 0 -rw-r--r-- 1 user users 0 Jul 30 12:34 ./subvol1/subvol2/file
104+
256 0 drwxr-xr-x 1 user users 14 Jul 30 12:34 ./snap1
105+
2 0 drwxr-xr-x 1 user users 0 Jul 30 12:34 ./snap1/subvol2
106+
107+
The numbers in the first colums are inode numbers, 256 is for a regular
108+
subvolume (or snapshot), 2 is the *empty subvolume*. The snapshotted directory
109+
representing *subvol2* does not contain the *file*.
110+
111+
.. note::
112+
The *empty subvolume* will not be sent (:doc:`btrfs-send`) and thus will not be created on
113+
the receive side (:doc:`btrfs-receive`).
114+
94115
Case study: system root layouts
95116
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
96117

0 commit comments

Comments
 (0)