From: "Richard W.M. Jones" <rjones@redhat.com>
To: Dave Chinner <david@fromorbit.com>
Cc: linux-xfs@vger.kernel.org
Subject: Re: mkfs.xfs options suitable for creating absurdly large XFS filesystems?
Date: Wed, 5 Sep 2018 10:05:45 +0100 [thread overview]
Message-ID: <20180905090545.GC27120@redhat.com> (raw)
In-Reply-To: <20180904004940.GR5631@dastard>
On Tue, Sep 04, 2018 at 10:49:40AM +1000, Dave Chinner wrote:
> What's the sector size of you device? This seems to imply that it is
> 1024 bytes, not the normal 512 or 4096 bytes we see in most devices.
It turns out that the sector size is selectable using the nbd-client
-b parameter, which I didn't notice before:
# nbd-client -b 512 localhost /dev/nbd0
This actually turns out to be essential when mounting MBR partitioned
disks because the MBR partition table uses sector numbers, and if you
use the default (1k) sector size then everything is messed up.
Compare with 1k sectors:
# fdisk -l /dev/nbd0
Disk /dev/nbd0: 10 GiB, 10737418240 bytes, 10485760 sectors
Units: sectors of 1 * 1024 = 1024 bytes
Sector size (logical/physical): 1024 bytes / 1024 bytes
I/O size (minimum/optimal): 1024 bytes / 1024 bytes
Disklabel type: dos
Disk identifier: 0x000127ae
Device Boot Start End Sectors Size Id Type
/dev/nbd0p1 2048 20971519 20969472 20G 83 Linux
~~~
to the correct output with 512b sectors:
# fdisk -l /dev/nbd0
Disk /dev/nbd0: 10 GiB, 10737418240 bytes, 20971520 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 1024 bytes / 1024 bytes
Disklabel type: dos
Disk identifier: 0x000127ae
Device Boot Start End Sectors Size Id Type
/dev/nbd0p1 2048 20971519 20969472 10G 83 Linux
So that's a nasty little "gotcha" in the nbd-client tool.
Rich.
--
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-df lists disk usage of guests without needing to install any
software inside the virtual machine. Supports Linux and Windows.
http://people.redhat.com/~rjones/virt-df/
prev parent reply other threads:[~2018-09-05 13:35 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-03 22:49 mkfs.xfs options suitable for creating absurdly large XFS filesystems? Richard W.M. Jones
2018-09-04 0:49 ` Dave Chinner
2018-09-04 8:23 ` Dave Chinner
2018-09-04 9:12 ` Dave Chinner
2018-09-04 8:26 ` Richard W.M. Jones
2018-09-04 9:11 ` Dave Chinner
2018-09-04 9:45 ` Richard W.M. Jones
2018-09-04 15:36 ` Martin Steigerwald
2018-09-04 22:23 ` Dave Chinner
2018-09-05 7:09 ` Martin Steigerwald
2018-09-05 7:43 ` Dave Chinner
2018-09-05 9:05 ` Richard W.M. Jones [this message]
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=20180905090545.GC27120@redhat.com \
--to=rjones@redhat.com \
--cc=david@fromorbit.com \
--cc=linux-xfs@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.