I have a disk is f2fs, which works in centos7.
However, after swich to rocky9, f2fs not surported any more
mount: /mnt/nvme1: unknown filesystem type 'f2fs'.
I have tried to rpmbuild the ‘f2fs-tools’ from git clone https://src.fedoraproject.org/rpms/f2fs-tools.git, and installed the local builed f2fs-tools. however it is not work.
other testing:
# modprobe f2fs
modprobe: FATAL: Module f2fs not found in directory /lib/modules/5.14.0-503.38.1.el9_5.x86_64
The support for filesystems, “drivers”, is in kernel – most often as module. The f2fs-tools are mere userland tools that would talk to the kernel.
The kernel config for CentOS 7 did not set CONFIG_F2FS_FS. Therefore, CentOS 7 did not support f2fs “out of the box” either. You must have procured f2fs module for CentOS 7 somehow. How did you do that?
The ELRepo’s kernel-ml and kernel-lt upstream kernel builds for el9 seem to include the f2fs module.
dnf install kernel-devel
mkdir /root/mybuild
cd /root/mybuild
# download src
dnf download --source kernel
rpm2cpio kernel-5.14.0-503.40.1.el9_5.src.rpm | cpio -idmv
tar -xvf linux-5.14.0-503.40.1.el9_5.tar.xz
cd linux-5.14.0-503.40.1.el9_5
# make the module
make CONFIG_F2FS_FS=m -C /usr/src/kernels/5.14.0-503.40.1.el9_5.x86_64 M=/root/mybuild/linux-5.14.0-503.40.1.el9_5/fs/f2fs modules
# insert module: f2fs.ko
insmod ./fs/f2fs/f2fs.ko
# check supported filesystems
cat /proc/filesystems
However, the source-code may have some type of errors, the make is not finished fine, logs:
[root@host linux-5.14.0-503.40.1.el9_5]# make CONFIG_F2FS_FS=m -C /usr/src/kernels/5.14.0-503.40.1.el9_5.x86_64 M=/root/mybuild/linux-5.14.0-503.40.1.el9_5/fs/f2fs modules
make: Entering directory '/usr/src/kernels/5.14.0-503.40.1.el9_5.x86_64'
CC [M] /root/mybuild/linux-5.14.0-503.40.1.el9_5/fs/f2fs/dir.o
CC [M] /root/mybuild/linux-5.14.0-503.40.1.el9_5/fs/f2fs/file.o
CC [M] /root/mybuild/linux-5.14.0-503.40.1.el9_5/fs/f2fs/inode.o
/root/mybuild/linux-5.14.0-503.40.1.el9_5/fs/f2fs/inode.c: In function ‘f2fs_iget_retry’:
/root/mybuild/linux-5.14.0-503.40.1.el9_5/fs/f2fs/inode.c:565:25: error: implicit declaration of function ‘congestion_wait’ [-Werror=implicit-function-declaration]
565 | congestion_wait(BLK_RW_ASYNC, DEFAULT_IO_TIMEOUT);
| ^~~~~~~~~~~~~~~
/root/mybuild/linux-5.14.0-503.40.1.el9_5/fs/f2fs/inode.c:565:41: error: ‘BLK_RW_ASYNC’ undeclared (first use in this function)
565 | congestion_wait(BLK_RW_ASYNC, DEFAULT_IO_TIMEOUT);
| ^~~~~~~~~~~~
/root/mybuild/linux-5.14.0-503.40.1.el9_5/fs/f2fs/inode.c:565:41: note: each undeclared identifier is reported only once for each function it appears in
cc1: some warnings being treated as errors
make[1]: *** [scripts/Makefile.build:249: /root/mybuild/linux-5.14.0-503.40.1.el9_5/fs/f2fs/inode.o] Error 1
make: *** [Makefile:1944: /root/mybuild/linux-5.14.0-503.40.1.el9_5/fs/f2fs] Error 2
make: Leaving directory '/usr/src/kernels/5.14.0-503.40.1.el9_5.x86_64'
I Have tested to install the elrepo kernel-lt or kernel-ml. Unfortunately, however, none of them support f2fs. looks like I’ll have to build the mod, or kernel.
Really? The dnf --repo=elrepo-kernel provides */f2fs.ko\* claims that both of them have f2fs.ko.xz
Would it not load, was the support missing even with that module loaded, or what?