Hacker News new | ask | show | jobs
by vonseel 1295 days ago
So, I just did this recently. This is an ok article for beginners. I’d hesitate to even mention l2arc or slog devices to someone that isn’t an experienced technical user, though, as they will probably go buy the wrong drives and may not even need the added complexity. I’m not using them and I see high write and read speeds from a zpool with 2x2 mirrored vdevs (wd reds).

If the hardware is remotely capable I’d probably advise running proxmox and spinning up a turnkey Linux fileserver container with bind mounts to the underlying zfs filesystem to use as the main samba share manager. This makes it easier for less technical people to manage the users and permissions and stuff with a web gui. I had some trouble getting zfs sambasharing to work with sharesmb=on (not sure where those configs are stored on proxmox, and if it can do everything samba normally can), but you can try that route to or use sharenfs to set up NFS shares.

There are a bunch of options for ACLs in zfs you probably want turned on , acltype and aclmode, and xattr=sa. Also case sensitivity and the case normalization stuff. And atime=off. Does anyone ever actually use access time because I can’t think of any use case for that on my nas!?

To go beyond chmod, you probably want to learn about setfacl and getfacl and set some sane ACLs so your folders and files are created with the correct permissions. If you are sharing stuff with other users, this becomes a problem real quick unless you’ve got the ACLs set right and things get created with 775/664 perms. I like to also set chmod g+s so the default group of anything is the group of the parent, not the current users primary group.

Lastly, if you’re on zfs you can setup something like sanoid to automate snapshots. I just did that, hopefully it will save me next time I run rm -rf against the wrong folder by accident!

3 comments

> I’d hesitate to even mention l2arc or slog devices to someone that isn’t an experienced technical user, though, as they will probably go buy the wrong drives and may not even need the added complexity.

Not just added complexity, I'd ask: Where is the performance gain? How likely is it on a home NAS you're ever going to hit the L2ARC, even if it is tuned to continually update and wear itself out? Very low.

> Lastly, if you’re on zfs you can setup something like sanoid to automate snapshots. I just did that, hopefully it will save me next time I run rm -rf against the wrong folder by accident!

PSA: sanoid is great and everyone should upgrade their experience of sanoid with httm[0].

[0]: https://github.com/kimono-koans/httm

Why would anyone bother with ACLs in a SOHO environment? I'm not sure I understand the threat mode and use case you're designing against.
I had really bad "find ." performance until setting up l2arc. Used a Samsung 980 1 TB NVMe for the purpose.
Because your metadata blocks are sitting in the l2arc, presumably. That's not guaranteed to be the case though. A more modern zfs setup can use that nvme flash as a dedicated device for metadata/"small" blocks, without evicting them at the whim of the caching algo. https://forum.level1techs.com/t/zfs-metadata-special-device-...