Difference between revisions of "F2FS"

From ArchWiki
Jump to: navigation, search
m (Install Arch Linux on F2FS partition: Aesthetic change, boot word highlighted.)
(added section on check/repair)
 
(34 intermediate revisions by 18 users not shown)
Line 1: Line 1:
 
[[Category:File systems]]
 
[[Category:File systems]]
[[it:F2fs]]
+
[[it:F2FS]]
[[ja:F2fs]]
+
[[ja:F2FS]]
 +
[[ko:F2FS]]
 +
[[ru:F2FS]]
 +
{{Related articles start}}
 +
{{Related|File systems}}
 +
{{Related articles end}}
 +
 
 
[[Wikipedia:F2FS|F2FS]] (Flash-Friendly File System) is a file system intended for NAND-based flash memory. It is supported from kernel 3.8 onwards.
 
[[Wikipedia:F2FS|F2FS]] (Flash-Friendly File System) is a file system intended for NAND-based flash memory. It is supported from kernel 3.8 onwards.
  
 
== Creating a F2FS partition ==
 
== Creating a F2FS partition ==
  
In order to create a F2FS partition, you need to [[pacman|install]] package {{Pkg|f2fs-tools}} from the [[official repositories]].
+
In order to create a F2FS partition, [[install]] {{Pkg|f2fs-tools}} from the [[official repositories]].
  
Create the partition:  
+
Create the partition:
  # mkfs.f2fs ''/dev/sdxY''
+
  # mkfs.f2fs -l mylabel ''/dev/sdxY''
where ''/dev/sdxY'' is the volume that you wish to format in F2FS.
+
where {{ic|''/dev/sdxY''}} is the target volume to format in F2FS.
  
 
== Mounting a F2FS partition ==
 
== Mounting a F2FS partition ==
  
You may need to load the F2FS kernel module before mounting. Issue as root:
+
The partition can then be mounted manually or via other mechanisms:
 +
 
 +
# mount /dev/sdxY /mnt/foo
 +
 
 +
== Install Arch Linux on F2FS partition ==
 +
 
 +
{{Warning|1=If using F2FS as your root partition, you will need to add the following module to the {{ic|MODULES}} line in your {{ic|/etc/mkinitcpio.conf}} file ({{Bug|49380}}):
 +
 
 +
{{bc|1=MODULES="... '''crypto-crc32'''"}}
 +
 
 +
To enable checksum hardware acceleration, you need to compile {{ic|crc32c-intel}} into kernel, or {{ic|crc32c-generic}} will be loaded first.
 +
}}
  
# modprobe f2fs
+
{{Warning|1=If using GRUB your freshly installed system might not boot after reboot. As GRUB doesn't support F2FS it isn't able to extract the UUID (which is persistent across reboots) of your drive so it uses classic {{ic|/dev/sdXx}} names instead (which are not guaranteed to be persistent across reboots). In this case you might have to manually edit {{ic|/boot/grub/grub.cfg}} and replace {{ic|1=root=/dev/sdXx}} with {{ic|1=root=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}}; you can use the {{ic|blkid}} command to get the UUID of your device.
 +
}}
  
Then you can mount the partition:
+
With the latest [https://www.archlinux.org/download/ installation media] it is possible to install Arch linux with root located on a F2FS filesystem:
  
# mount -t f2fs /dev/sdxY /mnt
+
# Create the root partition as F2FS as described in section [[#Creating a F2FS partition]].
 +
# If your [[bootloader]] does not support F2FS, create a separate {{ic|/boot}} partition using a filesystem that it does.
 +
# Continue with the installation procedure as per [[Installation guide#Mount the partitions]] until [[Change root|chrooted]].
 +
# Install {{Pkg|f2fs-tools}} on the newly installed system as well.
 +
# Regenerate the [[initramfs]] while chrooted.
  
== Install Arch Linux on F2FS partition ==
+
Be sure to also check out the [[Installing Arch Linux on a USB key]] page if you're installing Arch on a USB flash drive. (In particular the part about editing {{ic|/etc/mkinitcpio.conf}} is important, otherwise your system won't boot.)
  
With the latest installation media (2013.04.01) it is possible to install system on F2FS partition:
+
== Checking and repair ==
  
# Install {{Pkg|f2fs-tools}} from [[official repositories]] while running arch from installation media.
+
Checking and repairs to f2fs partitions are accomplished with {{ic|fsck.f2fs}} provided by {{pkg|f2fs-tools}}. See the manpage for available switches.
# Load {{ic|f2fs}} kernel module as [[F2fs#Mounting a F2FS partition|described]].
 
# Create root partition as F2FS as [[F2fs#Creating a F2FS partition|described]].
 
# Create {{ic|/boot}} partition as ext4 (or any other supported filesystem).
 
# Mount, install and chroot system as per [[Beginners'_Guide#Mount_the_partitions|official installation guide]].
 
# On installed system add {{ic|f2fs}} to modules section in {{ic|/etc/mkinitcpio.conf}} and remove {{ic|fsck}} from hooks section since F2FS does not have ''fsck'' implementation yet.
 
# Don't forget to regenerate the initramfs image after that:
 
::{{ic|# mkinitcpio -p linux}}
 

Latest revision as of 16:07, 30 March 2017

Related articles

F2FS (Flash-Friendly File System) is a file system intended for NAND-based flash memory. It is supported from kernel 3.8 onwards.

Creating a F2FS partition

In order to create a F2FS partition, install f2fs-tools from the official repositories.

Create the partition:

# mkfs.f2fs -l mylabel /dev/sdxY

where /dev/sdxY is the target volume to format in F2FS.

Mounting a F2FS partition

The partition can then be mounted manually or via other mechanisms:

# mount /dev/sdxY /mnt/foo

Install Arch Linux on F2FS partition

Warning: If using F2FS as your root partition, you will need to add the following module to the MODULES line in your /etc/mkinitcpio.conf file (FS#49380):
MODULES="... crypto-crc32"
To enable checksum hardware acceleration, you need to compile crc32c-intel into kernel, or crc32c-generic will be loaded first.
Warning: If using GRUB your freshly installed system might not boot after reboot. As GRUB doesn't support F2FS it isn't able to extract the UUID (which is persistent across reboots) of your drive so it uses classic /dev/sdXx names instead (which are not guaranteed to be persistent across reboots). In this case you might have to manually edit /boot/grub/grub.cfg and replace root=/dev/sdXx with root=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx; you can use the blkid command to get the UUID of your device.

With the latest installation media it is possible to install Arch linux with root located on a F2FS filesystem:

  1. Create the root partition as F2FS as described in section #Creating a F2FS partition.
  2. If your bootloader does not support F2FS, create a separate /boot partition using a filesystem that it does.
  3. Continue with the installation procedure as per Installation guide#Mount the partitions until chrooted.
  4. Install f2fs-tools on the newly installed system as well.
  5. Regenerate the initramfs while chrooted.

Be sure to also check out the Installing Arch Linux on a USB key page if you're installing Arch on a USB flash drive. (In particular the part about editing /etc/mkinitcpio.conf is important, otherwise your system won't boot.)

Checking and repair

Checking and repairs to f2fs partitions are accomplished with fsck.f2fs provided by f2fs-tools. See the manpage for available switches.