# How to using F2FS in EL9?

**URL:** <https://forums.rockylinux.org/t/how-to-using-f2fs-in-el9/18291>\
**Category:** Special Interest Groups\
**Created:** [April 30, 2025, 5:01am UTC](https://forums.rockylinux.org/t/how-to-using-f2fs-in-el9/18291 "2025-04-30T05:01:50Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![berlin](https://avatars.discourse-cdn.com/v4/letter/b/41988e/32.png) [@berlin](https://forums.rockylinux.org/u/berlin)\
**Post date:** [April 30, 2025, 5:01am UTC](https://forums.rockylinux.org/t/how-to-using-f2fs-in-el9/18291/1 "2025-04-30T05:01:50Z")

</div>

Any way to using f2fs inside rocky9?

I have a disk is f2fs, which works in centos7.  
However, after swich to rocky9, f2fs not surported any more

```auto
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:

```auto
# modprobe f2fs
modprobe: FATAL: Module f2fs not found in directory /lib/modules/5.14.0-503.38.1.el9_5.x86_64

```

---

<div class="post-metadata">

**Author:** ![jlehtone](https://avatars.discourse-cdn.com/v4/letter/j/e9a140/32.png) [@jlehtone](https://forums.rockylinux.org/u/jlehtone)\
**Post date:** [April 30, 2025, 7:24am UTC](https://forums.rockylinux.org/t/how-to-using-f2fs-in-el9/18291/2 "2025-04-30T07:24:14Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![berlin](https://avatars.discourse-cdn.com/v4/letter/b/41988e/32.png) [@berlin](https://forums.rockylinux.org/u/berlin)\
**Post date:** [April 30, 2025, 7:44am UTC](https://forums.rockylinux.org/t/how-to-using-f2fs-in-el9/18291/3 "2025-04-30T07:44:57Z")

</div>

Yes, just noticed that my centos7 uses kernel-ml.

Looks like I can only use elrepo’s kernel in el9.  
And just tested in EL10, the kernel is the same as EL9, which is not suport f2fs.

---

<div class="post-metadata">

**Author:** ![berlin](https://avatars.discourse-cdn.com/v4/letter/b/41988e/32.png) [@berlin](https://forums.rockylinux.org/u/berlin)\
**Post date:** [April 30, 2025, 7:55am UTC](https://forums.rockylinux.org/t/how-to-using-f2fs-in-el9/18291/4 "2025-04-30T07:55:16Z")

</div>

It would be nice if there was a way to manually add kernel modules into the official kernel. ( Just like adding a new NIC driver. )

---

<div class="post-metadata">

**Author:** ![jlehtone](https://avatars.discourse-cdn.com/v4/letter/j/e9a140/32.png) [@jlehtone](https://forums.rockylinux.org/u/jlehtone)\
**Post date:** [April 30, 2025, 8:25am UTC](https://forums.rockylinux.org/t/how-to-using-f2fs-in-el9/18291/5 "2025-04-30T08:25:30Z")

</div>

ELRepo, CentOS Kmods SIG, Rocky SIG/kernel, etc seem to be doing just that:  
build kernel modules and package them for easy ‘dnf install’.

The ‘dkms’ and ‘akmod’ tools seem able to rebuild, if needed, modules from “sources” when new kernel boots (or installs).

There clearly is a way.

* * *

How does one build one kernel module? I have no idea.

---

<div class="post-metadata">

**Author:** ![gerry666uk](https://avatars.discourse-cdn.com/v4/letter/g/dbc845/32.png) [@gerry666uk](https://forums.rockylinux.org/u/gerry666uk)\
**Post date:** [May 1, 2025, 12:58pm UTC](https://forums.rockylinux.org/t/how-to-using-f2fs-in-el9/18291/6 "2025-05-01T12:58:41Z")

</div>

> [@jlehtone](#):
>
> How does one build one kernel module? I have no idea.

The last entry in this forum post has an example

[https://forums.rockylinux.org/t/building-v4l-rpm-for-tbs-hardware/18014/10](https://forums.rockylinux.org/t/building-v4l-rpm-for-tbs-hardware/18014/10)

But even then, there’s still the issue of how to sign it.

---

<div class="post-metadata">

**Author:** ![berlin](https://avatars.discourse-cdn.com/v4/letter/b/41988e/32.png) [@berlin](https://forums.rockylinux.org/u/berlin)\
**Post date:** [May 2, 2025, 9:35am UTC](https://forums.rockylinux.org/t/how-to-using-f2fs-in-el9/18291/7 "2025-05-02T09:35:30Z")

</div>

I found a way to build and add mod, that is,

```auto
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:

```auto
[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'

```

---

<div class="post-metadata">

**Author:** ![berlin](https://avatars.discourse-cdn.com/v4/letter/b/41988e/32.png) [@berlin](https://forums.rockylinux.org/u/berlin)\
**Post date:** [May 2, 2025, 1:19pm UTC](https://forums.rockylinux.org/t/how-to-using-f2fs-in-el9/18291/8 "2025-05-02T13:19:26Z")

</div>

> [@berlin](#):
>
> Looks like I can only use elrepo’s kernel in el9.

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.

---

<div class="post-metadata">

**Author:** ![jlehtone](https://avatars.discourse-cdn.com/v4/letter/j/e9a140/32.png) [@jlehtone](https://forums.rockylinux.org/u/jlehtone)\
**Post date:** [May 2, 2025, 1:34pm UTC](https://forums.rockylinux.org/t/how-to-using-f2fs-in-el9/18291/9 "2025-05-02T13:34:30Z")

</div>

> [@berlin](#):
>
> I Have tested to install the elrepo `kernel-lt` or `kernel-ml`. Unfortunately, however, none of them support f2fs.

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?

---

<div class="post-metadata">

**Author:** ![iwalker](https://sea2.discourse-cdn.com/flex020/user_avatar/forums.rockylinux.org/iwalker/32/2599_2.png) [@iwalker](https://forums.rockylinux.org/u/iwalker)\
**Post date:** [May 2, 2025, 1:47pm UTC](https://forums.rockylinux.org/t/how-to-using-f2fs-in-el9/18291/10 "2025-05-02T13:47:59Z")

</div>

It’s definitely there:

```auto
root@zfs:~# modprobe f2fs

root@zfs:~# lsmod | grep f2fs
f2fs 823296 0
lz4hc_compress 24576 1 f2fs
lz4_compress 36864 1 f2fs
zstd_compress 299008 1 f2fs

root@zfs:~# cat /etc/rocky-release
Rocky Linux release 9.5 (Blue Onyx)

root@zfs:~# uname -r
6.1.135-1.el9.elrepo.x86_64

```

---

<div class="post-metadata">

**Author:** ![berlin](https://avatars.discourse-cdn.com/v4/letter/b/41988e/32.png) [@berlin](https://forums.rockylinux.org/u/berlin)\
**Post date:** [May 2, 2025, 2:06pm UTC](https://forums.rockylinux.org/t/how-to-using-f2fs-in-el9/18291/11 "2025-05-02T14:06:09Z")

</div>

I was not run the `modprobe`， it works now for elrepo-kernel.

---

<div class="post-metadata">

**Author:** ![berlin](https://avatars.discourse-cdn.com/v4/letter/b/41988e/32.png) [@berlin](https://forums.rockylinux.org/u/berlin)\
**Post date:** [May 2, 2025, 2:11pm UTC](https://forums.rockylinux.org/t/how-to-using-f2fs-in-el9/18291/12 "2025-05-02T14:11:01Z")

</div>

I still expect, however, to go with the approach of loading self-built mods in the official kernel.

> 1. elrepo not works with leapp, if want to update to EL10.
> 2. If one installed nvidia drivers firstly, may will be not able to install elrepo kernel

Any one have idea on the [err log of make modules](https://forums.rockylinux.org/t/how-to-using-f2fs-in-el9/18291/7)

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/rockylinux/original/1X/91b7219eec10e30013422e4df76c1d898711a5d5.svg) [@system](https://forums.rockylinux.org/u/system)\
**Post date:** [July 1, 2025, 2:11pm UTC](https://forums.rockylinux.org/t/how-to-using-f2fs-in-el9/18291/13 "2025-07-01T14:11:19Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
