From owner-freebsd-stable@FreeBSD.ORG Wed Mar 25 04:56:48 2015 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id AD7D2FD0 for ; Wed, 25 Mar 2015 04:56:48 +0000 (UTC) Received: from roadkill.tharned.org (roadkill.tharned.org [75.145.12.185]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 71F2B112 for ; Wed, 25 Mar 2015 04:56:47 +0000 (UTC) Received: from angus.tharned.org (angus.tharned.org [10.10.10.7]) (authenticated bits=0) by roadkill.tharned.org (8.14.9/8.14.9) with ESMTP id t2P4uZtA018670 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Tue, 24 Mar 2015 23:56:41 -0500 (CDT) (envelope-from gcr+freebsd-stable@tharned.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=tharned.org; s=2014; t=1427259401; bh=2me0idbDly8dSSBF59CLfHQc10OrgER1/E8VKIgCgZg=; h=Date:From:To:Subject; b=n0mZLgeAerOBELhKKTNS7nk+j/7XfD6ghN0ifbZYblERyXkouNllpZZnN1S9zAgfJ XjoXgZKh01Pzm2bjqW2rsRYj+mcTACHS17ONFhciw0V1lR3JrnQxOkiBfAwXMlliav 8UALseA8hHw4PQ1QAoJovQtHisOFhhnfvl0tSboeVvOoCENIx6575Axk9BAjUqfowm TzaBp716n35EOsv3PKuNTk5L8FwXxAXs65gMnzpt2DwKzdLLDs+jS6TQWyBI4XR70S IMpVxXBibV+0K0iHu7fjlhlMTm2dsROU/5ywcd1cz02BCBwYfly21TVp1PoxOqalWB mgCvSeHMPO3Aw== Date: Tue, 24 Mar 2015 23:56:34 -0500 (CDT) From: Greg Rivers To: freebsd-stable@freebsd.org Subject: Booting from ZFS Message-ID: User-Agent: Alpine 2.20 (BSF 67 2015-01-07) MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.4.3 (roadkill.tharned.org [75.145.12.185]); Tue, 24 Mar 2015 23:56:41 -0500 (CDT) X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Mar 2015 04:56:48 -0000 I'm trying to build a bootable ZFS system on a USB drive. Using the procedure below results in the following error when I try to boot: gptzfsboot: error 66 LBA 48 gptzfsboot: error 66 LBA 1 gptzfsboot: No ZFS pools located, can't boot I'm using the dist files from the latest STABLE snapshot on a system running 10.1-STABLE r279968 amd64. I've tried it with and without file system compression. I found a similar report[1] in the FreeBSD Forums, but there was no conclusion to that posting. What am I doing wrong? [1] https://forums.freebsd.org/threads/freebsd-10-w-fresh-root-on-zfs-fails-to-boot.47651/#post-266106 --------------------------------------------------------------------------- #!/bin/ksh set -x -e DISK=diskid/DISK-4C530009730530116424 TMPDIR=/mnt gpart destroy -F ${DISK} || : gpart create -s GPT ${DISK} gpart add -a 4k -s 512k -t freebsd-boot ${DISK} # p1 gpart add -a 4k -s 1g -t freebsd-swap ${DISK} # p2 gpart add -a 4k -t freebsd-zfs ${DISK} # p3 gpart bootcode -b /boot/pmbr -p /boot/gptzfsboot -i 1 ${DISK} sysctl vfs.zfs.min_auto_ashift=12 zpool create -o altroot=${TMPDIR} -m none -f syspool ${DISK}p3 zfs create -o mountpoint=none syspool/ROOT zfs create -o mountpoint=/ -o compression=lz4 syspool/ROOT/default zpool set bootfs=syspool/ROOT/default syspool zfs create -o mountpoint=/var -o compression=lz4 syspool/var zfs create -o mountpoint=/usr -o compression=lz4 syspool/usr zfs create -o mountpoint=/home -o compression=lz4 syspool/home for DIST in base kernel lib32 games doc do fetch -o - ftp://ftp.freebsd.com/pub/FreeBSD/snapshots/amd64/amd64/10.1-STABLE/${DIST}.txz | tar -C ${TMPDIR} -x -f - done cat <<\! >${TMPDIR}/boot/loader.conf zfs_load="YES" ! cat <<\! >${TMPDIR}/etc/rc.conf zfs_enable="YES" ! cat <<\! >${TMPDIR}/etc/fstab # Device Mountpoint FStype Options Dump Pass# /dev/da0p2 none swap sw 0 0 tmpfs /tmp tmpfs rw 0 0 procfs /proc procfs rw 0 0 fdescfs /dev/fd fdescfs rw 0 0 ! zpool export syspool --------------------------------------------------------------------------- -- Greg Rivers