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>
This commit is contained in:
Koen De Wit 2013-07-11 22:56:17 +02:00 committed by David Sterba
parent 560f071313
commit b9b1fc4f0d
2 changed files with 12 additions and 8 deletions

View File

@ -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.

2
mkfs.c
View File

@ -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");