All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Smith <andy@strugglers.net>
To: list Linux RAID <linux-raid@vger.kernel.org>
Subject: Re: new drive is 4 sectors shorter, can it be used for swraid5 array?
Date: Wed, 30 Mar 2022 02:33:33 +0000	[thread overview]
Message-ID: <20220330023333.durdl4ydb3pz4yab@bitfolk.com> (raw)
In-Reply-To: <CAC6SzHL9Vy2Tz_rVFRphTuAjwPNXg59WAuY8JCXXQ94W09y4sw@mail.gmail.com>

Hi,

On Tue, Mar 29, 2022 at 09:55:40AM +0800, d tbsky wrote:
> In the early days different vendors made different capacity harddisks.
> But at some moment, maybe 250GB or 500GB, suddenly every vendor made
> the same capacity harddisks. It's a mystery to me. who decides the
> disk sector numbers?

There is a standard called IDEMA LBA1-03:

    http://www.idema.org/wp-content/downloads/2169.pdf

This says that a certain "marketing capacity" (i.e. when the drive
product description says "2TB" or whatever) will equal an exact
number of 512 or 4096 byte sectors.

It's been over a decade since I personally saw a SATA, SAS or NVMe
drive that did not obey this, so I've felt comfortable that I could
replace drives from one vendor with another without having to worry
about a few sectors different size here or there.

However, I did see people on this and other mailing lists such as
zfs-discuss saying they were still seeing drives that did not comply
with IDEMA LBA1-03 for capacity as recently as last year, so
apparently I did not look hard enough or have just been lucky.

If you want to play at home the formula in IDEMA LBA1-03 boils down
to:

    ($GB * 1000194048) + 10838016 bytes

using powers of ten definitions for "GB", so anything calling itself
a "2TB" drive should be exactly:

    (2000 * 1000194048) + 10838016

    = 2,000,398,934,016 bytes

Capacity presented to the OS might be lower of course if there is
hardware meddling as you mention.

Again, I've not personally seen anything recently that doesn't obey
this, but people have shown me things that don't, so it's
apparently still a thing.

Cheers,
Andy

  reply	other threads:[~2022-03-30  2:33 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-18  3:08 new drive is 4 sectors shorter, can it be used for swraid5 array? Marc MERLIN
2022-03-18  7:54 ` Wols Lists
2022-03-18 12:30 ` Roman Mamedov
2022-03-19  4:10   ` Marc MERLIN
2022-03-19 10:14     ` Wols Lists
2022-03-19 22:02       ` Marc MERLIN
2022-03-21 19:35       ` Nix
2022-03-19 10:45   ` Roman Mamedov
2022-03-26 18:01 ` Tom Mitchell
2022-03-26 18:29   ` Wols Lists
2022-03-27  8:40 ` d tbsky
2022-03-28  2:05   ` Marc MERLIN
2022-03-29  0:13     ` Chris Murphy
2022-03-29  1:55       ` d tbsky
2022-03-30  2:33         ` Andy Smith [this message]
2022-04-02 12:48           ` d tbsky

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=20220330023333.durdl4ydb3pz4yab@bitfolk.com \
    --to=andy@strugglers.net \
    --cc=linux-raid@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.