linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Stan Hoeppner <stan@hardwarefreak.com>
To: "Martin K. Petersen" <martin.petersen@oracle.com>,
	Chris Murphy <lists@colorremedies.com>
Cc: Linux RAID Mailing List <linux-raid@vger.kernel.org>
Subject: Re: Why 4k native drives haven't arrived
Date: Sun, 12 Jan 2014 12:41:29 -0600	[thread overview]
Message-ID: <52D2E1D9.3030303@hardwarefreak.com> (raw)
In-Reply-To: <yq1txd9nw2d.fsf@sermon.lab.mkp.net>

On 1/12/2014 7:55 AM, Martin K. Petersen wrote:
>>>>>> "Chris" == Chris Murphy <lists@colorremedies.com> writes:
> 
> Chris> Huh. Two more cases. All three involve USB enclosures. Bug or
> Chris> feature?  
> 
> Feature.
> 
> Chris> Is it possible the enclosure's bridge chipset is disabling the
> Chris> drive's 512-byte emulation?
> 
> There's nothing to disable. If the USB-SATA bridge exposes 4K logical
> blocks to the host all accesses will inevitably be aligned multiples of
> 4K. All the bridge needs to do is adjust LBA and transfer length. Not
> unlike how we handle 1/2/4Kn in the Linux SCSI disk driver given that
> the block layer always uses 512-byte sectors.
> 
> The two 4Kn USB drives I have both use 512e drives internally:
> 
> # sg_readcap -l /dev/sdd | grep Logical
>    Logical block length=4096 bytes
>    Logical blocks per physical block exponent=0
> # hdparm -I /dev/sdd | grep Sector 
>         Logical  Sector size:                   512 bytes
>         Physical Sector size:                  4096 bytes
>         Logical Sector-0 offset:                  0 bytes
> 
> It is conceivable that there are other USB drives out there that
> actually use 4Kn drives inside but I doubt it. All the 4Kn SATA drives I
> have in the lab are engineering samples...

The user reported 4096B logical sector size with the drive in the USB
enclosure.  He then directly connected to a mobo SATA port and saw 512B
logical sector size.

It seems pretty cut and dried that his USB-SATA bridge firmware was
incorrectly passing the 4096B physical sector size of a 512e drive, as
the logical sector size, to the host.

While this isn't the expected behavior, if the host OS can deal with
4096B sectors, as Linux can, it seems there may actually be some
advantage to this, as it would prevent 512B/RMW misalignment if
partitioning the drive.  As always, if one directly formats the drive
with a filesystem it makes no difference what sector size is reported.

-- 
Stan

  parent reply	other threads:[~2014-01-12 18:41 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-09 21:49 Why 4k native drives haven't arrived Chris Murphy
2014-01-12  4:01 ` Chris Murphy
2014-01-12 13:55   ` Martin K. Petersen
     [not found]     ` <F92ECEC1-D375-498B-8C6A-C88C815C325F@colorremedies.com>
2014-01-12 18:32       ` Martin K. Petersen
2014-01-12 19:04         ` Chris Murphy
2014-01-12 19:27           ` Chris Murphy
2014-01-12 20:25           ` Roman Mamedov
2014-01-12 18:41     ` Stan Hoeppner [this message]
  -- strict thread matches above, loose matches on Subject: below --
2014-01-03  1:53 Stan Hoeppner
2014-01-03 11:23 ` Mikael Abrahamsson
2014-01-03 11:27 ` Dimitri John Ledkov
2014-01-23  2:19   ` Phillip Susi
2014-01-03 21:04 ` Martin K. Petersen
2014-01-04 18:40   ` Stan Hoeppner
2014-01-06 23:35     ` Martin K. Petersen
2014-01-05 18:48   ` Peter Grandi
2014-01-06 23:50     ` Martin K. Petersen

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=52D2E1D9.3030303@hardwarefreak.com \
    --to=stan@hardwarefreak.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=lists@colorremedies.com \
    --cc=martin.petersen@oracle.com \
    /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).