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

next in thread | previous in thread | raw e-mail | index | archive | help
On Friday, August 12, 2016 10:44:04 PM Warner Losh wrote:
> 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.

Well, we don't always have a GPT for one, and not all BIOS'es lie.  We can
always just start with what the BIOS says and override it if we find a valid
GPT that indicates a larger size (which is what Andriy suggested I believe).

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?3259742.YBnQU2zACB>