TIME-MACHINE(7) Miscellaneous Information Manual TIME-MACHINE(7) NAME Time Machine – an awful one DESCRIPTION If, like me, you have a Raspberry Pi 3 at home that you've just upgraded to FreeBSD 13.0 which has a hard drive from an old laptop attached to it by USB adapter with ZFS on it and you want to use that as a Time Machine backup destination over SMB using samba(8), despite samba(8) being awful software and using ZFS on a system with only 1 GB of RAM being a terrible idea, this is how to do it. In /usr/local/etc/smb4.conf: [global] vfs objects = zfsacl catia fruit streams_xattr fruit:metadata = stream fruit:model = Macmini [TimeMachine] read only = no path = /media/zhdd/backup/TimeMachine fruit:time machine = yes fruit:time machine max size = 250G The important thing here is zfsacl in the vfs objects list. Most pages will tell you about the others, but without zfsacl Time Machine will just fail to create the backup and not provide any useful error. I'm not actually sure if the fruit:metadata setting is required, but a bunch of pages recommend it. The fruit:model just makes it look nice in Finder. The rest creates an SMB share called “TimeMachine” that macOS will be willing to use. You can limit the size of the share that samba(8) reports so that Time Machine doesn't fill up the whole drive. The other important thing to do is to create some swap space. When I first tried backing up to this share, it stopped after a while because smbd(8) got killed when there was nowhere to swap pages to. A wiki page told me to create swap on ZFS like this: zfs create -V 2G \ -o org.freebsd:swap=on \ -o checksum=off \ -o compression=off \ -o dedup=off \ -o sync=disabled \ -o primarycache=none \ zhdd/swap swapon /dev/zvol/zhdd/swap To be fair to samba(8), most of the memory is being used by the ZFS ARC (which you can see in top(1)), but smbd(8) still seems to be using far more memory than is reasonable. It's interesting seeing processes with 0 RES in htop(1) because they're all being swapped out while the ARC takes half the available RAM. And having to wait for my shell to be paged back in when I quit htop(1). Anyway, as expected this whole thing is terribly slow. On my initial backup, I'm currently at 26.49 GB of 104.22 GB with an estimate of 8 hours remaining. Normally transfer time estimates are wildly inaccurate, but I think in this case it's right. AUTHORS june BUGS FreeBSD doesn't seem to want to mount the ZFS volumes on the hard-drive- over-USB automatically at boot. I have to zpool-import(8) the drive manually each time. I don't know if there's a workaround for this, but I don't have anything essential to the system on the drive, and it doesn't need to reboot often. Causal Agency April 25, 2021 Causal Agency