FAQ
-
How can I manually perform Garbage Collection (GC)?
If nilfs-clean command is provided by the nilfs-utils package installed in your PC, execute it:
# nilfs-clean [device]
This command will start one-pass GC.
-
The disk got full. I deleted files, but disk space is not freed.
Execute nilfs-clean command along with -p option:
# nilfs-clean -p 1s device
If nilfs-clean is not available, try remounting the filesystem with ``pp'' option:
# mount -t nilfs2 -o remount,pp=1 device mount-point
nilfs_cleanerd never deletes recent checkpoints whose elapsed time from its creation is smaller than ``protection period''. The above option shortens the protection period to one second and allows nilfs_cleanerd to reclaim checkpoints preserving the deleted files. (Note that snapshots are protected independently of the protection period).
The protection period is defined in /etc/nilfs_cleanerd.conf, in which the default value is set to one hour.
-
How can I turn off the garbage collector?
Use ``nogc'' mount option:
# mount -t nilfs2 -o nogc device mount-point
You can also disable it during use by remount:
# mount -t nilfs2 -o remount,nogc device mount-point
This kills nilfs_cleanerd process. To restart the GC process, you have only to remount the partition without the nogc option:
# mount -t nilfs2 -o remount device mount-point
-
Disk space usage using df command seems to count past data. How can I get the used amount of ``the current filesystem''?
lscp command of recent nilfs-utils packages has '-b' option which outputs block count of each checkpoint instead of its increment (NBLKINC). In the following example, the block count of the latest checkpoint is displayed in the ``BLKCNT'' field:
$ lscp -b -r -n 1 CNO DATE TIME MODE FLG BLKCNT ICNT 1863279 2012-03-18 17:07:34 cp - 5902745 669595However, this feature is not enabled by default due to compatibility reason. To get accurate values, you have to enable block_count feature at mkfs time:
$ mkfs -t nilfs2 -O block_count device
Note that old NILFS kernel modules not supporting this feature can only mount the block_count enabled partitions read-only.
-
Can I resize NILFS volumes ?
Yes, you can both enlarge and shrink NILFS volumes with nilfs-resize command. This feature is available on Linux 3.0 and later. Resizing for unmounted file systems are not supported at present.
For details, please see the man page of nilfs-resize(8).
-
How can I get/set/change label or UUID of NILFS volumes ?
Use nilfs-tune command. Please see the man page of nilfs-tune(8) for details.
-
What is the role of ".nilfs" file ? Is it deletable ?
The .nilfs file was used for locking between cleanerd and other NILFS utilities. This file is now obsolete, and you can delete it if you are using nilfs-utils 2.1 or later. mkfs.nilfs2 still creates this file to avoid troubles on older nilfs-utils environment.
The .nilfs is a regular file, and the kernel module of NILFS2 does not depend on this file.
-
cleanerd (or chcp/mkcp command) fails with an error: ``cannot open nilfs on /dev/xxx: Function not implemented''.
Confirm whether tmpfs (former shm fs) is mounted on /dev/shm. POSIX semaphores do not work if the filesystem on /dev/shm is wrong, which causes the above failure.
Some systems are using ramfs instead of tmpfs. You may need to change kernel configuration and rebuild kernel to enable tmpfs.
-
lscp or cleanerd fails with an error: ``inappropriate ioctl for device''.
NILFS has once changed ioctl interface to resolve 32-bit vs 64-bit compatibility issues before it got merged in the mainline kernel. Some tool packages included in Debian 5.0 (lenny) or Ubuntu 9.04 (Jaunty) / 8.10 (Intrepid) are older than the change, and they cause this error when used together with a newer NILFS.
Please use the latest nilfs-utils served on this site. (you will need to build and install it manually.)
-
mount fails with an error: ``mount.nilfs2: cannot find or load nilfs2 filesystem''.
This error typically occurs if the nilfs2 filesystem type is not registered in the system. Please confirm that the nilfs2 module is loaded using lsmod command. If it's not there, try insmod command to manually load the module, or invoke depmod to update module dependency files in a /lib/modules/kernel-version directory:
# lsmod | grep nilfs2 # insmod /path-to/nilfs2.ko
-
mount fails since /etc/mtab is a symlink to /proc/mounts:
# mount -t nilfs2 /dev/sdb1 /nilfs Please remount the partition with -f option after making /etc/mtab writable. nilfs_cleanerd not started # ls -la /etc/mtab lrwxrwxrwx. 1 root root 12 Aug 6 2011 /etc/mtab -> /proc/mounts
Try to build and install nilfs-utils from sources using libmount option:
$ cd nilfs-utils $ ./configure --enable-libmount $ make $ sudo make install
This may require libmount-devel package.
-
NILFS got stuck.
We appreciate if you get stack dump of suspended tasks by using the magic sysrq feature of kernel and send it to us.
# echo t > /proc/sysrq-trigger # dmesg
This feature may be turned off in your kernel. Please check CONFIG_MAGIC_SYSRQ kernel configuration if /proc/sysrq-trigger is missing.
-
How can I build NILFS ?
Check on the following kernel configurations.
kernel 2.6.32 and later:
# cd linux-2.6.x # make menuconfig General setup ---> [*] Prompt for development and/or incomplete code/drives File systems ---> <M> NILFS2 file system support (EXPERIMENTAL) Library routines ---> -*- CRC32 functionskernel 2.6.30 and 2.6.31:
# cd linux-2.6.x # make menuconfig General setup ---> [*] Prompt for development and/or incomplete code/drives File systems ---> [*] Miscellaneous filesystems ---> <M> NILFS2 file system support (EXPERIMENTAL) Library routines ---> -*- CRC32 functions -
Can I build NILFS in the tree of Linux kernel 2.6.29 or prior versions ?
With a patch offered by Oleg Volkov, you can build nilfs2 module package in Linux source tree. The procedures are as follows:
# cd /usr/src/ # wget http://www.nilfs.org/download/nilfs-2.0.12.tar.bz2 # wget http://www.nilfs.org/pub/patch/nilfs-in-tree-build.patch # tar -jxf nilfs-2.0.12.tar.bz2 # mv nilfs-2.0.12/fs linux/fs/nilfs # rm -rf nilfs-2.0.12 # cd linux # patch -p 1 < ../nilfs-in-tree-build.patch # make menuconfig File systems ---> <*> NILFS # make # make install
The patch is available from http://www.nilfs.org/pub/patch/nilfs-in-tree-build.patch. Thanks to Oleg Volkov for his contribution.
-
diff command does not report any difference between a file on the current file system and its past version on snapshot.
The diff program regards two directories (or files) as identical if both their block devices and inode numbers equal.
This optimization causes undesirable results like the above since the current state and snapshots of NILFS are mounted on the same block device. This is unavoidable under the current NILFS implementation.For reference, here is a workaround for the diff program. The patch modifies the diff program so that it regards two files (directories) as identical only if they have the same inode number and the same ctime.
