Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 10 Jul 2009 17:57:47 -0700
From:      Drew Tomlinson <drew@mykitchentable.net>
To:        freebsd-questions@freebsd.org
Subject:   Attempting ZFS Only Install of 7.2
Message-ID:  <4A57E38B.5050108@mykitchentable.net>

next in thread | raw e-mail | index | archive | help
I'm following guides at:

http://lulf.geeknest.org/blog/freebsd/Setting_up_a_zfs-only_system/
http://wiki.freebsd.org/AppleMacbook
http://menelkir.wordpress.com/2008/07/30/howto-install-freebsd-under-zfs-including-root-part-2/

If I understand correctly, only the first link is about setting up ZFS 
using gptzfsboot and not a UFS partition so I used it as my primary guide.

I've gone through the steps below but can't do the one to copy 
zpool.cache to my zpool(s).  Although the 'zpool import' and 'zpool 
export' succeed, I can not find zpool.cache (not even using 'find / 
-iname zpool.cache' anywhere to copy.  I've tried rebooting once after 
skipping this step and got stuck at the boot prompt.  Upon rebooting 
with the LiveDVD and entering FixIt, I did not have any zpools anymore.  
Not knowing what else to do, I started over from creating zpools.

And now I'm here again.  The only step left is to copy zpool.cache and I 
can't.  What must I do to ensure that my zpools will survive reboot?

I've included my exact steps below for reference.

My system has 4 drives.  I booted from the LiveDVD, entered the FixIt 
shell, and partitioned them as follows using gpart:

ad6 - 750 GB
ad6p1 - 128KB freebsd-boot
ad6p2 - 512MB freebsd-zfs
ad6p3 - 512MB freebsd-swap
ad6p4 - 465GB freebsd-zfs
ad6p5 - 233GB freebsd-ufs

ad8 - 500 GB
ad8p1 - 128KB freebsd-boot
ad8p2 - 512MB freebsd-zfs
ad8p3 - 512MB freebsd-swap
ad8p4 - 465GB freebsd-zfs

ad12 - 500 GB
ad12p1 - 1024MB freebsd-swap
ad12p2 - 465GB freebsd-zfs

ad14 - 500 GB
ad14p1 - 1024MB freebsd-swap
ad14p2 - 465GB freebsd-zfs

I used gptzfsboot from the 8.1-Beta1 iso and used a USB key mounted at 
/tmp/da0 to copy it to the system.  Basically I did:

gpart bootcode -b /boot/pmbr -p /tmp/da0/gptzfsboot -i 1 ad6
gpart bootcode -b /boot/pmbr -p /tmp/da0/gptzfsboot -i 1 ad8

Next I chrooted into /dist to make a "more normal for me" environment.  
To get a good environment I performed these commands:

1. chroot /dist
2. mount -t devfs devfs /dev
3. mount -t tmpfs tmpfs /tmp
4. set -o emacs

Next I created two zpools:

kldload zfs.ko
zpool create root mirror /dev/ad6p1 /dev/ad8p1
zpool create data raid1z /dev/ad6p4 /dev/ad8p4 /dev/ad12p2 /dev/ad14p2

Because /root exists, the root zpool was mounted there.  However /data 
doesn't exist and can't be created because FixIt is a read-only file 
system and thus the error.  But in both cases, the zpool was created.

Now to unmount zfs:root from /root:

zfs umount root

To stop zfs automounting for now, I set mount properties on the two zpools:

zfs set mountpoint=none root
zfs set mountpoint=none data

Next I created zfs filesystems for usr and var:

zfs create data/usr
zfs create data/var

I mounted my destination filesystems under /mnt as so:

mount -t zfs root /mnt
mkdir /mnt/usr
mkdir /mnt/var
mount -t zfs data/usr /mnt/usr
mount -t zfs data/var /mnt/var

Next, copy contets of LiveDVD system to destination filesystems:

cd /
cp -Rv bin boot etc lib libexec root sbin tmp usr var /mnt
(Note: I excluded 'rescue' because on the LiveDVD it's 478MB and thus, 
too large for my 512MB root filesystem.  I don't know why it's so big on 
the LiveDVD because its only around 7MB on a running 7.2 system I 
checked. I'm excluding and hoping my next 'make world' resolves this.)
mkdir /mnt/dev

Create/edit /mnt/boot/loader.conf as follows:

zfs_load="YES"
vfs.root.mountfrom="zfs:tank

And now I'm at the part where I'm stuck at copying the zpool.cache 
file.  Help?

Thanks,

Drew

-- 
Be a Great Magician!
Visit The Alchemist's Warehouse

http://www.alchemistswarehouse.com




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4A57E38B.5050108>