Skip to content

[FreeBSD] Damn, I locked myself out

September 16, 2022 | 10:17 AM

I was toying with my /boot/loader.conf and found that zfs_load="YES" felt awfully similar to zfs_enable="YES" in my /etc/rc.conf . So I experimented with commenting it out as a test. ๐Ÿ‘€ The next 15 minutes were somewhat painful but I did learn that yes, that is required to boot your OS.

The struggle was zfs adds a whole layer of โ€œI donโ€™t know whatโ€™s happening!โ€ to the mix. Iโ€™m completely new to it and did not expect it would give me trouble when trying to mount from a Live CD. Putting the how-to here for safe keeping.

  1. Boot into multi-user mode from the Live CD
  2. Select SHELL
  3. zpool list To load the ZFS kernel drivers
  4. gpart show ada2 My FreeBSD disk - confirming that there is infact a freebsd-zfs slice
  5. mkdir /tmp/mydata
  6. zpool import -fa -R /tmp/mydata Imports all the zfs pools that can be found to the mount point
  7. zfs mount zroot/ROOT/default mounts the pool to the directory

Iโ€™m a bit hazy on most of that so Iโ€™m going to start reading about zfs, zpools, slices, and try and clean this up for next time. It was a breeze from there of course to fix the issue, but it shined a spotlight on how much I took for granted when I blindly accepted the zfs filesystem during install.