Why don't we use NILFS2 more often?


#1

A few days ago I discovered the NILFS2 filesystem. I was very astounded that I didn’t know about it yet, although it is a stable filesystem, which is part of Linux since 2005, and has quite unique features in compare to all the other built in filesystems. I’m using it now for my home and my root partition and until now I’m very satistfied.


#2

What is so great about it, compared to other file-systems?


#3

I really appreciate you raising this topic!
How is it in regards of disk space? One of the reasons I’m using BTRFS is that it can get compression enabled which saves me 1/3 of disk space compared to ext4.
@DeMus, NILFS2 has a continuous snapshot feature which is like the “autosave” option in computer games. :wink:


#4

Used BTRFS a few times and apart from losing a lot of space in the partition which is taken by the file-system, I was not impressed by it. Can’t really say why not, these little things which were different and maybe not even stable, so I always returned to ext4 which gives me a stable foundation for my OS’es.
I have never heard of NILFS2 but can try it in a VM tomorrow. That’s to say if Manjaro is capable of using it.


#5

i’m using f2fs since its out and before that NILFS and i have to say that NILFS was really slow compared to ext3-4 or f2fs when it comes to writing files. Like you have to copy many stuff from an extermal HDD to you internal it takes so much longer with NILFS. Dont know it this has changed in the last few years, but for SSD i’m really happy with f2fs.


#6

Were you using an automatic snapshot tool like snapper? Maybe you missed to set it up to delete old snapshots. This way you would run out of space.

@Tids, a quote from Wikipedia supports your experience

https://en.wikipedia.org/wiki/NILFS#Relative_Performance
If you’ve got a workload that’s latency sensitive, you might want to use NILFS. If you’ve got one that’s throughput sensitive, you might want to use F2FS. - Peter Chubb


#7

It’s a log-structured filesystem, using copy on write. It works like a diary where you start writing at the first page and continue towards the last. The result is that it is very easy to recover from a system crash, that you can undelete files easily and that there are no so called hot spots on SSD/flash-devices. There is also no fschk necessary at startup.

In addition it has CRC32 checksums for both, metadata and data, as a protection against silent data corruption (a feature missing in ext4 and XFS). Another feature is online partition resizing, which can be sometimes great.


#8

citing gparted, f2fs seems to have some serious downsides: it can’t be grown, it can not be shrunk, it can not be labelled and you can not set the UUID


#9

I used to use ReiserFS until Hans went over to the dark side…


#10

and grub still can not directly boot f2fs root filesystems. But thats nothing i care about. I dont want to resize my filesystem. I dont want to change my labels “HOME” for /home and “ROOT” for / are just perfect and also for the UUID i dont see a reason why i need to set them by myself. :stuck_out_tongue:

What i care about is a fast filesystem that is stable and SSD optimized.


#11

No, what I meant with that remark is that when you setup a partition, let’s say a 100G one, so much space was used already. The part of the partition you could use was maybe around 90G or so, or maybe even less. I can’t really remember how much was taken. With ext4 it was considerably less.
Well, what I read about both nilfs2 and f2fs here they both have disadvantages as well as advantages. I guess I just stick with ext4 for a while till something really better comes up.


#12

Did you execute a garbage collection? If not, the 100 GB are 90 GB of actual data and almost 10 GB of logged data, that can be undeleted or erased with a garbage collection.


#13

In case of manipulating the /etc/fstab and the /boot/grub/grub.cfg in order to restore a whole Linux installation on another disk or restoring a single partition, it is very handy to be able to set the UUID on you own.


#14

https://www.segfault.digital/it/general/filesystem-performance-ssd/


#15

Also NILFS2 is SSD optimized, just in another way than f2fs. nilfs2 is ways faster with smaller filles than f2fs. It is also considered more stable than f2fs.


#16

Here is an extended test of nilfs2, f2fs and ext4 on various flash cards done by Peter Chubb in 2015:
http://www.nicta.com.au/pub-download/slides/8311


#17

I mount my ext4 data partition with journal=checksum option, which provides at least checksumming for the journal.

As a long time Btrfs user, I cannot confirm that. Btrfs has been rock stable here, surviving multiple power drops.

This can possibly be tweaked with the right options to be set with mkfs.btrfs.
Space can also be freed by running btrfs balance (see btrfs wiki for more info), I run it 3 or 4 times a year.

As for NILFS2, I’ve never tried it, but isn’t it mostly optimised for UFS devices (like smartphones), like YaFFS?
I tried F2FS on a USB stick, couldn’t see any big advantage over ext4. USB 2 is slow regardless of the filesystem :slight_smile:


#18

That may be true. however back then nilfs was much slower for “everyday” usage compared to f2fs. I dont have only small or big files. Its always a mix. So when it comes to flashdriver (and there is no windows involved) I choose f2fs. Maybe in a few years, when i need a new set of SDD i’ll try nilfs again


#19

“Why don’t we use NILFS2 more often?”

Well, who uses it as the default FS right now–I mean what/whose distro?

It’s just not common practice and until at least one distro adopts it as the default–say, something major like Debian–it probably won’t go anywhere.

Gotta get somebody to jump on the bandwagon first. That’s how it goes in Linux. :wink:

Regards


#20

As SSDs are already very common now, NILFS2 should be definitely an option for root an home partitions on PCs. Red Hat, SuSE and Oracle are pushing XFS very much, but maybe XFS is more for big servers, as it was from the beginning designed particularly for that.
The snapshot functions of NILFS2 could be very useful as a basis for something like Apple Time Machine on macOS. Actually we need just a GUI frontend for NILFS2 and that’s it. For Thunar there is already a thunar-nilfs2-plugin, but as far as I could figure out, it shows only the available snapshots and does not offer any functionality to actually use them.