From owner-freebsd-current@FreeBSD.ORG Fri Jul 10 18:59:33 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 4FA3F1065672 for ; Fri, 10 Jul 2009 18:59:33 +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 07CF98FC0C for ; Fri, 10 Jul 2009 18:59:32 +0000 (UTC) (envelope-from swhetzel@gmail.com) Received: by vwj2 with SMTP id 2so902021vwj.3 for ; Fri, 10 Jul 2009 11:59:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject :from:to:content-type:content-transfer-encoding; bh=0knQ+P5R9vgV0yTnUmnWRK5o7phcTHHxp1gErr+rH5s=; b=Ir3beJTlahu95xOWF2UqXIeE4HCayB48SbMXlOD2bRevczajpWHYsBSTvFfAw+NO2z 5I+7aiSCTCcRP4NIKlfc1g3hTLfnH3eNEmyQ52JfKGQ64uYdMPCQnMGQchmJQ5AIKMZu uXVgnxXI4I5kYQSrCuuXlKu0nQzX/4O9ncviY= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:date:message-id:subject:from:to:content-type :content-transfer-encoding; b=WpeQxTrocrqa9/DdS1u5Wi+ysA9074LrjtPi5pywRK+3IEW8O5slX+Pr8fa22ZDTcb tChHPEKrHBg/8G30DGtjfBtBGXKWdx3tJNAJr19LVT0GkuFxIUwqYv7B0c45viK9BxIE bVAC5q/9KJtkfVGhu6O6uGA/EDzHLvI25TtlE= MIME-Version: 1.0 Received: by 10.220.85.6 with SMTP id m6mr3448030vcl.69.1247252372406; Fri, 10 Jul 2009 11:59:32 -0700 (PDT) Date: Fri, 10 Jul 2009 13:59:32 -0500 Message-ID: <790a9fff0907101159w495b644dge4a4bd81de0bda9b@mail.gmail.com> From: Scot Hetzel To: FreeBSD-Current@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Subject: 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, 10 Jul 2009 18:59:33 -0000 I'm re-installing my laptop, and want to install it using a ZFS Root. This system's Hardrive consists of 3 Slices: ad0s1 - Windows XP ad0s2 - Quick Play ad0s3 - FreeBSD I then installed FreeBSD using the Fixit option from a custom 8.0-CURRENT CD (w/loader built with ZFS support) as follows. -------------------------------------------------------------------------------------------------------------- Creating ZFS Root w/MBR Slices 1. Boot FreeBSD install CD/DVD 2. Choose Fixit option in sysinstall 3. Create Slice using gpart Fixit# gpart show ad0 => 63 625142385 ad0 MBR (289G) 63 209712447 1 !7 (100G) 209712510 417690 2 !136 (204M) 210130200 415012248 - free - (198G) Fixit# gpart add -b 210130200 -s 415012248 -t freebsd ad0 ad0s3 added Fixit# gpart show ad0 => 63 625142385 ad0 MBR (289G) 63 209712447 1 !7 (100G) 209712510 417690 2 !136 (204M) 210130200 415012248 3 freebsd (198G) 4. Create partitions (ad0s3a and ad0s3b) Fixit# gpart show ad0s3 => 0 415012248 ad0s3 BSD (198G) 0 415012248 ad0s3 - free - (198G) Fixit# gpart add -i 1 -b 16 -s 406626318 -t freebsd-zfs ad0s3 ad0s3a added Fixit# gpart show ad0s3 => 0 415012248 ad0s3 BSD (198G) 0 16 - free - (8.0K) 16 406631405 1 freebsd-zfs (194G) 406631421 8380827 - free - (4.0G) Fixit# gpart add -i 2 -b 406626334 -s 8380811 -t freebsd=swap ad0s3 ad0s3b added Fixit# gpart show ad0s3 => 0 415012248 ad0s3 BSD (198G) 0 16 - free - (8.0K) 16 406631405 1 freebsd-zfs (194G) 406631421 8380827 2 freebsd-swap (4.0G) 5. load zfs kernel module kldload /mnt2/boot/kernel/opensolaris.ko kldload /mnt2/boot/kernel/zfs.ko 6. Create Zpool zpool create zroot /dev/ad0s3a zpool set bootfs=zroot zroot 7. Create filesystem hierarchy zfs create -o compression=on -o exec=off -o setuid=off zroot/tmp zfs create zroot/usr zfs create -o compression=on -o setuid=off zroot/usr/ports zfs create -o compression=off -o exec=off -o setuid=off zroot/usr/ports/distfiles zfs create -o compression=off -o exec=off -o setuid=off zroot/usr/ports/packages zfs create -o compression=on -o exec=off -o setuid=off zroot/usr/src zfs create zroot/var zfs create -o compression=on -o exec=off -o setuid=off zroot/var/crash zfs create -o exec=off -o setuid=off zroot/var/db zfs create -o compression=on -o exec=on -o setuid=off zroot/var/db/pkg zfs create -o exec=off -o setuid=off zroot/var/empty zfs create -o compression=on -o exec=off -o setuid=off zroot/var/log zfs create -o compression=on -o exec=off -o setuid=off zroot/var/mail zfs create -o exec=off -o setuid=off zroot/var/run zfs create -o compression=on -o exec=off -o setuid=off zroot/var/tmp 8. install FreeBSD to zroot cd /dist/8.0-20090628-SNAP export DESTDIR=/zroot for dir in base catpages dict doc games info lib32 manpages ports; do (cd $dir ; ./install.sh) ; done cd src ; ./install.sh all cd ./kernel ; ./install.sh dv8135nr ; ./install.sh generic 9. create rc.conf, loader.conf, src.conf echo 'zfs_enable="YES"' > /zroot/etc/rc.conf echo 'LOADER_ZFS_SUPPORT=YES' >> /zroot/etc/src.conf echo 'zfs_load="YES"' >> /zroot/boot/loader.conf echo 'vfs.root.mountfrom="zfs:zroot"' >> /zroot/boot/loader.conf 10. change root password chroot /zroot passwd exit 11. create zpool.cache mkdir /boot/zfs zpool export zroot && zpool import zroot cp /boot/zfs/zpool.cache /zroot/boot/zfs/zpool.cache 12. export LD_LIBRARY_PATH export LD_LIBRARY_PATH=/mnt2/lib 13. Change mount points for zroot pool zfs set mountpoint=legacy zroot zfs set mountpoint=/tmp zroot/tmp zfs set mountpoint=/usr zroot/usr zfs set mountpoint=/var zroot/var 14. Install boot Manager fdisk -B -b /boot/boot0 ad0 15. Install ZFS boot dd if=/mnt2/boot/zfsboot of=/dev/ad0s3 count=1 dd if=/mnt2/boot/zfsboot of=/dev/ad0s3 skip=1 seek=1024 -------------------------------------------------------------------------------------------------------------- When I reboot the system, it says that it is unable to locate the ZFS partition. Is there anything wrong with the above install procedure for creating a ZFS Root MBR Slice install? Scot