path: root/man
diff options
authorDavid Sterba <>2013-12-12 19:11:26 +0100
committerChris Mason <>2014-01-31 08:22:20 -0800
commit4b7656f3bf4bb204d567375eb6d43317521543fc (patch)
treeb4e895ab26929e0782d686d2593516ca3ef56730 /man
parent91bc44bd073020c27487b22ccf53a37d593d331e (diff)
btrfs-progs: add options to set commit mode after subvol delete
Subvolume deletion does not do a full transaction commit. This can lead to an unexpected result when the system crashes between deletion and commit, the subvolume directory will appear again. Add options to request filesystem sync after each deleted subvolume or after the last one. If the command with --commit option finishes succesfully, the subvolume(s) deletion status is safely stored on the media. Userspace approach is more flexible than in-kernel. Related discussions: CC: Alex Lyakas <> Signed-off-by: David Sterba <> Signed-off-by: Chris Mason <>
Diffstat (limited to 'man')
1 files changed, 19 insertions, 4 deletions
diff --git a/man/ b/man/
index d5515e0a..389de3d7 100644
--- a/man/
+++ b/man/
@@ -8,7 +8,7 @@ btrfs \- control a btrfs filesystem
\fBbtrfs\fP \fBsubvolume create\fP [-i \fI<qgroupid>\fP] [\fI<dest>\fP/]\fI<name>\fP
-\fBbtrfs\fP \fBsubvolume delete\fP \fI<subvolume>\fP [\fI<subvolume>...\fP]
+\fBbtrfs\fP \fBsubvolume delete\fP [\fIoptions\fP] \fI<subvolume>\fP [\fI<subvolume>...\fP]
\fBbtrfs\fP \fBsubvolume list\fP [\fIoptions\fP] [-G [+|-]\fIvalue\fP] [-C [+|-]\fIvalue\fP] [--sort=rootid,gen,ogen,path] \fI<path>\fP
@@ -168,9 +168,24 @@ times.
-\fBsubvolume delete\fR\fI <subvolume> \fP[\fI<subvolume>...\fP]\fR
-Delete the subvolume \fI<subvolume>\fR. If \fI<subvolume>\fR is not a
-subvolume, \fBbtrfs\fR returns an error.
+\fBsubvolume delete\fR [\fIoptions\fP] \fI<subvolume>\fP [\fI<subvolume>...\fP]\fR
+Delete the subvolume(s) from the filesystem. If \fI<subvolume>\fR is not a
+subvolume, \fBbtrfs\fR returns an error but continues if there are more arguments
+to process.
+The corresponding directory is removed instantly but the data blocks are
+removed later. The deletion does not involve full commit by default due to
+performance reasons (as a consequence, the subvolume may appear again after a
+crash). Use one of the --commit options to wait until the operation is safely
+stored on the media.
+.IP "\fB-c|--commit-after\fP" 5
+wait for transaction commit at the end of the operation
+.IP "\fB-C|--commit-each\fP" 5
+wait for transaction commit after deleting each subvolume
\fBsubvolume list\fR [\fIoptions\fP] [-G [+|-]\fIvalue\fP] [-C [+|-]\fIvalue\fP] [--sort=rootid,gen,ogen,path] \fI<path>\fR