Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 12 Aug 2016 22:44:04 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        Andriy Gapon <avg@freebsd.org>
Cc:        John Baldwin <jhb@freebsd.org>,  "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>
Subject:   Re: on BIOS problems with disks larger than 2 TB
Message-ID:  <CANCZdfqAyGVeEBfvqt3c_5B%2BnHtvy8o7%2BZDzqp3MqR5bhfm%2Bww@mail.gmail.com>
In-Reply-To: <c69979b3-02ce-0d38-57b0-8996a658e366@FreeBSD.org>
References:  <6cec427b-4df1-50f0-3014-a96e5f8210f5@FreeBSD.org> <490347865.SvN7iQoFWI@ralph.baldwin.cx> <c69979b3-02ce-0d38-57b0-8996a658e366@FreeBSD.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, Aug 12, 2016 at 2:58 PM, Andriy Gapon <avg@freebsd.org> wrote:
> On 12/08/2016 22:18, John Baldwin wrote:
>> Hmm, I'm not sure how easy it is to handle this case (i.e. how do you know
>> if an LBA beyond the size is really legit due to truncation vs coming from
>> corrupted metadata).  Related is that tsoome's bcache stuff wants to know
>> where the end of the disk is (to avoid reading off the end), so just
>> ignoring the size is not easy.
>
> One idea that I have in mind but haven't really explored yet is for GPT
> formatted disks.  Basically, if a GPT label hints that the disk size is larger
> than what BIOS reports, then we could try to read a backup label and if it
> matches what we expect, then we could adjust the size.
>
> Hmm, I think I recall that a long time ago some BIOSes used to do something
> similar with MBR :-)

I think we should just trust the GPT bounds and ignore the actual size
of the disk.
If this is incorrect, we'll get I/O errors to indicate something is
wrong. Doesn't
matter what's wrong, at the end of the day, and many different
pathologies present
as the same error. We should ignore the total size of the disk reported by BIOS
routines because they lie to stay compatible with the long-dead hand
of the past.
The lie is different depending on what the underlying disk technology is,which
we have no real visibility into in /boot/loader.

For MBR, well, it can't go about 2TB anyway for 512 byte sector size and 4k MBRs
are (or at least used to be) quite rare.

Warner



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfqAyGVeEBfvqt3c_5B%2BnHtvy8o7%2BZDzqp3MqR5bhfm%2Bww>