From owner-freebsd-fs@FreeBSD.ORG Thu Nov 20 17:57:07 2014 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 60F432C5 for ; Thu, 20 Nov 2014 17:57:07 +0000 (UTC) Received: from bigwig.baldwin.cx (bigwig.baldwin.cx [IPv6:2001:470:1f11:75::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 3927EF12 for ; Thu, 20 Nov 2014 17:57:07 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 319ADB97B; Thu, 20 Nov 2014 12:57:06 -0500 (EST) From: John Baldwin To: freebsd-fs@freebsd.org Subject: Re: BIOS booting from disks > 2TB Date: Thu, 20 Nov 2014 11:10:44 -0500 User-Agent: KMail/1.13.5 (FreeBSD/8.4-CBSD-20140415; KDE/4.5.5; amd64; ; ) References: <17A2AC72-AD70-480A-9BAC-9CC8EAFD572F@we.lc.ehu.es> <7CAD9C0C-E793-4DA8-8ED0-AAB01C77F52C@sarenet.es> In-Reply-To: <7CAD9C0C-E793-4DA8-8ED0-AAB01C77F52C@sarenet.es> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Message-Id: <201411201110.45066.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 20 Nov 2014 12:57:06 -0500 (EST) X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 20 Nov 2014 17:57:07 -0000 On Thursday, November 20, 2014 4:50:24 am Borja Marcos wrote: >=20 > On Nov 20, 2014, at 10:38 AM, Jos=E9 Mar=EDa Alcaide wrote: >=20 > > Can't work out which disk we are booting from. > > Guessed BIOS device 0xffffffff not found by probes, defaulting to disk= 0: > >=20 > > is harmless (given that we actually want to boot from the first disk). > >=20 > > In fact I did another test: I installed FreeBSD on an 8 GB partition *u= sing the MBR scheme instead of GPT*, and the system booted from the first 3= TB disk=20 without any problem (and with four disks attached), despite of showing the = same warning message. >=20 > So, that 0xffffffff might be a buffer overflow being triggered by a faile= d attempt to read the backup GPT table? No. Anytime the early boot stage doesn't like the drive the loader ends up using a device number of -1. It's not really an overflow, but an error indicator. > Let's assume that the BIOS is poorly implemented and it won't read beyond= the 2 TB limit. That would be really odd since EDD has existed and supported 64-bit LBAs si= nce 1995. > As far as I know, booting from a MBR disk doesn't require reading anythi= ng but the "classic" partition table and the partition we > are using. So, as long as the partition fits inside that 2 TB limit it sh= ould work, and it does. Booting requires reading files like /boot/loader which can be anywhere on t= he disk. However, MBR partitions are limited to 32-bit LBAs, so your filesyst= em is similarly limited. > Booting from GPT, however, requires reading the end of the disk. Or is th= e backup copy of the partition table read if and only if > there's some problem with the main one?=20 Booting requires more than reading tables, it requires reading files and th= ose can be anywhere. > Can BIOS be reporting a wrong size for the disk (after all we are assumin= g a dodgy BIOS) and making gptboot to cosider the > table corrupt, hence causing it to try to read the backup copy? >=20 > Whatever, that 0xffffffff parameter (which should be something like 0x80)= looks like a corrupted variable to me, which would mean > we have some buffer overflow? No, as I said above, it is an error indicator, not an overflow. > Maybe I'll try to recompile the boot chain removing the backup reading an= d the sanity checks and see what happens. Can you start with 'lsdev -v' at the loader prompt? =2D-=20 John Baldwin