NILFS

from Wikipedia, the free encyclopedia
NILFS / NILFS2
Manufacturer Nippon Telegraph and Telephone Cyber ​​Space Laboratories
Full name New implementation of a log-structured file system
Initial release 2005, version 1.0.0 ( Linux 2.6.13)
Technical implementation
Directories B-tree
Maximum values
Size of a file 8 egg
properties
Supporting operating systems Linux
NetBSD (read only)

Nilfs or NILFS2 ( N ew I mplementation of a L og-structured F ile S ystem ) is a logging file system , which for Linux is implemented. It was developed in Japan by Nippon Telegraph and Telephone (NTT) Cyber ​​Space Laboratories and is under the GNU General Public License (GPL).

functionality

The image represents a NILFS2 partition that was full to the end point. After the garbage collector ran, the write process returned to the free space at the beginning of the partition, from where it will work its way back to the end of the partition.

NILFS differs from most of the other file systems commonly used today in that it is structured like a diary or log file . This means that the file system begins to write chronologically at the starting point of the partition and works its way through continuously to the end point.

In addition, NILFS is a copy-on-write file system. This means that if a file is changed, the new version is saved separately. The old version of the file remains on the hard drive and is only marked as obsolete in the metadata. Files that have been written once are not changed, but replaced by new versions, which are in turn written at the end of the occupied area. However, to increase efficiency, not the entire files are rewritten, only those blocks that have been changed.

Nothing at all is deleted for the time being. This can be kept until the writing process has reached the end of the partition and it is full. If this is the case, the garbage collector must be used, which deletes outdated versions of stored files. NILFS then begins again to write at the beginning of the partition, from there to work its way through to the end of the partition as usual. Conceptually, NILFS understands a partition as an endless circle ( digital ring buffer ).

The advantage of this functionality is that once written data is not lost as long as the medium (hard disk, SSD) is not damaged. Accidentally deleted files can easily be restored as long as they have not been permanently deleted by the garbage collector and cleared for overwriting.

Recovering from a system crash is also much easier than with other file systems because, like a diary that has been temporarily closed, you can simply continue writing from where it was last written.

In the case of simple flash memory without wear leveling (older SSDs, USB sticks, SD cards), this principle also has the great advantage that all areas of a partition are loaded equally. This means that there are no hotspots of memory areas that have been written to much more often than others and therefore fail much earlier than the rest of the memory.

properties

Plugin for the Thunar file manager, which shows the available snapshots of a home partition formatted with NILFS2.

NILFS supports continuous snapshots. In addition to versioning the entire file system, users can even restore files that were mistakenly overwritten or destroyed a few seconds ago. Since the NILFS can maintain the consistency of the file system like a conventional LFS, it can be quickly restored after system crashes.

NILFS creates a number of checkpoints every few seconds or per synchronous write base (unless there is no change). Users can select significant versions of continuously created checkpoints and change them into snapshots that are retained until they are changed back to checkpoints.

There is no limit to the number of snapshots until the volume is full. Each snapshot can be mounted as a read-only file system.

The current major version of NILFS is version 2, which is referred to as NILFS2. Online garbage collection has been implemented in NILFS2, which frees up disk space while retaining a certain number of snapshots.

Other NILFS functions are:

  • B-tree based file and inode management.
  • Instant recovery from system crashes.
  • 64-bit data structures; Supports many files, large files, and many hard drives.
  • 64-bit on-disk timestamp, so no year 2038 problem.
  • Kernel module that can be loaded; So there is no need to recompile the kernel.
  • CRC32 checksums of data and metadata as protection against silent data corruption.
  • Online partition shrinking, d. H. a NILFS partition can be shrunk if it is mounted.

Development team

The original development team included Yoshiji Amagai, Hisashi Hifumi, Ryusuke Konishi, Koji Sato, Seiji Kihara, and Satoshi Moriai.

See also

Web links