Solved Why is only swap in fstab after install

root@bsd:~ # cat /etc/fstab

# Device Mountpoint FStype Options Dump Pass#

/dev/ada2p3 none swap sw 0 0

fdescfs /dev/fd fdescfs rw 0 0

root@bsd:~ #


You can ignore the fdescfs- I put that in there.

root@bsd:~ # freebsd-version

12.0-BETA3

I just installed this thing. Everything works fine. I've done this twice. So why is it able to boot without any entries into fstab?

Am I missing something? I've attached my zpool status to prove I am not crazy.
 

Attachments

  • Greenshot 2018-11-12 22.49.51.png
    Greenshot 2018-11-12 22.49.51.png
    19.3 KB · Views: 209
"
Mount Points
Creating a ZFS file system is a simple operation, so the number of file
systems per system is likely to be numerous. To cope with this, ZFS auto-
matically manages mounting and unmounting file systems without the need
to edit the /etc/fstab file. All automatically managed file systems are
mounted by ZFS at boot time.

"

Thanks !
 
I see several posts explaining the mounting, but none explain the actual booting ;)

I just installed this thing. Everything works fine. I've done this twice. So why is it able to boot without any entries into fstab?
Several reasons.

First check /boot/loader.conf, there you'll spot something in the likes of:
Code:
zfs_load="YES"
vfs.root.mountfrom="zfs:zroot/ROOT/default"
I could be a little off with the vfs.root.mountfrom value, that's because I never use the installer myself anymore and so my servers ZFS structure is completely different (my root is just zroot). Still: this entry tells the FreeBSD bootloader from where to mount the root filesystem, in this case a ZFS filesystem.

When booting FreeBSD (while in the boot menu) press escape to drop to the ok> prompt, then use the lsdev command. Then you'll also see mentioning of your ZFS pool.

Second reason:
Code:
peter@zefiris:/home/peter $ zpool get bootfs zroot
NAME   PROPERTY  VALUE   SOURCE
zroot  bootfs    zroot   local
Your ZFS pool has a custom entry called bootfs which points the system to the filesystem from which it can boot.

Fun fact: you can even put your swap space onto your ZFS pool after which your /etc/fstab would be completely empty ;)
 
I've always viewed /etc/fstab as an easy stumbling block. One wrong entry and things get frustrating... On non-freebsd systems, I always go well out of my way to dump UUIDs into autofs configs in order to avoid dependency on /etc/fstab ...

All of that to say that I love how ZFS works on FreeBSD.
 
Back
Top