Open danielkza opened 9 years ago
I would be willing to try and do this myself, but it would be nice if someone more familiar with the project could answer a few questions to me first.
.zfs
special directory, but it's structure doesn't match snapper's, and IIRC needs a special pool option set.That's great to hear. To answer your questions:
It is acceptable to use commands instead of ioctl as long as it's secure (LVM code does so).
Secure here means that a user who can modify the subvolume of which snapshots are made cannot cause snapper (running as root) to do harmful things, e.g. via symbolic links cause snapper to compare files outside the subvolume during comparing snapshots.
For that reason snapper always checks the permissions on .snapshots and uses system calls working on file descriptor (e.g. openat).
Hi Daniel,
Just thought I'd drop a quick line and see if you had a chance to look into things a bit more with regards to adding ZFS snapshot functionality to the snapper app? That would be incredibly useful to add a slick gui interface. Perhaps something along the lines of FreeNAS looks, but inside of snapper?
I started an attempt at this a while ago. My initial idea would be using libzfs, but I ran into issues with different ZFS implementations in the limited testing I could do. So I suppose going through the zfs command could be a better path.
I'll do another take in the coming days and report my findings, but unfortunately, my free time is somewhat sparse ATM. I gladly accept any suggestions or help in the matter.
Em qui, 6 de ago de 2015 01:12, hoconnor2 notifications@github.com escreveu:
Hi Daniel,
Just thought I'd drop a quick line and see if you had a chance to look into things a bit more with regards to adding ZFS snapshot functionality to the snapper app? That would be incredibly useful to add a slick gui interface. Perhaps something along the lines of FreeNAS looks, but inside of snapper?
— Reply to this email directly or view it on GitHub https://github.com/openSUSE/snapper/issues/145#issuecomment-128230583.
Any news on this?
Bump
I started an attempt at this a while ago. My initial idea would be using libzfs, but I ran into issues with different ZFS implementations in the limited testing I could do. So I suppose going through the zfs command could be a better path
are there any improvements two years later in libzfs? I'd be happy even if you limited support to only latest released version
nobody seems to be interested, the are all on btrfs...
…trying to recover their data?
j/k looking for a simple auto snapshot manager that can work with samba's plugin for windows previous versions, with zfs.
Btrfs isn't suitable for VMs, supporting ZFS would be awesome.
+1
So I made an initial version of Snapper with ZFS; it at least passes the testsuite, and seems to work. It can be found on the feature/zfs branch here.
It uses the zfs
binary as the front end. The calls are generally simple enough, and it seemed easier.
Notes:
.zfs/snapshot
). I'm using symlinks from .snapper/1/snapshot --> .zfs/snapshot/snapper-1
. Oh yeah, snapshots are called snapper-#
. I've put some stubs in the code for potentially using either bind mounts to this point or using the legacy mounting system. zfs mount
doesn't like to mount snapshots, and really, there's not much reason to.zpool get freeing
stat as a substitute for the sync
command. Kinda busy with lots of other things though, so if anyone else wants to implement it, be my guest.Let me know if it works for you! I'd highly suggest trying it in a VM at first though...
I've put some stubs in the code for potentially using either bind mounts to this point or using the legacy mounting system. zfs mount doesn't like to mount snapshots
On all zfs-on-linux systems I've used since 2012, entering the .zfs/snapshot/snapshotname directory will automount it, then when last handle is closed, the directory will unmount automatically. this is entirely managed by zfs. you simply access it, and that's it.
Yeah, I know that ZFS automounts to the .zfs directory. However, symlinks can cause problems sometimes so I was thinking that alternative mounting strategies may be appreciated. There has to be some sort of the mount/link/etc. to the actual ZFS snapshot directory in order to store snapshot metadata, as the .zfs directory is read-only.
It would be nice if ZFS filesystems running through FUSE or ZFSOnLinux were supported, in addition to BTRFS and LVM.