NILFS

NILFS
Developer(s) Nippon Telegraph and Telephone Cyber Space Laboratories
Full name New Implementation of a Log-structured File System
Introduced 2005 with Linux kernel 2.6.13
Structures
File allocation B-tree
Limits
Max. volume size 8 EiB
Max. file size 8 EiB
Max. filename length 255 bytes
Other
Supported operating systems Linux kernel, (ReadOnly for NetBSD)

NILFS or NILFS2 (New Implementation of a Log-structured File System) is a log-structured file system implementation for the Linux kernel. It is being developed by Nippon Telegraph and Telephone Corporation (NTT) CyberSpace Laboratories and a community from all over the world. NILFS was released under the terms of the GNU General Public License (GPL).

Design

"NILFS is a log-structured filesystem, in that the storage medium is treated like a circular buffer and new blocks are always written to the end.[…]Log-structured filesystems are often used for flash media since they will naturally perform wear-leveling;[…]NILFS emphasizes snapshots. The log-structured approach is a specific form of copy-on-write behavior, so it naturally lends itself to the creation of filesystem snapshots. The NILFS developers talk about the creation of "continuous snapshots" which can be used to recover from user-initiated filesystem problems[…]."[1]

Using a copy-on-write technique known as "nothing in life is free", NILFS records all data in a continuous log-like format that is only appended to, never overwritten, an approach that is designed to reduce seek times, as well as minimize the kind of data loss that occurs after a crash with conventional file systems. For example, data loss occurs on ext3 file systems when the system crashes during a write operation. When the system reboots, the journal notes that the write did not complete, and any partial data writes are lost.

Some file systems, like UFS-derived file systems used by the Solaris operating system and BSDs, provide a snapshot feature that prevents such data loss, but the snapshot configuration can be lengthy on large file systems. NILFS, in contrast, can "continuously and automatically [save] instantaneous states of the file system without interrupting service", according to NTT Labs.[2]

The "instantaneous states" that NILFS continuously saves can actually be mounted, read-only, at the same time that the actual file system is mounted read-write — a capability useful for data recovery after hardware failures and other system crashes. The "lscp" (list checkpoint) command of an interactive NILFS "inspect" utility is first used to find the checkpoint's address, in this case "2048":

# inspect /dev/sda2
...
nilfs> listcp
   1     6 Tue Jul 12 14:55:57 2005 MajorCP|LogiBegin|LogiEnd
2048  2352 Tue Jul 12 14:55:58 2005 MajorCP|LogiEnd
...
nilfs> quit

The checkpoint address is then used to mount the checkpoint:

# mount -t nilfs -r -o cp=2048 /dev/sda2 /nilfs-cp
# df
Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/sda2             70332412   8044540  62283776  12% /nilfs
/dev/sda2             70332412   8044540  62283776  12% /nilfs-cp

Features

NILFS supports continuous snapshotting. In addition to versioning capability of the entire file system, users can even restore files mistakenly overwritten or destroyed just a few seconds ago. Since NILFS can keep consistency like conventional LFS, it achieves quick recovery after system crashes.

NILFS creates a number of checkpoints every few seconds or per synchronous write basis (unless there is no change). Users can select significant versions among continuously created checkpoints, and can change them into snapshots which will be preserved until they are changed back to checkpoints.

There is no limit on the number of snapshots until the volume gets full. Each snapshot is mountable as a read-only file system. It is mountable concurrently with a writable mount and other snapshots, and this feature is convenient to make consistent backups during use.

Snapshot administration is easy and quickly performable. NILFS will make snapshotting or versioning of the POSIX filesystem much familiar to you. The possible use of NILFS includes, versioning, tamper detection, SOX compliance logging, and so forth. It can serve as an alternative filesystem for Linux desktop environment, or as a basis of advanced storage appliances.

The current major version of NILFS is version 2, which is referred to as NILFS2. NILFS2 realized online garbage collection that reclaims disk space with keeping multiple snapshots.

Other NILFS features include:

Current Status

Supported Features

Additional features

OS Compatibility

Distribution Description
Debian NILFS is available in Debian 5.0 and later (lenny, squeeze, wheezy, and sid).
Ubuntu NILFS is available in Ubuntu 9.10 and later.
CentOS x86 and x86_64 for CentOS 5/6 are available on .
Fedora Building and installing nilfs-utils-2.1 is required in order to use NILFS in Fedora 14~16. For Fedora 15 and later, user also needs to build NILFS2 kernel module with explained steps.
openSUSE i586 and x86_64 for openSUSE and SUSE Linux Enterprise are available on openSUSE Build Service.
Gentoo NILFS is available in Gentoo Linux. A boot-cd with NILFS is available on PrRescue
Arch Linux NILFS is available in Arch Linux.
Linux Mint NILFS is available in Linux Mint.
NixOS NILFS is available in NixOS.

A separate, BSD licensed implementation, currently with read-only support, is included in NetBSD.[6]

Relative Performance

In the January 2015 presentation SD cards and filesystems for embedded systems at Linux.conf.au, it was stated:[7]

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
NILFS2 works much better for the lots of small files case than F2FS or EXT4.
Peter Chubb

License

The NILFS2 filesystem utilities are made available under the GNU Public License version 2, with the exception of the lib/nilfs libraries and their header files, which are made available under the GNU Lesser General Public License Version 2.1.

Developers

The Japanese primary authors and major contributors to the nilfs-utils who worked or are working at labs of NTT Corporation are:

Other major contributors are:

See also

References

This article is issued from Wikipedia. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.