Debian Codegraph @

upstream/debian-trixie/man8/btrfs-subvolume.8

raw
1 .\" Man page generated from reStructuredText.
2 .
3 .
4 .nr rst2man-indent-level 0
5 .
6 .de1 rstReportMargin
7 \\$1 \\n[an-margin]
8 level \\n[rst2man-indent-level]
9 level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
10 -
11 \\n[rst2man-indent0]
12 \\n[rst2man-indent1]
13 \\n[rst2man-indent2]
14 ..
15 .de1 INDENT
16 .\" .rstReportMargin pre:
17 . RS \\$1
18 . nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
19 . nr rst2man-indent-level +1
20 .\" .rstReportMargin post:
21 ..
22 .de UNINDENT
23 . RE
24 .\" indent \\n[an-margin]
25 .\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
26 .nr rst2man-indent-level -1
27 .\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
28 .in \\n[rst2man-indent\\n[rst2man-indent-level]]u
29 ..
30 .TH "BTRFS-SUBVOLUME" "8" "May 18, 2026" "7.0" "BTRFS"
31 .SH NAME
32 btrfs-subvolume \- manage btrfs subvolumes
33 .SH SYNOPSIS
34 .sp
35 \fBbtrfs subvolume\fP <subcommand> [<args>]
36 .SH DESCRIPTION
37 .sp
38 \fBbtrfs subvolume\fP is used to create/delete/list/show btrfs subvolumes and
39 snapshots.
40 .sp
41 A BTRFS subvolume is a part of filesystem with its own independent
42 file/directory hierarchy and inode number namespace. Subvolumes can share file
43 extents. A snapshot is also subvolume, but with a given initial content of the
44 original subvolume. A subvolume has always inode number 256 (see more in
45 \fI\%Inode numbers (in Subvolumes)\fP).
46 .sp
47 \fBNOTE:\fP
48 .INDENT 0.0
49 .INDENT 3.5
50 A subvolume in BTRFS is not like an LVM logical volume, which is block\-level
51 snapshot while BTRFS subvolumes are file extent\-based.
52 .UNINDENT
53 .UNINDENT
54 .sp
55 A subvolume looks like a normal directory, with some additional operations
56 described below. Subvolumes can be renamed or moved, nesting subvolumes is not
57 restricted but has some implications regarding snapshotting. The numeric id
58 (called \fIsubvolid\fP or \fIrootid\fP) of the subvolume is persistent and cannot be
59 changed.
60 .sp
61 A subvolume in BTRFS can be accessed in two ways:
62 .INDENT 0.0
63 .IP \(bu 2
64 like any other directory that is accessible to the user
65 .IP \(bu 2
66 like a separately mounted filesystem (options \fIsubvol\fP or \fIsubvolid\fP)
67 .UNINDENT
68 .sp
69 In the latter case the parent directory is not visible and accessible. This is
70 similar to a bind mount, and in fact the subvolume mount does exactly that.
71 .sp
72 A freshly created filesystem is also a subvolume, called \fItop\-level\fP,
73 internally has an id 5. This subvolume cannot be removed or replaced by another
74 subvolume. This is also the subvolume that will be mounted by default, unless
75 the default subvolume has been changed (see \fI\%btrfs subvolume set\-default\fP).
76 .sp
77 A snapshot is a subvolume like any other, with given initial content. By
78 default, snapshots are created read\-write. File modifications in a snapshot
79 do not affect the files in the original subvolume.
80 .sp
81 Subvolumes can be given capacity limits, through the qgroups/quota facility, but
82 otherwise share the single storage pool of the whole btrfs filesystem. They may
83 even share data between themselves (through deduplication or snapshotting).
84 .sp
85 \fBNOTE:\fP
86 .INDENT 0.0
87 .INDENT 3.5
88 A snapshot is not a backup: snapshots work by use of BTRFS\(aq copy\-on\-write
89 behaviour. A snapshot and the original it was taken from initially share all
90 of the same data blocks. If that data is damaged in some way (cosmic rays,
91 bad disk sector, accident with dd to the disk), then the snapshot and the
92 original will both be damaged. Snapshots are useful to have local online
93 \(dqcopies\(dq of the filesystem that can be referred back to, or to implement a
94 form of deduplication, or to fix the state of a filesystem for making a full
95 backup without anything changing underneath it. They do not in themselves
96 make your data any safer.
97 .UNINDENT
98 .UNINDENT
99 .SH SUBVOLUME FLAGS
100 .sp
101 The subvolume flag currently implemented is the \fIro\fP property (read\-only
102 status). Read\-write subvolumes have that set to \fIfalse\fP, snapshots as \fItrue\fP\&.
103 In addition to that, a plain snapshot will also have last change generation and
104 creation generation equal.
105 .sp
106 Read\-only snapshots are building blocks of incremental send (see
107 \fI\%btrfs\-send(8)\fP) and the whole use case relies on unmodified snapshots where
108 the relative changes are generated from. Thus, changing the subvolume flags
109 from read\-only to read\-write will break the assumptions and may lead to
110 unexpected changes in the resulting incremental stream.
111 .sp
112 A snapshot that was created by send/receive will be read\-only, with different
113 last change generation, and with set \fIreceived_uuid\fP which identifies
114 the subvolume on the filesystem that produced the stream. The use case relies
115 on matching data on both sides. Changing the subvolume to read\-write after it
116 has been received requires to reset the \fIreceived_uuid\fP\&. As this is a notable
117 change and could potentially break the incremental send use case, performing
118 it by \fI\%btrfs property set\fP requires force if that is
119 really desired by user.
120 .sp
121 \fBNOTE:\fP
122 .INDENT 0.0
123 .INDENT 3.5
124 The safety checks have been implemented in 5.14.2, any subvolumes previously
125 received (with a valid \fIreceived_uuid\fP) and read\-write status may exist and
126 could still lead to problems with send/receive. You can use \fI\%btrfs subvolume show\fP
127 to identify them. Flipping the flags to read\-only and back to
128 read\-write will reset the \fIreceived_uuid\fP manually. There may exist a
129 convenience tool in the future.
130 .UNINDENT
131 .UNINDENT
132 .SH NESTED SUBVOLUMES
133 .sp
134 There are no restrictions for subvolume creation, so it\(aqs up to the user how to
135 organize them, whether to have a flat layout (all subvolumes are direct
136 descendants of the toplevel one), or nested.
137 .sp
138 What should be mentioned early is that a snapshotting is not recursive, so a
139 subvolume or a snapshot is effectively a barrier and no files in the nested subvolumes
140 appear in the snapshot. Instead, there\(aqs a stub subvolume, also sometimes called
141 \fIempty subvolume\fP, with the same name as original subvolume and with inode number 2.
142 This can be used intentionally but could be confusing in case of nested layouts.
143 .INDENT 0.0
144 .INDENT 3.5
145 .sp
146 .EX
147 $ btrfs subvolume create subvol1
148 $ btrfs subvolume create subvol1/subvol2
149 $ btrfs subvolume snapshot subvol1 snap1
150 $ find \-ls
151 121093 0 drwxr\-xr\-x 1 user users 24 Jul 30 12:34 .
152 256 0 drwxr\-xr\-x 1 user users 14 Jul 30 12:34 ./subvol1
153 256 0 drwxr\-xr\-x 1 user users 0 Jul 30 12:34 ./subvol1/subvol2
154 257 0 \-rw\-r\-\-r\-\- 1 user users 0 Jul 30 12:34 ./subvol1/subvol2/file
155 256 0 drwxr\-xr\-x 1 user users 14 Jul 30 12:34 ./snap1
156 2 0 drwxr\-xr\-x 1 user users 0 Jul 30 12:34 ./snap1/subvol2
157 .EE
158 .UNINDENT
159 .UNINDENT
160 .sp
161 The numbers in the first columns are inode numbers, 256 is for a regular
162 subvolume (or snapshot), 2 is the \fIempty subvolume\fP\&. The snapshotted directory
163 representing \fIsubvol2\fP does not contain the \fIfile\fP\&.
164 .sp
165 \fBNOTE:\fP
166 .INDENT 0.0
167 .INDENT 3.5
168 The \fIempty subvolume\fP will not be sent (\fI\%btrfs\-send(8)\fP) and thus will not be created on
169 the receive side (\fI\%btrfs\-receive(8)\fP).
170 .UNINDENT
171 .UNINDENT
172 .SS Case study: system root layouts
173 .sp
174 There are two ways how the system root directory and subvolume layout could be
175 organized. The interesting use case for root is to allow rollbacks to previous
176 version, as one atomic step. If the entire filesystem hierarchy starting in \fB/\fP
177 is in one subvolume, taking snapshot will encompass all files. This is easy for
178 the snapshotting part but has undesirable consequences for rollback. For example,
179 log files would get rolled back too, or any data that are stored on the root
180 filesystem but are not meant to be rolled back either (database files, VM
181 images, ...).
182 .sp
183 Here we could utilize the snapshotting barrier mentioned above, making each directory
184 that stores data to be preserved across rollbacks its own subvolume. This
185 could be e.g. \fB/var\fP\&. Further more fine\-grained partitioning could be done, e.g.
186 adding separate subvolumes for \fB/var/log\fP, \fB/var/cache\fP etc.
187 .sp
188 The fact that there are separate subvolumes requires separate actions to take the
189 snapshots (here, it gets disconnected from the system root snapshots). This needs
190 to be taken care of by system tools, installers, together with selection of which
191 directories are highly recommended to be separate subvolumes.
192 .SH MOUNT OPTIONS
193 .sp
194 Mount options are of two kinds, generic (that are handled by VFS layer) and
195 specific, handled by the filesystem. The following list shows which are
196 applicable to individual subvolume mounts, while there are more options that
197 always affect the whole filesystem:
198 .INDENT 0.0
199 .IP \(bu 2
200 Generic: noatime/relatime/..., nodev, nosuid, ro, rw, dirsync
201 .IP \(bu 2
202 Filesystem\-specific: compress, autodefrag, nodatacow, nodatasum
203 .UNINDENT
204 .sp
205 Examples of whole filesystem options are e.g. \fIspace_cache\fP, \fIrescue\fP, \fIdevice\fP,
206 \fIskip_balance\fP, etc. The exceptional options are \fIsubvol\fP and \fIsubvolid\fP that
207 are actually used for mounting a given subvolume and can be specified only once
208 for the mount.
209 .sp
210 Subvolumes belong to a single filesystem and, as implemented now, all share the
211 same specific mount options. Also, changes done by remount have immediate effect. This
212 may change in the future.
213 .sp
214 Mounting a read\-write snapshot as read\-only is possible and will not change the
215 \fIro\fP property and flag of the subvolume.
216 .sp
217 The name of the mounted subvolume is stored in file \fB/proc/self/mountinfo\fP in
218 the 4th column:
219 .INDENT 0.0
220 .INDENT 3.5
221 .sp
222 .EX
223 27 21 0:19 /subv1 /mnt rw,relatime \- btrfs /dev/sda rw,space_cache
224 ^^^^^^
225 .EE
226 .UNINDENT
227 .UNINDENT
228 .SH INODE NUMBERS
229 .sp
230 A directory representing a subvolume has always inode number 256 (sometimes
231 also called a root of the subvolume):
232 .INDENT 0.0
233 .INDENT 3.5
234 .sp
235 .EX
236 $ ls \-lis
237 total 0
238 389111 0 drwxr\-xr\-x 1 user users 0 Jan 20 12:13 dir
239 389110 0 \-rw\-r\-\-r\-\- 1 user users 0 Jan 20 12:13 file
240 256 0 drwxr\-xr\-x 1 user users 0 Jan 20 12:13 snap1
241 256 0 drwxr\-xr\-x 1 user users 0 Jan 20 12:13 subv1
242 .EE
243 .UNINDENT
244 .UNINDENT
245 .sp
246 If a subvolume is nested and then a snapshot is taken, then the cloned
247 directory entry representing the subvolume becomes empty and the inode has
248 number 2. All other files and directories in the target snapshot preserve their
249 original inode numbers.
250 .sp
251 \fBNOTE:\fP
252 .INDENT 0.0
253 .INDENT 3.5
254 Inode number is not a filesystem\-wide unique identifier, some applications
255 assume that. Please use the \fIsubvolumeid:inodenumber\fP pair for that purpose.
256 The subvolume id can be read by \fI\%btrfs inspect\-internal rootid\fP
257 or by the ioctl \fI\%BTRFS_IOC_INO_LOOKUP\fP\&.
258 .UNINDENT
259 .UNINDENT
260 .SH PERFORMANCE
261 .sp
262 Subvolume creation needs to flush dirty data that belong to the subvolume and this
263 step may take some time. Otherwise, once there\(aqs nothing else to do, the snapshot
264 is instantaneous and only creates a new tree root copy in the metadata.
265 .sp
266 Snapshot deletion has two phases: first its directory is deleted and the
267 subvolume is added to a queuing list, then the list is processed one by one and the
268 data related to the subvolume get deleted. This is usually called \fIcleaning\fP and
269 can take some time depending on the amount of shared blocks (can be a lot of
270 metadata updates), and the number of currently queued deleted subvolumes.
271 .SH SUBVOLUME AND SNAPSHOT
272 .sp
273 A subvolume is a part of filesystem with its own independent
274 file/directory hierarchy. Subvolumes can share file extents. A snapshot is
275 also subvolume, but with a given initial content of the original subvolume.
276 .sp
277 \fBNOTE:\fP
278 .INDENT 0.0
279 .INDENT 3.5
280 A subvolume in btrfs is not like an LVM logical volume, which is block\-level
281 snapshot while btrfs subvolumes are file extent\-based.
282 .UNINDENT
283 .UNINDENT
284 .sp
285 A subvolume looks like a normal directory, with some additional operations
286 described below. Subvolumes can be renamed or moved, nesting subvolumes is not
287 restricted but has some implications regarding snapshotting.
288 .sp
289 A subvolume in btrfs can be accessed in two ways:
290 .INDENT 0.0
291 .IP \(bu 2
292 like any other directory that is accessible to the user
293 .IP \(bu 2
294 like a separately mounted filesystem (options \fIsubvol\fP or \fIsubvolid\fP)
295 .UNINDENT
296 .sp
297 In the latter case the parent directory is not visible and accessible. This is
298 similar to a bind mount, and in fact the subvolume mount does exactly that.
299 .sp
300 A freshly created filesystem is also a subvolume, called \fItop\-level\fP,
301 internally has an id 5. This subvolume cannot be removed or replaced by another
302 subvolume. This is also the subvolume that will be mounted by default, unless
303 the default subvolume has been changed (see subcommand \fI\%set\-default\fP).
304 .sp
305 A snapshot is a subvolume like any other, with given initial content. By
306 default, snapshots are created read\-write. File modifications in a snapshot
307 do not affect the files in the original subvolume.
308 .SH SUBCOMMAND
309 .INDENT 0.0
310 .TP
311 .B create [options] [<dest>/]<name> [[<dest2>/]<name2> ...]
312 Create subvolume(s) at the destination(s).
313 .sp
314 If \fIdest\fP part of the path is not given, subvolume \fIname\fP will be
315 created in the current directory.
316 .sp
317 If multiple destinations are given, then the given options are applied to all
318 subvolumes.
319 .sp
320 If failure happens for any of the destinations, the command would
321 still retry the remaining destinations, but would return 1 to indicate
322 the failure (similar to what \fBmkdir\fP would do.
323 .sp
324 \fBOptions\fP
325 .INDENT 7.0
326 .TP
327 .BI \-i \ <qgroupid>
328 Add the newly created subvolume to a qgroup. This option can be given multiple
329 times.
330 .UNINDENT
331 .INDENT 7.0
332 .TP
333 .B \-p|\-\-parents
334 Create any missing parent directories for each argument (like \fBmkdir \-p\fP).
335 .UNINDENT
336 .TP
337 .B delete [options] [<subvolume> [<subvolume>...]], delete \-i|\-\-subvolid <subvolid> <path>
338 Delete the subvolume(s) from the filesystem.
339 .sp
340 If \fIsubvolume\fP is not a subvolume, the command returns an error but
341 continues if there are more arguments to process.
342 .sp
343 If \fI\-\-subvolid\fP is used, \fIpath\fP must point to a btrfs filesystem. See
344 \fI\%btrfs subvolume list\fP or
345 \fI\%btrfs inspect\-internal rootid\fP
346 how to get the subvolume id.
347 .sp
348 The corresponding directory is removed instantly but the data blocks are
349 removed later in the background. The command returns immediately. See
350 \fI\%btrfs subvolume sync\fP how to wait until the subvolume gets completely removed.
351 .sp
352 The deletion does not involve a full transaction commit by default due to
353 performance reasons. As a consequence, the subvolume may appear again after a
354 crash. Use one of the \fI\-\-commit\fP options to wait until the operation is
355 safely stored on the device before the command returns.
356 .sp
357 Deleting subvolume needs sufficient permissions, by default the owner
358 cannot delete it unless it\(aqs enabled by a mount option
359 \fIuser_subvol_rm_allowed\fP, or deletion is run as root.
360 The default subvolume (see \fI\%btrfs subvolume set\-default\fP)
361 cannot be deleted and
362 returns error (EPERM) and this is logged to the system log. A subvolume that\(aqs
363 currently involved in send (see \fI\%btrfs\-send(8)\fP)
364 also cannot be deleted until the
365 send is finished. This is also logged in the system log.
366 .sp
367 \fBOptions\fP
368 .INDENT 7.0
369 .TP
370 .B \-c|\-\-commit\-after
371 wait for transaction commit at the end of the operation.
372 .TP
373 .B \-C|\-\-commit\-each
374 wait for transaction commit after deleting each subvolume.
375 .TP
376 .B \-i|\-\-subvolid <subvolid>
377 subvolume id to be removed instead of the <path> that should point to the
378 filesystem with the subvolume
379 .TP
380 .B \-R|\-\-recursive
381 delete subvolumes beneath each subvolume recursively
382 .sp
383 This requires either \fICAP_SYS_ADMIN\fP or the filesystem must be
384 mounted with \fIuser_subvol_rm_allowed\fP mount option.
385 In the unprivileged case, subvolumes which cannot be accessed
386 are skipped. The deletion is not atomic.
387 .TP
388 .B \-v|\-\-verbose
389 (deprecated) alias for global \fI\-v\fP option
390 .UNINDENT
391 .TP
392 .B find\-new <subvolume> <last_gen>
393 List the recently modified files in a subvolume, after \fIlast_gen\fP generation.
394 .TP
395 .B get\-default <path>
396 Get the default subvolume of the filesystem \fIpath\fP\&.
397 .sp
398 The output format is similar to \fBsubvolume list\fP command.
399 .UNINDENT
400 .INDENT 0.0
401 .TP
402 .B list [options] [\-G [+|\-]<value>] [\-C [+|\-]<value>] [\-\-sort=rootid,gen,ogen,path] <path>
403 List the subvolumes present in the filesystem \fIpath\fP\&.
404 .sp
405 For every subvolume the following information is shown by default:
406 .sp
407 ID \fIID\fP gen \fIgeneration\fP top level \fIparent_ID\fP path \fIpath\fP
408 .sp
409 where \fIID\fP is subvolume\(aqs (root)id, \fIgeneration\fP is an internal counter which is
410 updated every transaction, \fIparent_ID\fP is the same as the parent subvolume\(aqs id,
411 and \fIpath\fP is the relative path of the subvolume to the top level subvolume.
412 The subvolume\(aqs ID may be used by the subvolume set\-default command,
413 or at mount time via the \fIsubvolid=\fP option.
414 .sp
415 \fBOptions\fP
416 .sp
417 Path filtering:
418 .INDENT 7.0
419 .TP
420 .B \-o
421 Print only subvolumes below specified <path>. Note that this is not a
422 recursive command, and won\(aqt show nested subvolumes under <path>.
423 .TP
424 .B \-a
425 print all the subvolumes in the filesystem and distinguish between
426 absolute and relative path with respect to the given \fIpath\fP\&.
427 .UNINDENT
428 .sp
429 Field selection:
430 .INDENT 7.0
431 .TP
432 .B \-p
433 print the parent ID
434 (\fIparent\fP here means the subvolume which contains this subvolume).
435 .TP
436 .B \-c
437 print the ogeneration of the subvolume, aliases: ogen or origin generation.
438 .TP
439 .B \-g
440 print the generation of the subvolume (default).
441 .TP
442 .B \-u
443 print the UUID of the subvolume.
444 .TP
445 .B \-q
446 print the parent UUID of the subvolume
447 (\fIparent\fP here means subvolume of which this subvolume is a snapshot).
448 .TP
449 .B \-R
450 print the UUID of the sent subvolume, where the subvolume is the result of a receive operation.
451 .UNINDENT
452 .sp
453 Type filtering:
454 .INDENT 7.0
455 .TP
456 .B \-s
457 only snapshot subvolumes in the filesystem will be listed.
458 .TP
459 .B \-r
460 only readonly subvolumes in the filesystem will be listed.
461 .TP
462 .B \-d
463 list deleted subvolumes that are not yet cleaned.
464 .UNINDENT
465 .sp
466 Other:
467 .INDENT 7.0
468 .TP
469 .B \-t
470 print the result as a table.
471 .UNINDENT
472 .sp
473 Sorting:
474 .sp
475 By default the subvolumes will be sorted by subvolume ID ascending.
476 .INDENT 7.0
477 .TP
478 .B \-G [+|\-]<value>
479 list subvolumes in the filesystem that its generation is
480 >=, <= or = value. \(aq+\(aq means >= value, \(aq\-\(aq means <= value, If there is
481 neither \(aq+\(aq nor \(aq\-\(aq, it means = value.
482 .TP
483 .B \-C [+|\-]<value>
484 list subvolumes in the filesystem that its ogeneration is
485 >=, <= or = value. The usage is the same to \fI\-G\fP option.
486 .TP
487 .B \-\-sort=rootid,gen,ogen,path
488 list subvolumes in order by specified items.
489 you can add \fI+\fP or \fI\-\fP in front of each items, \fI+\fP means ascending,
490 \fI\-\fP means descending. The default is ascending.
491 .sp
492 for \fI\-\-sort\fP you can combine some items together by \fI,\fP, just like
493 \fI\-\-sort=+ogen,\-gen,path,rootid\fP\&.
494 .UNINDENT
495 .UNINDENT
496 .INDENT 0.0
497 .TP
498 .B set\-default [<subvolume>|<id> <path>]
499 Set the default subvolume for the (mounted) filesystem.
500 .sp
501 Set the default subvolume for the (mounted) filesystem at \fIpath\fP\&. This will hide
502 the top\-level subvolume (i.e. the one mounted with \fIsubvol=/\fP or \fIsubvolid=5\fP).
503 Takes action on next mount.
504 .sp
505 There are two ways how to specify the subvolume, by \fIid\fP or by the \fIsubvolume\fP
506 path.
507 The id can be obtained from \fI\%btrfs subvolume list\fP
508 \fI\%btrfs subvolume show\fP or
509 \fI\%btrfs inspect\-internal rootid\fP\&.
510 .UNINDENT
511 .INDENT 0.0
512 .TP
513 .B show [options] <path>
514 Show more information about a subvolume (UUIDs, generations, times, flags,
515 related snapshots).
516 .INDENT 7.0
517 .INDENT 3.5
518 .sp
519 .EX
520 /mnt/btrfs/subvolume
521 Name: subvolume
522 UUID: 5e076a14\-4e42\-254d\-ac8e\-55bebea982d1
523 Parent UUID: \-
524 Received UUID: \-
525 Creation time: 2018\-01\-01 12:34:56 +0000
526 Subvolume ID: 79
527 Generation: 2844
528 Gen at creation: 2844
529 Parent ID: 5
530 Top level ID: 5
531 Flags: \-
532 Snapshot(s):
533 .EE
534 .UNINDENT
535 .UNINDENT
536 .sp
537 \fBOptions\fP
538 .INDENT 7.0
539 .TP
540 .B \-r|\-\-rootid <ID>
541 show details about subvolume with root \fIID\fP, looked up in \fIpath\fP
542 .TP
543 .B \-u|\-\-uuid UUID
544 show details about subvolume with the given \fIUUID\fP, looked up in \fIpath\fP
545 .UNINDENT
546 .TP
547 .B snapshot [\-r] [\-i <qgroupid>] <source> <dest>|[<dest>/]<name>
548 Create a snapshot of the subvolume \fIsource\fP with the
549 name \fIname\fP in the \fIdest\fP directory.
550 .sp
551 If only \fIdest\fP is given, the subvolume will be named the basename of \fIsource\fP\&.
552 If \fIsource\fP is not a subvolume, btrfs returns an error.
553 .sp
554 \fBOptions\fP
555 .INDENT 7.0
556 .TP
557 .B \-r
558 Make the new snapshot read only.
559 .TP
560 .BI \-i \ <qgroupid>
561 Add the newly created subvolume to a qgroup. This option can be given multiple
562 times.
563 .UNINDENT
564 .UNINDENT
565 .INDENT 0.0
566 .TP
567 .B sync <path> [subvolid...]
568 Wait until given subvolume(s) are completely removed from the filesystem after
569 deletion. If no subvolume id is given, wait until all current deletion requests
570 are completed, but do not wait for subvolumes deleted in the meantime.
571 .sp
572 If the filesystem status changes to read\-only then the waiting is interrupted.
573 .sp
574 \fBOptions\fP
575 .INDENT 7.0
576 .TP
577 .BI \-s \ <N>
578 sleep N seconds between checks (default: 1)
579 .UNINDENT
580 .UNINDENT
581 .SH EXAMPLES
582 .SS Deleting a subvolume
583 .sp
584 If we want to delete a subvolume called \fIfoo\fP from a btrfs volume mounted at
585 \fB/mnt/bar\fP we could run the following:
586 .INDENT 0.0
587 .INDENT 3.5
588 .sp
589 .EX
590 btrfs subvolume delete /mnt/bar/foo
591 .EE
592 .UNINDENT
593 .UNINDENT
594 .SH EXIT STATUS
595 .sp
596 \fBbtrfs subvolume\fP returns a zero exit status if it succeeds. A non\-zero value is
597 returned in case of failure.
598 .SH AVAILABILITY
599 .sp
600 \fBbtrfs\fP is part of btrfs\-progs. Please refer to the documentation at
601 \X'tty: link https://btrfs.readthedocs.io'\fI\%https://btrfs.readthedocs.io\fP\X'tty: link'\&.
602 .SH SEE ALSO
603 .sp
604 \fI\%btrfs\-qgroup(8)\fP,
605 \fI\%btrfs\-quota(8)\fP,
606 \fI\%btrfs\-send(8)\fP,
607 \fI\%mkfs.btrfs(8)\fP,
608 \X'tty: link https://man7.org/linux/man-pages/man8/mount.8.html'\fI\%mount(8)\fP\X'tty: link'
609 .\" Generated by docutils manpage writer.
610 .