From owner-freebsd-hackers@freebsd.org Fri Aug 12 20:59:42 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id D606BBB82EE for ; Fri, 12 Aug 2016 20:59:42 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from citapm.icyb.net.ua (citapm.icyb.net.ua [212.40.38.140]) by mx1.freebsd.org (Postfix) with ESMTP id 038351258; Fri, 12 Aug 2016 20:59:41 +0000 (UTC) (envelope-from avg@FreeBSD.org) Received: from porto.starpoint.kiev.ua (porto-e.starpoint.kiev.ua [212.40.38.100]) by citapm.icyb.net.ua (8.8.8p3/ICyb-2.3exp) with ESMTP id XAA21220; Fri, 12 Aug 2016 23:59:33 +0300 (EEST) (envelope-from avg@FreeBSD.org) Received: from localhost ([127.0.0.1]) by porto.starpoint.kiev.ua with esmtp (Exim 4.34 (FreeBSD)) id 1bYJYD-000AhP-Ae; Fri, 12 Aug 2016 23:59:33 +0300 Subject: Re: on BIOS problems with disks larger than 2 TB To: John Baldwin , freebsd-hackers@FreeBSD.org References: <6cec427b-4df1-50f0-3014-a96e5f8210f5@FreeBSD.org> <490347865.SvN7iQoFWI@ralph.baldwin.cx> From: Andriy Gapon Message-ID: Date: Fri, 12 Aug 2016 23:58:12 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: <490347865.SvN7iQoFWI@ralph.baldwin.cx> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Aug 2016 20:59:42 -0000 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 :-) -- Andriy Gapon