Comments (14)
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 on Linux doesn't have ACLs enabled by default. Right now that causes some issues with some of the comparison tests of snapper, but it works fine if ACLs are enabled on the volume.
- ZFS snapshots are the whole volume or nothing. I couldn't figure out a way to exclude a .snapshot directory, so instead snapper makes a subvolume that stores the .snapshot directory. If anyone has a better idea, I'm open to changes.
- ZFS automatically has a hidden folder in the root of each volume that contains the snapshots (
.zfs/snapshot
). I'm using symlinks from.snapper/1/snapshot --> .zfs/snapshot/snapper-1
. Oh yeah, snapshots are calledsnapper-#
. 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. - There's also a stub where I was going to monitor the
zpool get freeing
stat as a substitute for thesync
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...
from 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
are there any improvements two years later in libzfs?
I'd be happy even if you limited support to only latest released version
from snapper.
Bump
from snapper.
Btrfs isn't suitable for VMs, supporting ZFS would be awesome.
from snapper.
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.
- Is it acceptable to use commands instead of a library or IOCTLs to do snapshot control? Unfortunately there is no common established API between all the ZFS implementations.
- ZFS snapshots don't really work like BTRFS where they automatically end up as visible subvolumes. Is that assumption intrinsic to how snapper works? They can be mounted manually, or viewed through the
.zfs
special directory, but it's structure doesn't match snapper's, and IIRC needs a special pool option set.
from snapper.
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).
-
For LVM the snapshots are also not visible unless mounted. Snapper has code to mount them when needed.
from snapper.
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?
from 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 [email protected]
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
#145 (comment).
from snapper.
Any news on this?
from snapper.
nobody seems to be interested, the are all on btrfs...
from snapper.
…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.
from snapper.
+1
from 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
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.
from snapper.
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.
from snapper.
Related Issues (20)
- snapper cannot to be built with btrfs-progs v6.1 HOT 3
- Feature Request: Allow multiple POST snapshots w.r.t. an existing PRE snapshot HOT 2
- IO Error (fopen failed errno:2 (No such file or directory)). HOT 2
- IO Error (mktemp failed). HOT 7
- RFE: allow create snaphots every minute HOT 5
- Is it possible to auto-generate snapshots with read-write privileges? HOT 3
- timeline.timer runs even if no timeline configured HOT 2
- Recreate snapshots folder?
- FileUtils.cc(SDir):95 - open failed path FileUtils.cc(SDir):95 - open failed path HOT 2
- Error: Creating config failed (sysconfig-file not found). HOT 3
- provide set-default command HOT 1
- show read-only state in list output HOT 1
- Fedora 38 Support HOT 2
- How do I create a snapshot that never get deleted by the snapper-cleanup? HOT 2
- Doc: snapper-boot: Invalid user from network user HOT 4
- Leap 15.5 installer formats root partition with btrfs withut snapshot support. HOT 3
- Having snapperd create timestamped snapshot directories? HOT 2
- Unable to Remove Specific Snapshots with Snapper HOT 2
- qgroup scan causes system lockups and software crashes, disabling quotas disables size measurement of snapshots. Is there a way to make this work? HOT 3
- have the website be https instead of http HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from snapper.