F2FS

From Gentoo Wiki
Jump to: navigation, search
This page is a translated version of the page F2FS and the translation is 67% complete.

Outdated translations are marked like this.
Other languages:
English • ‎中文(中国大陆)‎

F2FS (Flash-Friendly File System) 是一个为基于 NAND 闪存设备设计的文件系统。 它可在 Linux 内核 3.8.x 以及更高版本使用。当在 eMMC, SSD, NVMe, SDCard, 或者基于闪存的 USB 设备安装 Gentoo时,此文件系统是一个好的选择。

安装

内核

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 Status Information
   [*]   F2FS extended attributes
   [*]     F2FS Access Control Lists
   [*]     F2FS Security Labels
   [ ]   F2FS consistency checking feature
   [ ]   F2FS Encryption
   [ ]   F2FS fault injection facility

Emerge

Install the userspace tools for the F2FS filesystem:

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

使用

创建

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

检查文件系统

root #fsck.f2fs /dev/sdd1

碎片整理

root #defrag.f2fs

Troubleshooting

When using f2fs as rootfs fsck fails on boot. Solutions are either disabling fsck in /etc/fstab (setting the last number to 0) or enabling the force-flag for fsck in /etc/conf.d/fsck. See bug #671786.

参考

  • Ext4/zh-cn — 一个开源的磁盘文件系统并且是扩展系列文件系统的最新版本。
  • Btrfs/zh-cn — 一个写入时复制(CoW) 的 Linux 文件系统 ,旨在实现高级功能的同时专注于容错、修复和易于管理。
  • SquashFS — an open source, read only, extremely compressible filesystem.

外部资源