Warn the user if they set "Snapshot directory" to "Visible"

There is a dataset property in ZFS called “snapdir”. It can be disabled or set to hidden or visible using the command-line. The default value is hidden. The TrueNAS UI presents this property as “Snapshot directory” and lets the user choose “Invisible” or “Visible”. TrueNAS defaults to “Invisible” for newly created datasets.

What this does is hide (default) or expose the special snapshot directories that are presented as normal folders for users to navigate. If it’s set to “Invisible”, they are still accessible, but not known or touched by terminal commands, file browsers, or crawlers, unless the user intentionally navigates to .zfs/snapshot. If it’s set to “Visible”, then the special location is visible and known to everything, including directory tree crawlers like rsync or recursive operations used with tools like cp.


Changing it to “Visible” should pop up a warning about the unintended consequences of making this special directory visible.

The first problem is that recursive tools or directory tree crawlers can end up traveling through every snapshot as if they are normal folders, since now they are aware of everything under .zfs/snapshot. This means that if you point rsync or cp to the root directory of a mounted dataset, it will needlessly crawl and copy everything multiple times over, since file-based tools do not understand the concept of shared blocks between snapshots.

Another potential problem is that this can break the “Previous Versions” feature of Windows network shares.

The solution is simple: add more information to the tooltip for the “Snapshot directory” property and pop up a warning if the user selects “Visible”.


If this feature request reaches 2 votes, it will be accepted. Please share this with your friends. Spam it on your Facebook page. Make TikTok dance videos to spread the message. Be the change you want to see in society.

2 Likes