btrfs-progs: mkfs.btrfs documentation: clarify current restrictions of sectorsize, nodesize and leafsize
PATCH 1/1 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.
--- man/mkfs.btrfs.8.in | 12 +++++++++--- mkfs.c | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-)
man/mkfs.btrfs.8.in +9 -3
@@ -46,7 +46,8 @@ there is a filesystem or partition table on the device already. .TP \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. +default value is the page size. Must be a multiple of the sectorsize, but +not larger than 65536. Should be equal to the nodesize. .TP \fB\-L\fR, \fB\-\-label \fIname\fR Specify a label for the filesystem.
@@ -66,10 +67,15 @@ 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. +Specify the nodesize. By default the value is set to the pagesize. Must be a +multiple of the sectorsize, but not larger than 65536. Should be equal to the +leafsize. .TP \fB\-s\fR, \fB\-\-sectorsize \fIsize\fR -Specify the sectorsize, the minimum block allocation. +Specify the sectorsize, the minimum block allocation. The default value is +the pagesize. If the sectorsize differs from the pagesize, the created +filesystem cannot be mounted by the current kernel. Therefore it is not +recommended to use this option. .TP \fB\-r\fR, \fB\-\-rootdir \fIrootdir\fR Specify a directory to copy into the newly created fs.
mkfs.c +1 -1
@@ -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 (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 -V --version print the mkfs.btrfs version and exit\n" );
Signature · 1 line
1.7.2.5
Quoted 7 lines · Koen De Wit
Commit
8d082fb727ac11930ea20bf1612e334ea7c2b697(Btrfs: do not mount when we have a sectorsize unequal toPAGE_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.
Please don't forget to add your signed-off-by line.
man/mkfs.btrfs.8.in there is a filesystem or partition table on the device already. · line 50
Quoted 9 lines
man/mkfs.btrfs.8.in +2
-1@@ -46,7 +46,8 @@ there is a filesystem or partition table on the device already. .TP \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. +default value is the page size. Must be a multiple of the sectorsize, but +not larger than 65536. Should be equal to the nodesize.
As implemented now, setting one of leafsize/nodesize will set both, so it's not necessary to specify both. The help text should reflect that.
man/mkfs.btrfs.8.in larger filesystems. It is recommended for use with filesystems · line 78
Quoted 12 lines
man/mkfs.btrfs.8.in +7
-2-Specify the nodesize. By default the value is set to the pagesize. +Specify the nodesize. By default the value is set to the pagesize. Must be a +multiple of the sectorsize, but not larger than 65536. Should be equal to the +leafsize. .TP \fB\-s\fR, \fB\-\-sectorsize \fIsize\fR -Specify the sectorsize, the minimum block allocation. +Specify the sectorsize, the minimum block allocation. The default value is +the pagesize. If the sectorsize differs from the pagesize, the created +filesystem cannot be mounted by the current kernel. Therefore it is not +recommended to use this option.
"... unless you know what you're doing." :)
mkfs.c static void print_usage(void) · line 322
Quoted 8 lines
mkfs.c +1
-1@@ -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 (not mountable by current kernel)\n" );
What if I'm on a ppc64 box? This message will be confusing. I'd stick 'may' into (...)
I'll fix the text wording when committing the patch, no need to resend.
david