8

How to change the filesystem label and UUID of a F2FS filesystem?

For EXT filesystems tune2fs from e2fsprogs has the -L new_label and -U uuid command-line options, but none of the utilities installed by f2fs-tools 1.13.0 (latest version at the moment of writing) seem to have similar functionality.

jotik
  • 183
  • 5
  • *... use case is to migrate the data on a f2fs formatted microSD card used in Android to another (larger) microSD card, while making Android think nothing has changed (so that all installations, mount points, configs, ... keep the same).* – Golar Ramblar Jul 04 '22 at 09:28

2 Answers2

4

This answers the first part of the question: filesystem label.

A utility called f2fslabel has been released since f2fs-tools version 1.15 that allows setting a new label on an existing f2fs filesystem.

Check docs:

man f2fslabel

You can use the utility on the unmounted partition. Only adjust your device path and label string. If you don't provide an optional label argument, it will simply show the current label.

sudo f2fslabel /dev/nvme1n1p1 "SSD Storage"
BlueManCZ
  • 1,693
  • 12
  • 31
Uzi
  • 56
  • 2
1

I couldn't find any tool to do this, but I managed to change it with the help of a hex-editor, search for the UUID at the beginning of a partition: f2fs change UUID

PF4Public
  • 135
  • 11
  • Some systems don't install f2fslabel - but you will probably still have it, since it's actually just a softlink to fsck.f2fs. – Kurt Fitzner Jun 28 '23 at 19:23