From owner-freebsd-current@FreeBSD.ORG Wed Dec 10 00:33:46 2008 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 5F97D1065675; Wed, 10 Dec 2008 00:33:46 +0000 (UTC) (envelope-from paul@fletchermoorland.co.uk) Received: from hydra.fletchermoorland.co.uk (93-152-14-233.daisydsl.managedbroadband.co.uk [93.152.14.233]) by mx1.freebsd.org (Postfix) with ESMTP id AC8EC8FC0C; Wed, 10 Dec 2008 00:33:45 +0000 (UTC) (envelope-from paul@fletchermoorland.co.uk) Received: from apollo (78-32-77-91.static-adsl.entanet.co.uk [78.32.77.91] (may be forged)) by hydra.fletchermoorland.co.uk (8.14.2/8.14.2) with ESMTP id mB9NsOCU026758; Tue, 9 Dec 2008 23:54:24 GMT (envelope-from paul@fletchermoorland.co.uk) From: "Paul Wootton" To: "'Doug Rabson'" , "'Joao Barros'" References: <200812070319.18461.ken@mthelicon.com><66BF33BA-EC11-446F-9DE7-15395F293FE2@rabson.org> <200812071217.20500.ken@mthelicon.com> Date: Tue, 9 Dec 2008 23:54:23 -0000 Message-ID: MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="----=_NextPart_000_097A_01C95A59.76D7E7A0" X-Mailer: Microsoft Office Outlook 11 Thread-Index: AclYZdeqvU848MR2S165xKklLA3etgB84p/Q X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5579 In-Reply-To: <200812071217.20500.ken@mthelicon.com> X-Mailman-Approved-At: Wed, 10 Dec 2008 14:03:56 +0000 Cc: hackers@freebsd.org, current@freebsd.org, 'Pegasus Mc Cleaft' Subject: RE: Problems with zfsboot loader if raidz present on any drive X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Dec 2008 00:33:46 -0000 This is a multi-part message in MIME format. ------=_NextPart_000_097A_01C95A59.76D7E7A0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit >-----Original Message----- >From: owner-freebsd-hackers@freebsd.org >[mailto:owner-freebsd-hackers@freebsd.org] On Behalf Of Pegasus Mc >Cleaft >Sent: 07 December 2008 12:17 > To: Doug Rabson > Cc: hackers@freebsd.org; current@freebsd.org > Subject: Re: Problems with zfsboot loader if raidz present on any >drive > > On Sunday 07 December 2008 09:22:16 Doug Rabson wrote: > On 7 Dec 2008, at 03:19, Pegasus Mc Cleaft wrote: > > > Hello Hackers, > > > > > > Recently and friend and I have been trying to get the new > > > gptzfsboot working on our machines and ran into a interesting > > > problem. > > > > > > Initially I was building the world without the environment > > > variable LOADER_ZFS_SUPPORT=YES in the /etc/make.conf and this, of > > > course, didnt work very well. Every time the machine booted, it > > > would throw 2 lines after the pin-wheel and then reboot. I > > > couldent read what the lines were it went so fast. > > > > > > My friend had a bit more luck and got his machine working OK with > > > a single drive and later a mirror drive added. > > > > > > I added the environment variable and rebuilt everything and > > > installed. This time, I could see the bios drives and a further 2 > > > lines of ZFS something and a reboot... > > > > > > No matter what I tried, I couldent get the machine to boot up to > > > a point where I could try and fix the problem, so I started > > > pulling devices out and found the following: If there is a raidz > > > pool on any drive (not necessarily the one that you are trying to > > > boot from) the loader dies and reboots the machine. My friend, as > > > an experiment created 3 gpt partitions (in addition to the single > > > partition that he had been previously booted from) on his single > > > drive and made a raidz pool for testing. His machine showed the > > > same condition as mine, however he was able to capture the message > > > before the machine > > > rebooted: > > > > > > > > > ZFS: can only boot from disk or mirror vdevs > > > > > > ZFS: inconsistent nvlist contents > > > > The zfsboot code in current doesn't support raidz or raidz2. I have > > been working on adding that support but its not ready yet. The code > > works in my test harness but crashes instantly when I put it in the > > boot code :(. I should have time to finish debugging it soon. > > Hi Doug, > > In my haste to put a message to the group, I didnt do a very good job > of explaining or give what platform I was working with. > > I set up a single disk pool with the gptzfsboot code on it as a boot drive. > My idea was to have a single disk boot (and after it boots and I can > kill the UFS drive I am currently booting from) convert it to a > mirror. But I have 6 other drives in the machine that I have as a raidz for my /usr/home, et al. > > If the 6 raidz drives are present at boot time, the machine starts to > cyclic reboot just after the pin-wheel. > > The machine I am working on is running FBSD8.0-Current as of midnight > 7/12/2008 and the platform is AMD64. > > If I can help test in any way I would be more than happy to try, or > provide any information necessary.. > > ~Peg Hi Doug, I was working with Peg on this over the weekend. I think I have a patch for this - see http://www.freebsd.org/cgi/query-pr.cgi?pr=129539 The problem was that we were not checking the return code from vdev_init_from_nvlist() on line 726 in /usr/src/sys/boot/zfs/zfsimpl.c Joao, Do you want to try the attached patch? It seems to have fixed the problem, at least on mine and Peg's machine. Cheers Paul ------=_NextPart_000_097A_01C95A59.76D7E7A0 Content-Type: application/octet-stream; name="zfsimpl.c.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="zfsimpl.c.patch" *** zfsimpl.c Wed Nov 19 16:59:19 2008=0A= --- zfsimpl.c.fix Tue Dec 9 22:48:36 2008=0A= ***************=0A= *** 721,731 ****=0A= if (nvlist_find(nvlist,=0A= ZPOOL_CONFIG_VDEV_TREE,=0A= DATA_TYPE_NVLIST, 0, &vdevs)) {=0A= return (EIO);=0A= }=0A= ! vdev_init_from_nvlist(vdevs, &top_vdev);=0A= =0A= /*=0A= * Add the toplevel vdev to the pool if its not already there.=0A= */=0A= STAILQ_FOREACH(pool_vdev, &spa->spa_vdevs, v_childlink)=0A= --- 721,733 ----=0A= if (nvlist_find(nvlist,=0A= ZPOOL_CONFIG_VDEV_TREE,=0A= DATA_TYPE_NVLIST, 0, &vdevs)) {=0A= return (EIO);=0A= }=0A= ! int initRetVal =3D vdev_init_from_nvlist(vdevs, &top_vdev);=0A= ! if(initRetVal)=0A= ! return initRetVal;=0A= =0A= /*=0A= * Add the toplevel vdev to the pool if its not already there.=0A= */=0A= STAILQ_FOREACH(pool_vdev, &spa->spa_vdevs, v_childlink)=0A= ------=_NextPart_000_097A_01C95A59.76D7E7A0--