path: root/man
diff options
authorEric Sandeen <>2013-02-14 12:30:03 -0600
committerDavid Sterba <>2013-02-19 11:15:31 +0100
commit2a2d8e1962e8b6cda7b0a7584f6d2fb95d442cb6 (patch)
treebaf0bcadc48c146e25717f1506ab46edbb8194ad /man
parent3b85739dd6c63c8f94f87d6574494919d2c1119f (diff)
btrfs-progs: require mkfs -f force option to overwrite filesystem or partition table
The core of this is shamelessly stolen from xfsprogs. Use blkid to detect an existing filesystem or partition table on any of the target devices. If something is found, require the '-f' option to overwrite it, hopefully avoiding disaster due to mistyped devicenames, etc. # mkfs.btrfs /dev/sda1 WARNING! - Btrfs v0.20-rc1-59-gd00279c-dirty IS EXPERIMENTAL WARNING! - see before using /dev/sda1 appears to contain an existing filesystem (xfs). Use the -f option to force overwrite. # This does introduce a requirement on libblkid. Signed-off-by: Eric Sandeen <>
Diffstat (limited to 'man')
1 files changed, 6 insertions, 0 deletions
diff --git a/man/ b/man/
index 45386587..41163e03 100644
--- a/man/
+++ b/man/
@@ -6,6 +6,7 @@ mkfs.btrfs \- create a btrfs filesystem
[ \fB\-A\fP\fI alloc-start\fP ]
[ \fB\-b\fP\fI byte-count\fP ]
[ \fB\-d\fP\fI data-profile\fP ]
+[ \fB\-f\fP\fI ]
[ \fB\-l\fP\fI leafsize\fP ]
[ \fB\-L\fP\fI label\fP ]
[ \fB\-m\fP\fI metadata profile\fP ]
@@ -38,6 +39,11 @@ mkfs.btrfs uses all the available storage for the filesystem.
Specify how the data must be spanned across the devices specified. Valid
values are raid0, raid1, raid10 or single.
+Force overwrite when an existing filesystem is detected on the device.
+By default, mkfs.btrfs will not write to the device if it suspects that
+there is a filesystem or partition table on the device already.
\fB\-l\fR, \fB\-\-leafsize \fIsize\fR
Specify the leaf size, the least data item in which btrfs stores data. The
default value is the page size.