26.2 Linux File Systems
FreeBSD provides native support for some Linux file systems. This section demonstrates how to load and mount these supported Linux file systems.
EXT Series File Systems
Since FreeBSD 2.2, the kernel has supported the ext2 file system from the Extended File System (EXT) series. FreeBSD 9.0 merged important allocation code from NetBSD's clean-room implementation, making the ext2fs driver BSD-licensed. Starting from FreeBSD 12.0-RELEASE, the ext2fs driver natively supports mounting ext4 file systems in read-write mode, but does not support journaling and encryption features.
Warning
Since FreeBSD's ext2fs driver does not support ext4 journaling, mounting ext4 file systems in read-write mode may result in data corruption or metadata inconsistency in the event of unexpected power loss, system crash, or improper shutdown. In severe cases, the file system may become unmountable. Do not perform write operations on ext4 volumes containing critical data, or ensure the device is connected to a UPS or other power loss protection.
Formatting a Disk as Ext4 File System
The Port filesystems/e2fsprogs must be installed separately; it provides the mke2fs tool for formatting disks to ext format.
Create a GPT partition table
# gpart create -s gpt ada0Create a partition containing all remaining space
# gpart add -t linux-data ada0Format as Ext4
# mke2fs -t ext4 /dev/ada0p1Verify the file system used by the /dev/ada0p1 partition:
# fstyp /dev/ada0p1
ext2fsTest Mounting an Ext4 File System
Create the mount directory /home/ykla/test:
Adjust according to the actual path; the same applies below.
Mount partition /dev/ada0p1 to /home/ykla/test:
Verify the mount status
Try reading and writing some files:
Btrfs and XFS File Systems
fusefs-lkl is a FUSE implementation based on the Linux Kernel Library (LKL). By running Linux kernel code in user space, it provides complete support for Btrfs, XFS, and other Linux file systems. Compared to fusefs-ext2, fusefs-lkl supports a wider range of file system types but with slightly lower performance.
For ease of demonstrating mount operations, this section assumes an example environment containing multiple Linux file system partitions for verifying each mount method.
Display partition information for the nda1 device:
The -p parameter displays full device paths.
The example partitions are pre-configured with files and directories for subsequent mount verification.
The relevant directory structure is as follows:
Installing fusefs-lkl
Install using pkg:
Or install using Ports:
Loading the FUSE Kernel Module
fusefs is the FUSE framework kernel module for FreeBSD, providing underlying support for all FUSE-based file systems. Run the following command to add it to the system startup load list:
The above command makes the configuration persistent. To apply it immediately, run:
Test Mounting a Btrfs Partition
Use lklfuse to mount the Btrfs partition nda1p2 to /home/ykla/btrfs:
Test Mounting an XFS Partition
Use lklfuse to mount the XFS partition nda1p4 to /home/ykla/xfs:
Troubleshooting and Outstanding Issues
Unmounting File Systems
Use the umount command to unmount file systems. Before unmounting, ensure that no processes are accessing the mount point; otherwise, the unmount will fail. If the mount point is busy, use umount -f to force unmount (which may cause undefined behavior in applications accessing the file system). The basic syntax is:
Persistent Mount Configuration
Persistent mounting can be configured by writing entries to the /etc/fstab file. For FUSE file systems, pay attention to mount parameters and the delayed mount option late — late ensures the file system is mounted only after the system has finished booting, preventing boot failures caused by FUSE dependencies not being ready.
References
FreeBSD Forums. mount linux ext4 drives on Freebsd[EB/OL]. (2020-03-10)[2026-03-25]. https://forums.freebsd.org/threads/mount-linux-ext4-drives-on-freebsd.74414/. FreeBSD forum discussion detailing the practice of mounting EXT4 file systems on FreeBSD using fusefs-ext2.
FreeBSD Forums. XFS support[EB/OL]. [2026-03-25]. https://forums.freebsd.org/threads/xfs-support.61449/. FreeBSD forum discussion on XFS support, exploring XFS file system compatibility and mounting methods on FreeBSD.
FreeBSD Project. fusefs -- Filesystem in Userspace[EB/OL]. [2026-04-14]. https://man.freebsd.org/cgi/man.cgi?query=fusefs&sektion=4. FUSE kernel interface manual page, describing the user-space file system framework.
FreeBSD Project. ext2fs -- ext2/ext3/ext4 file system[EB/OL]. [2026-04-14]. https://man.freebsd.org/cgi/man.cgi?query=ext2fs&sektion=4. ext2/ext3/ext4 file system manual page, describing Linux file system mounting support on FreeBSD.
FreeBSD Project. mount -- mount file systems[EB/OL]. [2026-04-14]. https://man.freebsd.org/cgi/man.cgi?query=mount&sektion=8. File system mount command manual page.
FreeBSD Project. fstab -- static information about the filesystems[EB/OL]. [2026-04-14]. https://man.freebsd.org/cgi/man.cgi?query=fstab&sektion=5. File system table configuration file format manual page.
Last updated