Root on ZFS

Hi everyone,

I have been experimenting lately with ZFS boot on FreeBSD. I have performed different kind of methods and I've reached to the conclusion that using the "vfs.root.mountfrom" method instead of traditional fstab mounts is more flexible. However, when I try to perform an installation using this guide my system boots and doesn't mount /usr /var /tmp patitions

I can only boot to single user mode with readonly ZFS /

I suspect that it has something to do with:
Code:
'vfs.root.mountfrom="zfs:zroot"'
maybe it should be ?
Code:
'vfs.root.mountfrom="zfs:zroot/root"'
From the Fixit environment I can see all the mount points

Please some help!!!
 
as i understand zpool name is zroot?
then you set
Code:
vfs.root.mountfrom="zfs:zroot/root

about /usr and /var if you fallow my zfs tips.... and
Code:
zfs set mountpoint=none zpool
set zpool root mountpoint to none, that every new zfs filesystem in zpools root will have none mountpoint....
for this you need to
Code:
# zfs set mountpoint=/usr zroot/usr

note, that if now create zroot/usr/local, you don't need to set mountpoint for local. it will be mounted under usr
 
Sorry I forgot to insert the link for the guide!

So, instead of:
Code:
Fixit# zfs set mountpoint=legacy zroot
it should be
Code:
Fixit# zfs set mountpoint=none zroot

I will try it this evening!
 
gkontos said:
my system boots and doesn't mount /usr /var /tmp patitions

Your root ZFS is mounted by the kernel according to the vfs.root.mountfrom="zfs:<zpool>/<rootzfs>" setting in /boot/loader.conf. You may also need to set the 'bootfs' property for your root pool.

Mounting the rest of your ZFS filesystems is done by /etc/rc.d/zfs, and requires 'zfs_enable="YES"' in rc.conf.
 
jem said:
Your root ZFS is mounted by the kernel according to the vfs.root.mountfrom="zfs:<zpool>/<rootzfs>" setting in /boot/loader.conf. You may also need to set the 'bootfs' property for your root pool.

Mounting the rest of your ZFS filesystems is done by /etc/rc.d/zfs, and requires 'zfs_enable="YES"' in rc.conf.

In all of my tests I have it enabled in rc.conf

Thanks, I will try the:
Code:
vfs.root.mountfrom="zfs:<zpool>/<rootzfs>"
And let you all know
 
Just to clarify, 'vfs.root.mountfrom' is specifying the path of the ZFS that contains your root filesystem.

On my system, my ZFS's are organised as follows (I'm copying the default OpenSolaris filesystem layout):

Code:
[jason@saturn ~]$ zpool get all rpool
NAME                             USED  AVAIL  REFER  MOUNTPOINT
rpool                           10.9G   576G    21K  /rpool
rpool/ROOT                      2.31G   576G    20K  legacy
rpool/ROOT/freebsd              2.31G   576G  2.17G  /
rpool/ROOT/freebsd@install      96.5M      -  1.24G  -
rpool/ROOT/freebsd@8.0-RELEASE  31.6M      -  1.38G  -
rpool/export                     626M   576G   626M  /export
rpool/home                       292K   576G    19K  /home
rpool/home/jason                 274K   576G   274K  /home/jason
rpool/swap                         8G   584G    16K  -
tank                             107G  3.90T  31.4K  /tank

(Note I don't have seperate ZFS's for /usr, /var etc.)

So I have the following set in /boot/loader.conf:
Code:
vfs.root.mountfrom="zfs:rpool/ROOT/freebsd"

And, I also have:

Code:
[jason@saturn ~]$ zpool get bootfs rpool
NAME   PROPERTY  VALUE               SOURCE
rpool  bootfs    rpool/ROOT/freebsd  local
 
Solved! I suspected there was something wrong but not:
Code:
vfs.root.mountfrom="zfs:zroot"
Just to clarify, 'vfs.root.mountfrom' is specifying the path of the ZFS that contains your root filesystem
Got me thinking that my path was correct so what solved the issue was to:
Code:
zpool set bootfs=zroot zroot
in the end after:
Code:
Fixit# zfs set mountpoint=legacy zroot
Fixit# zfs set mountpoint=/tmp zroot/tmp
Fixit# zfs set mountpoint=/usr zroot/usr
Fixit# zfs set mountpoint=/var zroot/var
and not after creating the pool!

Thank you all for your responses!
 
Back
Top