3 ms·
While [2] might be a good code example, this functionality is already built into ZFS. At the mountpoint of every dataset is a hidden ".zfs" folder that doesn't
by craftkiller 2y ago
While [2] might be a good code example, this functionality is already built into ZFS. At the mountpoint of every dataset is a hidden ".zfs" folder that doesn't show up, even on a `ls -A`. You just have to believe its there and cd into it. Under that is a "snapshot" folder, and inside that is a folder for each snapshot of that dataset. Those folders contain the files in the snapshot.
So for example, /etc/hosts from my snapshot zrepl_20241011_010143_000 would be at /.zfs/snapshot/zrepl_20241011_010143_000/etc/hosts
If you don't like the magic hidden nature of it, you can even configure it to behave like a normal folder with `zfs set snapdir=visible <dataset>`
- dsp_person 2y agoWhat [2] is doing is exposing the raw send stream as a file, not what the contents of the hidden .zfs folder contains. https://github.com/UNFmontreal/zfs_fuse_snapshot/blob/64b17be54601a775be17c99fcfe20fcac91a6567/zfs_fuse_snapshot.py#L65 https://github.com/UNFmontreal/zfs_fuse_snapshot/blob/64b17b...
- hnlmorg 2y agoThe GP wasn’t suggesting [2] was using the ZFS snapshot folder. It was saying that ZFS natively supports a file system via of snapshots so people should be mindful to use [2] as an example of writing FUSE file systems rather than a practical tool for working with ZFS.