-
-
Notifications
You must be signed in to change notification settings - Fork 6
ZFS FAQ
How do I remount a filesystem in read/write mode? zfs set readonly=off zroot
How do I mount all filesystems? zfs mount -a
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
zfs set sharenfs="-maproot=0 -network 192.168.0.0/24" zroot/my/path
service mountd restart
zfs get sharenfs zroot/my/path
Note that any entries from sharenfs commands get placed in /etc/zfs/exports
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
many guides recommend 8K or 16K for recordsize with postgresql. There are some benchmarks showing better results with 16K, but most favor 8k as that aligns with default block sizes in PG.
zfs set recordsize=8K tank/usr/local/pgsql
zfs set primarycache=metadata tank/usr/local/pgsql
zfs set logbias=throughput tank/usr/local/pgsql
zfs set redundant_metadata=most tank/usr/local/pgsql
Setting a larger recordsize can be quite beneficial for large files such as videos.
zfs set recordsize=1M tank/media/video
It's usually a bad idea to use deduplication unless you have a lot of RAM or a very small file system. The minimum is usually around 5GB of RAM per 1TB of disk.
To receive data as a non root user, myuser:
zfs allow myuser mount,create,receive vm/vm
To send, first snapshot then send
zfs snapshot vm/vm/m3164b@luke
zfs send vm/vm/m3164b@luke | ssh myuser@myhost zfs recv vm/vm/m3164