Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Possibility to use fanotify to trigger snapshots #73

Open
Harvie opened this issue Oct 6, 2017 · 2 comments
Open

Possibility to use fanotify to trigger snapshots #73

Harvie opened this issue Oct 6, 2017 · 2 comments

Comments

@Harvie
Copy link

Harvie commented Oct 6, 2017

NILFS2 is filesystem that by design creates snapshot after any data change, so it can be easily rolled back to any time without specificaly making snapshots at that time using cron... Is it possible to mimick such feature using inotify to watch file changes and make snapshots accordingly? Maybe not for every inotify event, but at least for some.

@linsomniac
Copy link

I haven't done much research lately, but many years ago I was looking at inotify and found that you have to have a watch on every directory in the filesystem to get all change events. For a big file-system, this may be problematic. It probably would be ok for smaller filesystems.

I wonder if there's another mechanism that would be better? Like dtrace, or is there some way to see if the ZFS master block has been updated? Or maybe take regular snapshots, but then go through and preen the older ones that have a "USED" size of 0 (which I think means it contains no deltas, so no written data).

@Harvie
Copy link
Author

Harvie commented May 14, 2019

I was looking at inotify and found that you have to have a watch on every directory in the filesystem to get all change events.

I've recently saw there is some newer API, which solves this problem, but some features were not implemented yet... but i don't remember the name...

update: it's called fanotify (not to be confused with even older dnotify)

https://www.phoronix.com/scan.php?page=news_item&px=Linux-5.1-Fanotify-Improvements

@Harvie Harvie changed the title Possibility to use inotify to trigger snapshots Possibility to use fanotify to trigger snapshots May 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants