Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 15 Apr 2013 11:28:38 +0200
From:      David Demelier <demelier.david@gmail.com>
To:        =?UTF-8?Q?Trond_Endrest=C3=B8l?= <Trond.Endrestol@fagskolen.gjovik.no>
Cc:        FreeBSD questions <freebsd-questions@freebsd.org>
Subject:   Re: ZFS mounting failed with error 2
Message-ID:  <CAO%2BPfDfoGXC=UqcqYOQrssn8B_d54cEpajL-3hHs0B9neueHaQ@mail.gmail.com>
In-Reply-To: <alpine.BSF.2.00.1304101153440.77823@mail.fig.ol.no>
References:  <CAO%2BPfDev1L_1DcH8K8FwdAo8Sbd0-M5=j6tm6QyS%2BpixJbG9og@mail.gmail.com> <alpine.BSF.2.00.1304101040560.77823@mail.fig.ol.no> <CAO%2BPfDeeoWM08NvfEmUN0CJ-%2B6sCwpg8kxk6q_vHCPTD%2B0Ving@mail.gmail.com> <alpine.BSF.2.00.1304101153440.77823@mail.fig.ol.no>

next in thread | previous in thread | raw e-mail | index | archive | help
I've successfully made booting one virtual machine, I tried again and
it failed again. There's one thing I'm not sure about is that some
people create a dataset root but that actually mounts at / (and not
/root) and some just create others mount points directly on the zpool

I've tested the second one so I did the following :

zpool create -o altroot=/mnt tank /dev/gpt/disk0
zfs create tank/usr
...

And then I've done all the other and I'm still unable to boot, this is
the exact list (and order) I've used :

gpart create -s GPT ada0
gpart add -t freebsd-boot -s 64k -l boot0 ada0
gpart add -t freebsd-swap -s 4G -l swap0 ada0
gpart add -t freebsd-zfs -l disk0 ada0

gpart bootcode -b /boot/pmbr ada0
gpart bootcode -p /boot/gptzfsboot -i 1 ada0

zpool create -o altroot=/mnt tank /dev/gpt/zfs0
zpool set bootfs=tank tank
zfs set checksum=fletcher4 tank

zfs create -o setuid=off                    tank/home
zfs create -o setuid=off                    tank/tmp

# /usr
zfs create                            tank/usr
zfs create                            tank/usr/local
zfs create -o setuid=off -o compression=lzjb            tank/usr/src
zfs create -o setuid=off -o compression=lzjb            tank/usr/ports

# /var
zfs create                            tank/var
zfs create -o setuid=off -o compression=lzjb -o exec=off    tank/var/crash
zfs create -o setuid=off -o compression=lzjb -o exec=off    tank/var/log
zfs create -o setuid=off -o exec=off                tank/var/run
zfs create -o setuid=off                    tank/var/tmp

chmod 1777 /mnt/tmp /mnt/var/tmp

### TYPE EXIT TO INSTALL THE SETS
### THEN CHOOSE LIVECD

echo "/dev/label/swap0 none swap sw 0 0"    >> /mnt/etc/fstab
echo "zfs_enable=YES"                >> /mnt/etc/rc.conf
echo "zfs_load=YES"                >> /mnt/boot/loader.conf
echo "vfs.root.mountfrom=zfs:tank"        >> /mnt/boot/loader.conf

# zpool.cache (unable to boot without)
zpool export tank
zpool import -o cachefile=/tmp/zpool.cache -o altroot=/mnt tank
cp /tmp/zpool.cache /mnt/boot/zfs
zpool export tank

# Finished
shutdown -r now

Regards,

--
Demelier David



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAO%2BPfDfoGXC=UqcqYOQrssn8B_d54cEpajL-3hHs0B9neueHaQ>