linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Koen De Wit <koen.de.wit@oracle.com>
To: linux-btrfs@vger.kernel.org
Cc: Koen De Wit <koen.de.wit@oracle.com>
Subject: [PATCH] btrfs-progs: mkfs.btrfs documentation: clarify current restrictions of sectorsize, nodesize and leafsize
Date: Thu, 11 Jul 2013 22:56:17 +0200	[thread overview]
Message-ID: <1373576177-9272-1-git-send-email-koen.de.wit@oracle.com> (raw)

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(-)

diff --git a/man/mkfs.btrfs.8.in b/man/mkfs.btrfs.8.in
index a3f1503..b2a4e73 100644
--- a/man/mkfs.btrfs.8.in
+++ b/man/mkfs.btrfs.8.in
@@ -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.
diff --git a/mkfs.c b/mkfs.c
index b412b7e..9f75c58 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 (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");
-- 
1.7.2.5


             reply	other threads:[~2013-07-11 20:58 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-11 20:56 Koen De Wit [this message]
2013-08-06  0:21 ` [PATCH] btrfs-progs: mkfs.btrfs documentation: clarify current restrictions of sectorsize, nodesize and leafsize David Sterba

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1373576177-9272-1-git-send-email-koen.de.wit@oracle.com \
    --to=koen.de.wit@oracle.com \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).