From: Dave Chinner <david@fromorbit.com>
To: Theodore Ts'o <tytso@mit.edu>
Cc: Ashish Sangwan <ashishsangwan2@gmail.com>,
adilger@dilger.ca, sandeen@redhat.com,
Namjae Jeon <linkinjeon@gmail.com>,
linux-ext4@vger.kernel.org
Subject: Re: How to use new "native 4k sector sized" HDD with ext4
Date: Wed, 31 Oct 2012 11:43:04 +1100 [thread overview]
Message-ID: <20121031004304.GJ29378@dastard> (raw)
In-Reply-To: <20121030142245.GB5972@thunk.org>
On Tue, Oct 30, 2012 at 10:22:45AM -0400, Theodore Ts'o wrote:
> On Tue, Oct 30, 2012 at 06:27:52PM +0530, Ashish Sangwan wrote:
> >
> > In mkfs.xfs there is option "-s", using which, one can set the sector size.
> > What is the use case of this option?
> >
> > Also, such option is not present for ext4. So, apart from aligining the
> > partition on multiple of 8 sector numbers do we have to do something else
> > for using 4k sectors?
>
> The equivalent option for ext4 is -b (which we call the block size).
...
> > Is there any way to make sure that ext4 is indeed using 4k sectors?
>
> You can use dumpe2fs to look at the file system parameters. The
> confusion here is caused by the fact that xfs uses sector size where
> ext 2/3/4 follows the BSD Fast File System convention of using the
> terminology of "block size".
That's not really correct. XFS also uses the uses filesystem blocks
just like ext2/3/4 for almost everything, data and metadata.
However, the XFS journal format has requirements for detecting torn
writes in journal recovery and hence needs to know the sector size
of the log device (i.e. the minimum guaranteed atomic IO size). The
key metadata in each AG (the AG headers) are also sector sized so
that they don't get corrupted by torn writes, either, so XFS also
needs to know the sector size of the data device if is using.
> XFS supports using the minimum sector size of 512 bytes by default
> since it means that if you are store large number of small files
> (i.e., only one or two 512 byte sectors), there is less wasted space.
That's not really correct, either. Just like ext4, XFS uses a 4k
block size by default, so the minimum allocated to file data is 4k.
The minimum FSB size that XFS supports is the sector size, but that
is not the default...
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
next prev parent reply other threads:[~2012-10-31 0:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-10-30 12:57 How to use new "native 4k sector sized" HDD with ext4 Ashish Sangwan
2012-10-30 14:22 ` Theodore Ts'o
2012-10-30 14:36 ` Eric Sandeen
2012-10-31 0:43 ` Dave Chinner [this message]
2012-10-31 5:32 ` Ashish Sangwan
2012-10-30 14:31 ` Eric Sandeen
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=20121031004304.GJ29378@dastard \
--to=david@fromorbit.com \
--cc=adilger@dilger.ca \
--cc=ashishsangwan2@gmail.com \
--cc=linkinjeon@gmail.com \
--cc=linux-ext4@vger.kernel.org \
--cc=sandeen@redhat.com \
--cc=tytso@mit.edu \
/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).