From owner-freebsd-current@FreeBSD.ORG Fri Jul 17 05:17:38 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7FEFD1065670 for ; Fri, 17 Jul 2009 05:17:38 +0000 (UTC) (envelope-from swhetzel@gmail.com) Received: from mail-vw0-f172.google.com (mail-vw0-f172.google.com [209.85.212.172]) by mx1.freebsd.org (Postfix) with ESMTP id 334238FC13 for ; Fri, 17 Jul 2009 05:17:38 +0000 (UTC) (envelope-from swhetzel@gmail.com) Received: by vwj2 with SMTP id 2so624559vwj.3 for ; Thu, 16 Jul 2009 22:17:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=CdqN29JqjCcjtwh3XrabCBXOJdbmuWM18iECjIcO6zI=; b=k8y4X7tMrkcbjO7eh3y1y6OgQly4QwPqH1jpLv3k7sjHBnK+a3j8wTz+SEQZ+E1TIq +DlGgB6FdSWKaBVLe0h+xOU9YKQ+qz4PgHQia+XODTznqm2vErK06QhbXNtsVu2nDtxs k59/EG08fTmVjfDuw8fgvx8fcGZYyLoer79Gg= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=dXOhFOwlUYm07VzaUuEp9Gt2ZN61DZxPE6OaxIsKtFjVpDt1/bKZ5CsykoZLdsJ/tc 4FLFQ/BwEPE/kuY33vu8qiho/WRh/3IjqRx+qWwYA2hNJQ8FF37aT1kZ546Vtu54S9Bt 1l9ZAJXkQLUjfyPoD1SAqdnkdmDYICZmDKTL0= MIME-Version: 1.0 Received: by 10.220.98.17 with SMTP id o17mr894415vcn.86.1247807857616; Thu, 16 Jul 2009 22:17:37 -0700 (PDT) In-Reply-To: <367b2c980907120756k3977ec5ah4e56d76dd4cfbd52@mail.gmail.com> References: <790a9fff0907101159w495b644dge4a4bd81de0bda9b@mail.gmail.com> <20090710211809.GA84773@crodrigues.org> <790a9fff0907101911y7143ed4bnbb050d78ebc21558@mail.gmail.com> <790a9fff0907110606t61da8ebbufa5575d12d949ca@mail.gmail.com> <367b2c980907111603t74766651gf52310d38dc48dd2@mail.gmail.com> <790a9fff0907111855md9de566n62926c0037606514@mail.gmail.com> <367b2c980907120756k3977ec5ah4e56d76dd4cfbd52@mail.gmail.com> Date: Fri, 17 Jul 2009 00:17:37 -0500 Message-ID: <790a9fff0907162217m7147077eob639aa5a0c8351e@mail.gmail.com> From: Scot Hetzel To: Olivier SMEDTS Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-current Subject: Re: [SOLVED]Re: How to create ZFS on Root using MBR slices? 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: Fri, 17 Jul 2009 05:17:38 -0000 On Sun, Jul 12, 2009 at 9:56 AM, Olivier SMEDTS wrote: > 2009/7/12 Scot Hetzel : >>> Can you successfuly boot this ZFS-Only FreeBSD on MBR slices ? >>> >> Yes, my system has successfully booted from the ZFS-Only Root >> filesystem as outlined in >> http://wiki.freebsd.org/ZFSOnRootWithZFSboot. =A0I did have to set >> exec=3Don for the /var/tmp directory, otherwise it wouldn't let pkg_add >> run the +INSTALL scripts from the package staging area in /var/tmp. >> >>> I tried the zfsboot trick few months ago and it didn't work for me. >>> And it still doesn't work, I'm stuck at the loader with no prompt. I >>> tried both with a BSD partition (freebsd-zfs type) and without, >>> directly on the MBR slice. >>> >> >> Did it get stuck at the Boot Manager menu (F1 - Win, F2 - FreeBSD, >> ...) or did it show that it was running /boot/loader? >> >> If it was running /boot/loader, you need to make sure that >> LOADER_ZFS_SUPPORT (add it to src.conf) was used to build /boot/loader >> =A0and installed on your system. >> >> Also make sure that /boot/zfs/zpool.cache was copied to your ZFS zpool >> (i.e zroot/boot/zfs/). > > I did both. Here is what I did exactly : > # cd /usr/src > # make -j4 buildworld LOADER_ZFS_SUPPORT=3Dyes > # make -j4 buildkernel > # zpool destroy tank > # gpart delete -i 2 ada0 > # gpart add -b 104856255 -s 209712510 -t freebsd -i 2 ada0 > # dd if=3D/dev/zero of=3D/dev/ada0s2 bs=3D512 count=3D64 > # gpart create -s BSD /dev/ada0s2 > # gpart add -t freebsd-zfs ada0s2 > # zpool create -R /mnt tank ada0s2a > # zpool export tank > # dd if=3D/boot/zfsboot of=3D/dev/ada0s2 bs=3D512 count=3D1 > # dd if=3D/boot/zfsboot of=3D/dev/ada0s2a bs=3D512 skip=3D1 seek=3D1024 > # zpool import -o altroot=3D/mnt tank > # zfs create tank/freebsd > # zpool set bootfs=3Dtank/freebsd tank > # zfs create -V 2G tank/swap > # zfs set org.freebsd:swap=3Don tank/swap > # zfs set checksum=3Doff tank/swap > # make installworld DESTDIR=3D/mnt/freebsd/ > # make installkernel DESTDIR=3D/mnt/freebsd/ > # make distribution DESTDIR=3D/mnt/freebsd/ > # cp /boot/zfs/zpool.cache /mnt/freebsd/boot/zfs/ > # cp /boot/loader.conf /mnt/freebsd/boot/ > # cat << EOF >> /mnt/freebsd/boot/loader.conf > zfs_load=3D"YES" > vfs.zfs.prefetch_disable=3D"1" > vfs.root.mountfrom=3D"zfs:tank/freebsd" > EOF > # touch /mnt/freebsd/etc/fstab > TODO : tmpfs > # cat << EOF > /mnt/freebsd/etc/rc.conf > zfs_enable=3D"YES" > EOF > # zfs unmount tank > # reboot > > I don't use the FreeBSD boot manager but grub. Loader does not output > anything, and I can't abort it with a key. I tried with a GPT > partition scheme on a USB key and it worked, but I couldn't manage to > get it working with MBR slices. With or without BSD partitions inside > the slice. > Oliver, Going through your steps, I don't see either tank and tank/freebsd being set to legacy: zfs set mountpoint=3Dlegacy tank zfs set mountpoint=3Dlegacy tank/freebsd At first, I only set tank/freebsd to legacy, but it wouldn't mount the tank/freebsd as the root filesystem. When I changed tank to legacy, the system mounted tank/freebsd as the root filesystem when booted. Scot