NILFS(8)
β¨ NILFS(8) β¨
okay bestie, pull up a chair, because we're talking about NILFS β the new implementation of a log-structured file system, straight outta the System Manager's Manual π
πΈ SYNOPSIS πΈ
This one's a lil different β it's not a command you run, it's the whole vibe tour of the NILFS file system and all the lil tools that hang out with it. π¦
π DESCRIPTION π
NILFS is a log-structured file system that was developed for Linux. And the way it ate?? It gives you versioning capability of an entire file system plus continuous snapshotting β which means you can literally go back and restore files you accidentally overwrote or destroyed a while ago. not me crying over a deleted essay, we don't do that anymore π
The current major version of NILFS is version 2, and we call it NILFS2. NILFS2 comes equipped with an online garbage collector (also called a cleaner) that reclaims disk space in the background while keeping multiple snapshots alive. multitasking queen behavior π
So here's the lore. Whenever data gets written, or literally any change is made to a NILFS2 file system, it automatically creates a checkpoint. A checkpoint represents a consistent state of the NILFS2 file system of a certain instant. It becomes mountable after being changed into a snapshot. And a snapshot is the checkpoint marked not to be deleted by the cleaner. NILFS2 creates a number of checkpoints at regular intervals (unless there's no change) or with synchronous writings. And the best part? There is no practical limit on the number of checkpoints and snapshots. infinite. iconic. periodt. β¨
These are the tools you get to manage your checkpoints and snapshots, bestie:
lscpβ lists checkpoints or snapshotsmkcpβ makes a checkpoint or a snapshotchcpβ changes an existing checkpoint to a snapshot or vice versarmcpβ invalidates specified checkpoint(s)
These tools give the versioning capability to NILFS2; a user can select significant versions among continuously created checkpoints and can change them to snapshots to be preserved for long periods. it's giving time traveler energy fr fr π§
Heads up! Every checkpoint except for the snapshot will become unprotected from the cleaner after a given period of time. That period is controlled by theprotection_periodparameter defined in the/etc/nilfs_cleanerd.conf(5)file. so like, protect your faves or they're gone π
π MOUNT OPTIONS π
Refer to the mount.nilfs2(8). (yes that's the whole section, go read the other page, iykyk π«Ά)
π EXAMPLES π
okay this is the fun part, let's actually do stuff π
mkfs -t nilfs2 /dev/sdb1β creates a NILFS2 file system on a block device/dev/sdb1.mount -t nilfs2 /dev/sdb1 /nilfsβ mounts the NILFS2 file system on a mount point/nilfslike an ordinary POSIX file system. This will invoke a cleaner processnilfs_cleanerd(8)through an external mount program (i.e.mount.nilfs2(8)).lscpβ lists checkpoints created in the file system, like so:
CNO DATE TIME MODE FLG BLKCNT ICNT
1 2024-03-16 23:49:26 cp - 4 1
2 2024-03-16 23:49:44 cp - 4 1
3 2024-03-16 23:50:55 cp - 3208 625
4 2024-03-16 23:51:18 cp - 2207 506
5 2024-03-16 23:51:23 cp - 2204 503
...
chcp ss 2β changes the checkpoint whose checkpoint-number is two to a snapshot. Then the checkpoint list will become as follows:
CNO DATE TIME MODE FLG BLKCNT ICNT
1 2024-03-16 23:49:26 cp - 4 1
2 2024-03-16 23:49:44 ss - 4 1
3 2024-03-16 23:50:55 cp - 3208 625
4 2024-03-16 23:51:18 cp - 2207 506
5 2024-03-16 23:51:23 cp - 2204 503
...
mount -t nilfs2 -r -o cp=2 /dev/sdb1 /snapshotβ mounts the snapshot on another directory/snapshotas a read-only file system. Here the snapshot mount requires at least two options: a read-only option (-ror-o ro) and thecpoption (-o cp=checkpoint-number). Note that a read/write mount and one or more snapshots are mountable independently, so the online backup is possible through the snapshot mounts. no cap, that's the whole trick π
# mount -t nilfs2
/dev/sdb1 on /nilfs type nilfs2 (rw,relatime)
/dev/sdb1 on /snapshot type nilfs2 (ro,relatime,cp=2)
umount /nilfsβ unmounts the NILFS2 file system mounted on/nilfsand will shut down thenilfs_cleanerd(8)through an external umount program (umount.nilfs2(8)) for the read/write mount.
π AUTHORS π
NILFS2 was developed by the NILFS development team. absolute legends, we stan π«Ά
π SEE ALSO π
mkfs.nilfs2(8)mount.nilfs2(8)umount.nilfs2(8)nilfs_cleanerd(8)nilfs_cleanerd.conf(5)nilfs-tune(8)nilfs-clean(8)nilfs-resize(8)lscp(1)mkcp(8)chcp(8)rmcp(8)lssu(1)dumpseg(8)
okay that's the whole page bestie, go forth and snapshot responsibly πΈπ this was nilfs-utils version 2.3, dated Jan 2026 β mwah, love u, bye!! β¨π¦
π¦ where this page comes from
- alpine 3.24: nilfs-utils-doc 2.3.0-r0 Β· GPL-2.0-or-later
- arch rolling: nilfs-utils 2.3.1-1 Β· GPL-2.0-or-later AND LGPL-2.1-or-later
- nixpkgs unstable: nilfs-utils 2.3.1
- Copyright (C) 2005-2012 Nippon Telegraph and Telephone Corporation
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms