summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKoen De Wit <koen.de.wit@oracle.com>2013-07-11 22:56:17 +0200
committerDavid Sterba <dsterba@suse.cz>2013-09-03 19:40:49 +0200
commitb9b1fc4f0dea55ed276819538d1d46e61edf1d86 (patch)
treedb4c7adae87982fe5da89b43e486db48734a821f
parent560f0713139b6a1fbe059d895dd059e6a98ec18b (diff)
btrfs-progs: mkfs.btrfs documentation: clarify current restrictions of sectorsize, nodesize and leafsize
Commit 8d082fb727ac11930ea20bf1612e334ea7c2b697 (Btrfs: do not mount when we have a sectorsize unequal to PAGE_SIZE) requires the sectorsize to be equal to the pagesize for the filesystem to be mountable. The nodesize and leafsize should be equal, and not larger than 65536. Adding this information to the manpage and usage instructions of mkfs.btrfs. Signed-off-by: Koen De Wit <koen.de.wit@oracle.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <chris.mason@fusionio.com>
-rw-r--r--man/mkfs.btrfs.8.in18
-rw-r--r--mkfs.c2
2 files changed, 12 insertions, 8 deletions
diff --git a/man/mkfs.btrfs.8.in b/man/mkfs.btrfs.8.in
index 548e754f..b54e9354 100644
--- a/man/mkfs.btrfs.8.in
+++ b/man/mkfs.btrfs.8.in
@@ -7,11 +7,11 @@ mkfs.btrfs \- create a btrfs filesystem
[ \fB\-b\fP\fI byte-count\fP ]
[ \fB\-d\fP\fI data-profile\fP ]
[ \fB\-f\fP ]
+[ \fB\-n\fP\fI nodesize\fP ]
[ \fB\-l\fP\fI leafsize\fP ]
[ \fB\-L\fP\fI label\fP ]
[ \fB\-m\fP\fI metadata profile\fP ]
[ \fB\-M\fP\fI mixed data+metadata\fP ]
-[ \fB\-n\fP\fI nodesize\fP ]
[ \fB\-s\fP\fI sectorsize\fP ]
[ \fB\-r\fP\fI rootdir\fP ]
[ \fB\-K\fP ]
@@ -45,9 +45,12 @@ 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.
.TP
+\fB\-n\fR, \fB\-\-nodesize \fIsize\fR
\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.
+Specify the nodesize, the tree block size in which btrfs stores data. The
+default value is the page size. Must be a multiple of the sectorsize, but
+not larger than 65536. Leafsize always equals nodesize and the options are
+aliases.
.TP
\fB\-L\fR, \fB\-\-label \fIname\fR
Specify a label for the filesystem.
@@ -66,11 +69,12 @@ utilization. This feature incurs a performance penalty in
larger filesystems. It is recommended for use with filesystems
of 1 GiB or smaller.
.TP
-\fB\-n\fR, \fB\-\-nodesize \fIsize\fR
-Specify the nodesize. By default the value is set to the pagesize.
-.TP
\fB\-s\fR, \fB\-\-sectorsize \fIsize\fR
-Specify the sectorsize, the minimum block allocation.
+Specify the sectorsize, the minimum data block allocation unit. The default
+value is the page size. If the sectorsize differs from the page size, the
+created filesystem may not be mountable by current kernel. Therefore it is not
+recommended to use this option unless you are going to mount it on a system
+with the appropriate page size.
.TP
\fB\-r\fR, \fB\-\-rootdir \fIrootdir\fR
Specify a directory to copy into the newly created fs.
diff --git a/mkfs.c b/mkfs.c
index b4607ae0..5238b897 100644
--- a/mkfs.c
+++ b/mkfs.c
@@ -319,7 +319,7 @@ static void print_usage(void)
fprintf(stderr, "\t -m --metadata metadata profile, values like data profile\n");
fprintf(stderr, "\t -M --mixed mix metadata and data together\n");
fprintf(stderr, "\t -n --nodesize size of btree nodes\n");
- fprintf(stderr, "\t -s --sectorsize min block allocation\n");
+ fprintf(stderr, "\t -s --sectorsize min block allocation (may not mountable by current kernel)\n");
fprintf(stderr, "\t -r --rootdir the source directory\n");
fprintf(stderr, "\t -K --nodiscard do not perform whole device TRIM\n");
fprintf(stderr, "\t -O --features comma separated list of filesystem features\n");