Live data from Hacker News

Linux NILFS file system: automatic continuous snapshots

dataswamp.org

11–20 of 158 posts

Re: Linux NILFS file system: automatic continuous snapshots

#11
NILFS is really, really cool. In concept. Unfortunately the tooling and support just isn't there. I ran it for quite some time on my laptop and the continuous snapshoting is everything I hoped it'd be. At one point however there was a change to the kernel that rendered it unbootable. Despite being a known and recorded bug it took forever to get fixed (about a year if I recall correctly) leaving me stuck on an old kernel the whole time.

This was made more frustrating by the lack of any tooling such as fsck to help me diagnose the issue. The only reason I figured out it was a bug was that I booted a live CD to try to rescue the system and it booted fine.

When I finally replaced that laptop I went back to ZFS and scripted snapshots. As much as I want to, I just can't recommend NILFS for daily use.

Re: Linux NILFS file system: automatic continuous snapshots

#12
I think NILFS is a hidden gem. I’ve been using it exclusively in my Linux laptops, desktops etc. since ca. 2014. Apart from one kernel regression bug related to NILFS2 it’s worked flawlessly (no data corruption even with the bug just no access to the file system; effectively it forced running older kernel while the bug was fixed).

The continuous snapshotting has saved me a couple of times; I’ve just mounted a version of the file system from few hours or weeks ago to access overwritten or deleted data. I use NILFS also on backup disks to provide combined deduplication and snapshots easily (just rsync & NILFS’ mkss, latter to make sure the “checkpoints” aren’t unnoticedly garbage collected in case the backup disk gets full).

Re: Linux NILFS file system: automatic continuous snapshots

#13
post #6

Earlier quoted context omitted.

There is no comparison. NILFS provides *continuous* snaphots, so you can inspect and rollback changes as needed. It does without a performance penalty compared to other logging filesystems. And without using additional space forever. The backlog rotates forward continuously. It's a really unique feature that makes a lot of sense for desktop use, where you might want to recover files that were created and deleted afte…

"It does without a performance penalty" yeah. it's already so terribly slow that it's unlikely that taking snapshots can make it any slower :-D

That was not my experience with NILFS. It outperformed ext4 on my laptop NVME.

Re: Linux NILFS file system: automatic continuous snapshots

#14
I had issues with file locking when running some legacy database software on NILFS2. Probably caused data corruption in that database (not the FS itself).

SF website of NILFS2 suggests that there are some unimplemented features, one of them being synchronous IO, which might have caused that issue?

https://nilfs.sourceforge.io/en/current_status.html

In some cases, the NILFS2 is safer storage for your data than ZFS. So NILFS might work for some simple usecases (eg. localy storing documents that you modify often), but it's certainly not ready to be deployed as generic filesystem. It's relatively slow and sometimes behaves bit weird. If something goes really bad, the recovery might be bit painfull. There is no fsck yet, nor community support. NILFS2 can self-heal itself to some extent.

I really like the idea of NILFS2 but at this point i would prefer patch adding continuous snapshotting to ZFS. Unlike NILFS2 the ZFS have lots of active developers and big community. While NILFS2 is almost dead. The fact it's been in kernel for quite some time and most people didn't even noticed it (despite it's very interresting features) speaks for itself.

Don't get me wrong. I wish that more developers get interested in NILFS2 and fix these issues and make it on par with EXT4, XFS and ZFS... But still ZFS has more features overall, so we might just add continuous snapshots in memoriam of NILFS2.

Re: Linux NILFS file system: automatic continuous snapshots

#15
post #13
post #6

Earlier quoted context omitted.

"It does without a performance penalty" yeah. it's already so terribly slow that it's unlikely that taking snapshots can make it any slower :-D

That was not my experience with NILFS. It outperformed ext4 on my laptop NVME.

i think i was running it on 6TB conventional HDD RAID1. also note that the read and write speeds might be quite asymetrical... in general also depends on workload type.

Re: Linux NILFS file system: automatic continuous snapshots

#16
post #7

How close is this to a large continuous tape loop for video surveillance? I would very much welcome a filesystem that breaks away from the directories/files paradigm. Any time-based data store would greatly benefit from that.

I think all you would need to add is a daemon that automatically deletes the oldest file(s) whenever free space drops below a certain threshold, so that the filesystem GC can reclaim that space for new files.

I know and use 'logrotate'.

My point was more on the tracks of a filesystem where a single file can be overwritten over and over again, and it's up to the filesystem to transparently ensure the full capacity of the disk is put towards retaining old versions of the file.

Re: Linux NILFS file system: automatic continuous snapshots

#17
post #11

NILFS is really, really cool. In concept. Unfortunately the tooling and support just isn't there. I ran it for quite some time on my laptop and the continuous snapshoting is everything I hoped it'd be. At one point however there was a change to the kernel that rendered it unbootable. Despite being a known and recorded bug it took forever to get fixed (about a year if I recall correctly) leaving me stuck on an old ker…

How did Linus not go on a rampage after breaking userspace for an entire year? Is NILFS not part of the kernel mainline, I guess?

Re: Linux NILFS file system: automatic continuous snapshots

#18
post #12

I think NILFS is a hidden gem. I’ve been using it exclusively in my Linux laptops, desktops etc. since ca. 2014. Apart from one kernel regression bug related to NILFS2 it’s worked flawlessly (no data corruption even with the bug just no access to the file system; effectively it forced running older kernel while the bug was fixed). The continuous snapshotting has saved me a couple of times; I’ve just mounted a version…

>I think NILFS is a hidden gem. I’ve been using it exclusively in my Linux laptops, desktops etc. since ca. 2014

Yes it's really sad, there we have a native and stable check-summing fs, and nearly no one knows about it.

Re: Linux NILFS file system: automatic continuous snapshots

#19
post #4

How does this compare to ZFS + cron to create snapshots every X minutes?

Week ago my client lost data on ZFS by accidentaly deleting folder. Unfortunately the data was created and deleted in the meantime between two snapshots. One would expect that it still might be possible to recover, because ZFS is CoW.

There are some solutions like photorec (which now has ZFS support), but it expects you can identify the file by footprint of its contents, which was not the case. Also many of these solutions would require ZFS to go offline for forensic analysis and that was also not possible because lots of other clients were using the same pool at the time.

So this had failed me and i really wished at the time that ZFS had continuous snapshots.

BTW on ZFS i use ZnapZend. It's second best thing after continuous snapshots:

https://www.znapzend.org/ https://github.com/oetiker/znapzend/

There are also some ZFS snapshotting daemons in Debian, but this is much more elegant and flexible.

But since znapzend is userspace daemon (as are all ZFS snapshoters) you need some kind of monitoring and warning mechanism for cases something goes wrong and it can't longer create snapshots (crashes, gets killed by OOM or something...). In NILFS2 every write/delete is snapshot, so you are basicaly guaranteed by kernel to have everything snapshoted without having to watch it.

Re: Linux NILFS file system: automatic continuous snapshots

#20

Earlier quoted context omitted.

There is no comparison. NILFS provides *continuous* snaphots, so you can inspect and rollback changes as needed. It does without a performance penalty compared to other logging filesystems. And without using additional space forever. The backlog rotates forward continuously. It's a really unique feature that makes a lot of sense for desktop use, where you might want to recover files that were created and deleted afte…

> It does without a performance penalty. What is the basis for comparison? Sounds like a pretty meaningless statement at its face.

Compared to other logging filesystems obviously.
Post reply on HN