Written by Alex Taylor | 11/17/2023

FUSE (Filesystem in Userspace)

Filesystem in Userspace (FUSE) is an advanced piece of software mechanism that allows non-privileged users to create their own file systems without editing kernel code. This is achieved by running the file system code in user space while the FUSE module provides only a "bridge" to the actual kernel interfaces. FUSE is particularly useful for writing virtual file systems. Unlike traditional file systems that manage actual data on disk, virtual file systems manage data that is not necessarily tied to a disk, like network file systems or file systems that exist entirely in memory.

FUSE consists of two main components:

  1. The FUSE kernel module: This exists within the Linux kernel and provides a generic interface that user-space file systems can interact with. It ensures that the user-space file system is fully integrated with the system's VFS (Virtual File System), making it accessible to all applications without modification.

  2. The libfuse library: This user-space library provides a development framework that handles the communication between the user-space file system and the FUSE kernel module. It abstracts the complexity of the kernel interactions and provides a simple API for developing custom file systems in user space.

The general workflow of FUSE is straightforward:

  • When a user runs a file system operation (like reading from a file), the request goes to the VFS.
  • The VFS then forwards this request to the FUSE kernel module.
  • The FUSE kernel module sends the request to the user-space file system daemon associated with the specific mount point.
  • The user-space daemon processes the request and returns the result back to the kernel module.
  • Finally, the FUSE kernel module passes the result back to the VFS, which then returns it to the user's application.

To set up a FUSE file system, a user would:

  • Install the libfuse library and possibly additional development packages.
  • Write or compile a file system daemon that uses libfuse to handle operations.
  • Mount the file system using the fusermount command, which communicates with the FUSE kernel module to establish the file system in the user space.

The beauty of FUSE is its simplicity and versatility. It can be used to easily mount remote file systems, for example, through SSH by using sshfs, or integrate cloud storage services directly into the local file system hierarchy. The flexibility of FUSE extends to file systems that can do on-the-fly encryption, compression, and transformation of data.

FUSE's architecture provides several benefits:

  • Safety: Since file systems run in user space, they can't crash the kernel, making the development of file systems less risky.
  • Simplicity: Writing a file system in user space is significantly easier than kernel programming. With FUSE, developers can use any programming language and don't need to understand the kernel's internals.
  • Portability: FUSE file systems can be developed and run on different operating systems with minimal changes.

However, FUSE is not without its drawbacks. Performance is often lower than that of kernel file systems because of the context switches between user space and kernel space and the overhead of message passing. Moreover, a poorly implemented FUSE file system can become a bottleneck if it does not efficiently handle I/O operations or manage resources well.

Despite these limitations, FUSE remains a popular choice for developing experimental and specialized file systems, especially where development speed, safety, and simplicity are more critical than raw performance.

FUSE supports these and other drivers:

  • Linear Tape File System (LTFS): Allows files to be stored on magnetic tape and accessed in a similar fashion to those on disk or removable flash drives.
  • NTFS-3G: An open-source implementation of Microsoft NTFS that allows read-write access to NTFS partitions.
  • Captive NTFS: Allows read and write access to NTFS volumes by using the Windows NTFS driver through Wine.
  • retro-fuse: A FUSE module designed to allow access to retro computing file systems.
  • EncFS: An encrypted file system that runs in user space, using FUSE to provide transparent encryption.
  • FuseCompress: Provides a mountable Linux file system which transparently compresses its content.
  • gzipfs: Uses FUSE to create a file system which transparently compresses its files using gzip.
  • Fuse-ZIP: A FUSE file system to navigate, extract, create, and modify ZIP archives.
  • CompFUSEd: A FUSE-based file system with automatic in-line compression of files.
  • archivemount: A FUSE-based file system for Unix variants, which mounts an archive file as a file system.
  • Atlas: A scalable and efficient scheme for content distribution.
  • Borg (backup software): Deduplicating archiver with compression and encryption that offers a secure and efficient backup system.
  • Restic: A fast, secure, and efficient backup program that supports various backends.
  • SPFS: Spectrum Protect File System, a backup/archive file system based on IBM Spectrum Protect.
  • CernVM-FS: A network file system based on HTTP and optimized for software distribution.
  • CloudStore: A distributed file system that provides high performance and scalability.
  • ExpanDrive: Network file system client for Mac OS X and Windows that facilitates mapping of local volume to many different types of Cloud Storage.
  • FTPFS: A client for the FTP protocol that mounts remote FTP servers as local file systems.
  • GlusterFS: A scalable network file system suitable for data-intensive tasks such as cloud storage and media streaming.
  • goofys: A high-performance, POSIX-ish Amazon S3 file system written in Go.
  • google-drive-ocaml: A FUSE file system backed by Google Drive, written in OCaml.
  • IPFS: The InterPlanetary File System, a peer-to-peer distributed file system that connects all computing devices with the same system of files.
  • JuiceFS: A distributed file system optimized for cloud-native environments.
  • KBF: A FUSE-based file system that provides access to the KBFS (Keybase File System).
  • Lustre Cluster filesystem: A high-performance distributed file system for large-scale cluster computing.
  • MinFS: A minimalist file system written in Go, designed for Amazon S3-compatible object storage.
  • MooseFS: A fault-tolerant, network distributed file system.
  • Nexfs: A file system focused on data integrity, scalability, and disaster recovery.
  • ObjectiveFS: A secure, scalable, and shared file system for macOS and Linux.
  • Rclone: A command-line program to sync files and directories to and from various cloud storage providers.
  • s3fs: Allows Linux and macOS to mount an S3 bucket as a local file system.
  • Sector File System: A high-performance, secure, and scalable distributed file system designed for large-scale data storage.
  • SSHFS: A file system client based on the SSH File Transfer Protocol.
  • Transmit: A highly flexible and intuitive file transfer client for macOS.
  • WebDrive: Software that allows you to open and edit files on remote servers or cloud storage through a drive letter.
  • WikipediaFS: A virtual file system for accessing the content of Wikipedia articles as if they were real files.
  • Wuala: A secure cloud storage service that uses encryption to protect users' data.
  • IndexFS: A scalable file system with indexing features to improve the performance of metadata operations.
  • GVfs: GNOME's userspace virtual file system designed to work with the I/O abstraction of GIO.
  • rvault: A command-line tool that secures files in a vault with a transparent encryption layer.