Difference between revisions of "F2FS"

From ArchWiki
Jump to: navigation, search
m (Install Arch Linux on F2FS partition: Aesthetic change, boot word highlighted.)
(F2FS is a file system not a partition)
 
(50 intermediate revisions by 23 users not shown)
Line 1: Line 1:
 
[[Category:File systems]]
 
[[Category:File systems]]
[[it:F2fs]]
+
[[it:F2FS]]
[[ja:F2fs]]
+
[[ja:F2FS]]
[[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.
+
[[ko:F2FS]]
 +
[[ru:F2FS]]
 +
[[zh-hans:F2FS]]
 +
{{Related articles start}}
 +
{{Related|File systems}}
 +
{{Related articles end}}
  
== Creating a F2FS partition ==
+
[[Wikipedia:F2FS|F2FS]] (Flash-Friendly File System) is a file system intended for NAND-based flash memory equipped with Flash Transition Layer. Unlike JFFS or UBIFS it relies on FTL to handle write distribution. It is supported from kernel 3.8 onwards.
  
In order to create a F2FS partition, you need to [[pacman|install]] package {{Pkg|f2fs-tools}} from the [[official repositories]].
+
== Creating a F2FS file system ==
  
Create the partition:
+
In order to create a F2FS file system, [[install]] {{Pkg|f2fs-tools}}.
# mkfs.f2fs ''/dev/sdxY''
 
where ''/dev/sdxY'' is the volume that you wish to format in F2FS.
 
  
== Mounting a F2FS partition ==
+
Create the file system:
  
You may need to load the F2FS kernel module before mounting. Issue as root:
+
# mkfs.f2fs -l mylabel ''/dev/sdxY''
  
# modprobe f2fs
+
where {{ic|''/dev/sdxY''}} is the target volume to format in F2FS. See {{man|8|mkfs.f2fs}} for all available options.
  
Then you can mount the partition:
+
== Mounting a F2FS file system ==
  
# mount -t f2fs /dev/sdxY /mnt
+
The file system can then be mounted manually or via other mechanisms:
  
== Install Arch Linux on F2FS partition ==
+
# mount /dev/sdxY /mnt/foo
  
With the latest installation media (2013.04.01) it is possible to install system on F2FS partition:
+
== Grow an F2FS file system ==
  
# Install {{Pkg|f2fs-tools}} from [[official repositories]] while running arch from installation media.
+
When the filesystem is unmounted, it can be grown if the partition is expanded. [https://www.mail-archive.com/linux-f2fs-devel@lists.sourceforge.net/msg04247.html Shrinking is not currently supported].
# Load {{ic|f2fs}} kernel module as [[F2fs#Mounting a F2FS partition|described]].
+
 
# Create root partition as F2FS as [[F2fs#Creating a F2FS partition|described]].
+
First use a [[Partitioning#Partitioning_tools|partition tool]] to resize the partition. This can be done, for example, by deleting the old partition and creating a new one with with the same type, the same start sector, and a new end position.
# 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]].
+
Then expand the filesystem to fill the new partition using:
# 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:
+
# resize.f2fs /dev/sdxY
::{{ic|# mkinitcpio -p linux}}
+
 
 +
where {{ic|''/dev/sdxY''}} is the target F2FS volume to grow. See {{man|8|resize.f2fs}} for supported options.
 +
 
 +
{{Note|If you're using GPT, the partition's GUID (seen in {{ic|/dev/disk/by-partuuid/}}) might change, but the filesystem UUID (seen in {{ic|/dev/disk/by-uuid/}}) should stay the same.}}
 +
 
 +
== Checking and repair ==
 +
 
 +
Checking and repairs to f2fs file systems are accomplished with {{ic|fsck.f2fs}} provided by {{pkg|f2fs-tools}}. See {{man|8|fsck.f2fs}} for available switches.
 +
 
 +
== Troubleshooting ==
 +
 
 +
=== GRUB with root on F2FS ===
 +
 
 +
When using [[GRUB]] your freshly installed system might not boot after reboot. As GRUB does not support F2FS it is not able to extract the [[UUID]] of your drive so it uses classic non-persistent {{ic|/dev/''sdXx''}} names instead. 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, see [[Persistent block device naming]].

Latest revision as of 07:43, 18 April 2018

F2FS (Flash-Friendly File System) is a file system intended for NAND-based flash memory equipped with Flash Transition Layer. Unlike JFFS or UBIFS it relies on FTL to handle write distribution. It is supported from kernel 3.8 onwards.

Creating a F2FS file system

In order to create a F2FS file system, install f2fs-tools.

Create the file system:

# mkfs.f2fs -l mylabel /dev/sdxY

where /dev/sdxY is the target volume to format in F2FS. See mkfs.f2fs(8) for all available options.

Mounting a F2FS file system

The file system can then be mounted manually or via other mechanisms:

# mount /dev/sdxY /mnt/foo

Grow an F2FS file system

When the filesystem is unmounted, it can be grown if the partition is expanded. Shrinking is not currently supported.

First use a partition tool to resize the partition. This can be done, for example, by deleting the old partition and creating a new one with with the same type, the same start sector, and a new end position.

Then expand the filesystem to fill the new partition using:

# resize.f2fs /dev/sdxY

where /dev/sdxY is the target F2FS volume to grow. See resize.f2fs(8) for supported options.

Note: If you're using GPT, the partition's GUID (seen in /dev/disk/by-partuuid/) might change, but the filesystem UUID (seen in /dev/disk/by-uuid/) should stay the same.

Checking and repair

Checking and repairs to f2fs file systems are accomplished with fsck.f2fs provided by f2fs-tools. See fsck.f2fs(8) for available switches.

Troubleshooting

GRUB with root on F2FS

When using GRUB your freshly installed system might not boot after reboot. As GRUB does not support F2FS it is not able to extract the UUID of your drive so it uses classic non-persistent /dev/sdXx names instead. 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, see Persistent block device naming.