The current major version of NILFS is version 2, which is referred to as NILFS2. NILFS2 is equipped with an online garbage collector (also called cleaner) that reclaims disk space in the background with keeping multiple snapshots.
When data is written or 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. A snapshot is the checkpoint marked not to be deleted by the cleaner. NILFS2 creates a number of checkpoints at regular intervals (unless there is no change) or with synchronous writings. There is no practical limit on the number of checkpoints and snapshots.
The following tools are available to manage the checkpoint and the snapshot:
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.
Every checkpoint except for the snapshot will become unprotected from the cleaner after a given period of time. This period is controlled by the protection_period parameter defined in the /etc/nilfs_cleanerd.conf(5) file.
CNO DATE TIME MODE FLG BLKCNT ICNT
1 2014-01-18 20:49:54 cp - 4 2
2 2014-01-18 20:51:45 cp - 3990 11
3 2014-01-18 20:51:45 cp - 6058 3
4 2014-01-18 20:51:49 cp - 4807 6
5 2014-01-18 20:51:49 cp - 262 3
...
CNO DATE TIME MODE FLG BLKCNT ICNT
1 2014-01-18 20:49:54 cp - 4 2
2 2014-01-18 20:51:45 ss - 3990 11
3 2014-01-18 20:51:45 cp - 6058 3
4 2014-01-18 20:51:49 cp - 4807 6
5 2014-01-18 20:51:49 cp - 262 3
...
# mount -t nilfs2
/dev/sdb1 on /nilfs type nilfs2 (rw,gcpid=13296)
/dev/sdb1 on /snapshot type nilfs2 (ro,cp=2)