From owner-freebsd-fs@FreeBSD.ORG Sat Dec 6 18:54:02 2008 Return-Path: Delivered-To: freebsd-fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3F602106564A for ; Sat, 6 Dec 2008 18:54:02 +0000 (UTC) (envelope-from paul.m.saab@gmail.com) Received: from rv-out-0506.google.com (rv-out-0506.google.com [209.85.198.225]) by mx1.freebsd.org (Postfix) with ESMTP id 05DC78FC1A for ; Sat, 6 Dec 2008 18:54:01 +0000 (UTC) (envelope-from paul.m.saab@gmail.com) Received: by rv-out-0506.google.com with SMTP id b25so508361rvf.43 for ; Sat, 06 Dec 2008 10:54:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:references:message-id:from:to :in-reply-to:content-type:content-transfer-encoding:x-mailer :mime-version:subject:date:cc:sender; bh=vMUvp1ZI9OvXcfTgt7KmEsReJn2UxCLvI+s4AFiOTNg=; b=WqlzCxpw/53IZhTx7svTBDxt1tOgC73RMgdDoQd22M083D/vDTolU+C6EDiUDw9svq utfiXFqZRoeCgqA1ery6ugdPwsIpZyXp8X4pZ/Pua9PjH7B5GVEnVZKJTboQg/C4Ea0d 5cfGlrCIyhqB99KHCKMzluU9figeUmj2If/Zg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=references:message-id:from:to:in-reply-to:content-type :content-transfer-encoding:x-mailer:mime-version:subject:date:cc :sender; b=SBlMCSvMfuIUIwQBrHvWVdolywUSsbs1Dt6+9fxaLXETzcDtCiyxNc2t9jtXN9LNPe Yx/j6unF8We1RAoSmCGF3ntrpaxjr583PxFIyZdYSBYWkMghBwGlLm7k95Iu9fOBErY5 1TWWUYGDMPzEg06ccec1qpqgcxgejAt04ANIg= Received: by 10.141.162.1 with SMTP id p1mr677253rvo.190.1228588223484; Sat, 06 Dec 2008 10:30:23 -0800 (PST) Received: from ?10.94.47.251? ([32.159.0.51]) by mx.google.com with ESMTPS id l31sm21665638rvb.2.2008.12.06.10.30.20 (version=TLSv1/SSLv3 cipher=RC4-MD5); Sat, 06 Dec 2008 10:30:22 -0800 (PST) References: <367b2c980811191412h5e0af470k165b37edc2fc5853@mail.gmail.com> <16C31872-6A83-4FAB-AC85-213D604CDDE4@rabson.org> <367b2c980811211331v551893a8sde2231c3bc65468c@mail.gmail.com> <70e8236f0811241748w41884a12la50e4e63f83a7542@mail.gmail.com> <70e8236f0811291708h7ece06dcm1bff0081b5b0fde8@mail.gmail.com> <70e8236f0812060738x5e259df6la00529006c07fc23@mail.gmail.com> Message-Id: <02D2F116-55EF-49D6-91C7-DE71D3AF6F55@mu.org> From: Paul Saab To: Joao Barros In-Reply-To: <70e8236f0812060738x5e259df6la00529006c07fc23@mail.gmail.com> Content-Type: text/plain; charset=us-ascii; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit X-Mailer: iPhone Mail (5G77) Mime-Version: 1.0 (iPhone Mail 5G77) Date: Sat, 6 Dec 2008 10:30:00 -0800 Sender: Paul Saab Cc: "freebsd-fs@freebsd.org" , Paul Saab Subject: Re: ZFSBoot try and bsdlabel bootstrap code X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 06 Dec 2008 18:54:02 -0000 ya. I spent a while looking at this. when you look at the generated code it was obvious. including the wrong sys/type.h is bad On Dec 6, 2008, at 7:38 AM, "Joao Barros" wrote: > On Sun, Nov 30, 2008 at 9:05 AM, Doug Rabson wrote: >> >> On 30 Nov 2008, at 01:08, Joao Barros wrote: >> >>> On Tue, Nov 25, 2008 at 1:48 AM, Joao Barros >>> wrote: >>>> >>>> On Fri, Nov 21, 2008 at 9:31 PM, Olivier SMEDTS >>>> wrote: >>>>> >>>>> 2008/11/20 Doug Rabson : >>>>>> >>>>>> On 19 Nov 2008, at 22:12, Olivier SMEDTS wrote: >>>>>> >>>>>>> Hello, >>>>>>> >>>>>>> I want to boot off a ZFS pool (version 13) on an USB stick for >>>>>>> testing >>>>>>> purposes. But I'm stuck with the bsdlabel bootstrap code size... >>>>>>> I'm using a 2 hours old CURRENT. >>>>>>> >>>>>>> # kldload usb2_storage_mass >>>>>>> # kldload zfs >>>>>>> # dd if=/dev/zero of=/dev/da0 bs=512 count=32 >>>>>>> # fdisk -BI da0 >>>>>>> # dd if=/dev/zero of=/dev/da0s1 bs=512 count=32 >>>>>>> # bsdlabel -wB -b /boot/zfsboot da0s1 >>>>>>> bsdlabel: boot code /boot/zfsboot is wrong size >>>>>>> >>>>>>> Is what I'm trying to do with bsdlabel wrong ? >>>>>>> I previously tried with the default bootstrap code but I had an >>>>>>> (expected) "boot: Not ufs" error at boot. >>>>>>> >>>>>>> PS : I'm not subscribed to this list. >>>>>> >>>>>> The process for install zfsboot is a bit manual (and >>>>>> undocumented). Try >>>>>> something like this: >>>>>> >>>>>> # dd if=/boot/zfsboot of=/dev/da0s1 count=1 >>>>>> # dd if=/boot/zfsboot of=/dev/ds0s1 skip=1 seek=1024 >>>>>> >>>>>> Alternatively, you might try using the brand new support for >>>>>> GPT that I >>>>>> committed yesterday: >>>>>> >>>>>> # gpt create -f da0 >>>>>> # gpt boot -b /boot/pmbr -g /boot/gptzfsboot da0 >>>>>> # gpt add -t freebsd-zfs da0 >>>>>> # zpool create mypool da0p2 >>>>> >>>>> It works ! >>>>> >>>>> Now I'm stuck at loader(8) prompt. >>>> >>>> That's a me too. >>>> >>>> I tried this under vmware with LOADER_ZFS_SUPPORT=yes on make.conf: >>>> # gpart create -s gpt ad0 >>>> # gpart add -b 34 -s 128 -t freebsd-boot ad0 >>>> ad0p1 added >>>> # gpart add -b 162 -s 15078327 -t freebsd-zfs ad0 >>>> ad0p2 added >>>> # gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ad0 >>>> # zpool create tank ad0p2 >>>> # zpool set bootfs = tank tank >>>> >>>> lsdev on loader shows: >>>> cd devices: >>>> disk devices: >>>> disk0: BIOS drive c: >>>> disk0p1: FreeBSD boot >>>> disk0p2: FreeBSD ZFS >>>> pxe devices: >>>> zfs devices: >>>> >>>> Any hints? >>>> >>> >>> >>> I'm trying to figure out why loader doesn't see my zfs pool and >>> here's >>> what I got: >>> >>> FreeBSD/i386 boot >>> Default: tank:/boot/loader >>> boot: status pool: tank >>> config: >>> NAME STATE >>> tank ONLINE >>> ad0p2 ONLINE >>> >>> I added some printfs on loader\main.c: >>> >>> guid = kargs->zfspool; >>> unit = zfs_guid_to_unit(guid); >>> if (unit >= 0) { >>> sprintf(devname, "zfs%d", unit); >>> setenv("currdev", devname, 1); >>> } >>> >>> and guid returns the correct guid for my pool but unit returns -1 >>> which by looking at zfs_guid_to_unit means something is not right. >>> >>> Any pointers Doug? >> >> It looks like loader didn't manage to find the pool for some >> reason. This >> probing process happens in sys/boot/zfs/zfs.c in the function >> zfs_dev_init(). Its supposed to taste all the available disks and >> partitions >> for the presence of a ZFS pool. The actual tasting process happens in >> vdev_probe(). >> >> > > Paul Saab just commited this: http://svn.freebsd.org/changeset/base/185711 > It's working now! Thank you very much to both! :-D > > > -- > Joao Barros