F2FS

From Gentoo Wiki
Jump to: navigation, search
This page contains changes which are not marked for translation.


F2FS is available in Linux kernels 3.8.x and higher. Its specialty is NAND flash devices. This filesystem is a good choice when installing Gentoo on an SD card or a flash-based USB device.

Installation

Kernel

When enabling support to the filesystem in the Linux kernel, it is wise to enable at least the first four options in order to support extended filesystem attributes:

  • CONFIG_F2FS_FS
  • F2FS_FS_XATTR
  • CONFIG_F2FS_FS_POSIX_ACL
  • CONFIG_F2FS_FS_SECURITY

The fifth option in the list will enable F2FS's filesystem consistency checking. The checking will occur during run time and will decrease the filesystem's performance. This option provides an advantage when consistency is more important than speed.

The sixth, and final option, is encryption. If encryption is in the use case, then this option should be enabled as well. It does not hurt to enable this option even if encryption will not be used right away.

KERNEL Enabling basic f2fs filesystem options
File systems  --->
   <*> F2FS filesystem support
   [*]   F2FS extended attributes
   [*]     F2FS Access Control Lists
   [*]     F2FS Security Labels
   [ ]   F2FS consistency checking feature
   [ ]   F2FS Encryption

Emerge

Install the user space tools for the f2fs filesystem:

root #emerge --ask sys-fs/f2fs-tools

Usage

Creation

After emerging the userspace tools, create a filesystem by running the mkfs.f2fs command followed by the appropriate device and partition number:

root #mkfs.f2fs /dev/sdd1

Filesystem check

root #fsck.f2fs /dev/sdd1

Defragmentation

root #defrag.f2fs

See also

  • JFFS2 - Journalling Flash File System version 2.
  • ext4 - The default filesystem for most Linux distributions.
  • Btrfs - A copy-on-write B-tree filesystem with advanced features (an entirely open source licensed ZFS alternative).
  • SquashFS - A compressed, read-only file system for Linux.

External resoruces