Skip to content

ZFS FAQ

Lucas Holt edited this page Apr 6, 2023 · 14 revisions

How do I remount a filesystem in read/write mode? zfs set readonly=off zroot

How do I mount all filesystems? zfs mount -a

Recovering EFI boot partition

If your boot loader gets corrupted, you can boot off of MidnightBSD install media for your release and do the following from the live cd functionality.

(replace nvd0 with your disk. EFI should be on the first partition)

(more destructive, can wipe custom configurations here) gpart bootcode -p /boot/boot1.efifat -i 1 nvd0

In some cases, you can simply copy the loader.efi (after mounting it) mount_msdosfs /dev/nvd0p1 /mnt cp /boot/loader.efi /mnt/efi/boot/BOOTx64.efi

NFS

Setup NFS shares

zfs set sharenfs="-maproot=0 -network 192.168.0.0/24" zroot/my/path

service mountd restart

Verify configuration

zfs get sharenfs zroot/my/path

Note that any entries from sharenfs commands get placed in /etc/zfs/exports

Setting up multiple subnets

note the new lines INSIDE the quotes

zfs set sharenfs="-maproot=root -network 10.0.0.0/24

> /path/to/mountpoint -maproot=root -network 192.168.0.0/24

> /path/to/mountpoint -maproot=root -network 172.16.0.0/24" pool0/space