Filesystem in Userspace

Last updated
Filesystem in Userspace
Stable release
3.16.2 [1]   OOjs UI icon edit-ltr-progressive.svg / 10 October 2023;3 months ago (10 October 2023)
Repository
Written in C
Operating system Unix, Unix-like
Type File system driver
License GPL for Linux kernel part, LGPL for Libfuse, Simplified BSD on FreeBSD, ISC license on OpenBSD; proprietary for macOS
Website github.com/libfuse/libfuse

Filesystem in Userspace (FUSE) is a software interface for Unix and Unix-like computer operating systems that lets non-privileged users create their own file systems without editing kernel code. This is achieved by running file system code in user space while the FUSE module provides only a bridge to the actual kernel interfaces.

Contents

FUSE is available for Linux, FreeBSD, OpenBSD, NetBSD (as puffs), OpenSolaris, Minix 3, macOS, [2] and Windows. [3]

FUSE is free software originally released under the terms of the GNU General Public License and the GNU Lesser General Public License.

History

The FUSE system was originally part of AVFS (A Virtual Filesystem), a filesystem implementation heavily influenced by the translator concept of the GNU Hurd. [4] It superseded Linux Userland Filesystem, and provided a translational interface using lufis in libfuse1.

FUSE was originally released under the terms of the GNU General Public License and the GNU Lesser General Public License, later also reimplemented as part of the FreeBSD base system [5] and released under the terms of Simplified BSD license. An ISC-licensed re-implementation by Sylvestre Gallon was released in March 2013, [6] and incorporated into OpenBSD in June 2013. [7]

FUSE was merged into the mainstream Linux kernel tree in kernel version 2.6.14. [8]

The userspace side of FUSE, the libfuse library, generally followed the pace of Linux kernel development while maintaining "best effort" compatibility with BSD descendants. This is possible because the kernel FUSE reports its own "feature levels", or versions. The exception is the FUSE fork for macOS, OSXFUSE, which has too many differences for sharing a library. [9] A break in libfuse history is libfuse3, which includes some incompatible improvements in the interface and performance, compared to the older libfuse2 now under maintenance mode. [10]

As the kernel-userspace protocol of FUSE is versioned and public, a programmer can choose to use a different piece of code in place of libfuse and still communicate with the kernel's FUSE facilities. On the other hand, libfuse and its many ports provide a portable high-level interface that may be implemented on a system without a "FUSE" facility.

Operation and usage

A flow-chart diagram showing how FUSE works: Request from userspace to list files (ls -l /tmp/fuse) gets redirected by the Kernel through VFS to FUSE. FUSE then executes the registered handler program (./hello) and passes it the request (ls -l /tmp/fuse). The handler program returns a response back to FUSE which is then redirected to the userspace program that originally made the request. FUSE structure.svg
A flow-chart diagram showing how FUSE works: Request from userspace to list files (ls -l /tmp/fuse) gets redirected by the Kernel through VFS to FUSE. FUSE then executes the registered handler program (./hello) and passes it the request (ls -l /tmp/fuse). The handler program returns a response back to FUSE which is then redirected to the userspace program that originally made the request.

To implement a new file system, a handler program linked to the supplied libfuse library needs to be written. The main purpose of this program is to specify how the file system is to respond to read/write/stat requests. The program is also used to mount the new file system. At the time the file system is mounted, the handler is registered with the kernel. If a user now issues read/write/stat requests for this newly mounted file system, the kernel forwards these IO-requests to the handler and then sends the handler's response back to the user.

Unmounting a FUSE-based file system with the fusermount command Unmount SSHFS.png
Unmounting a FUSE-based file system with the fusermount command

FUSE is particularly useful for writing virtual file systems. Unlike traditional file systems that essentially work with data on mass storage, virtual filesystems don't actually store data themselves. They act as a view or translation of an existing file system or storage device.

In principle, any resource available to a FUSE implementation can be exported as a file system.

Applications

On-disk file systems

Conventional on-disk file systems can be implemented in user space with FUSE, e.g. for compatibility or licensing reasons.

Layering file systems

FUSE filesystems can create a view of an underlying file system, transforming the files in some way.

Archive and backup file systems

FUSE filesystems can expose the contents of archives or backup sets without having to first extract them.

Remote/distributed file system clients

Other

See also

Related Research Articles

ext2, or second extended file system, is a file system for the Linux kernel. It was initially designed by French software developer Rémy Card as a replacement for the extended file system (ext). Having been designed according to the same principles as the Berkeley Fast File System from BSD, it was the first commercial-grade filesystem for Linux.

<span class="mw-page-title-main">Virtual file system</span> Abstract layer on top of a more concrete file system

A virtual file system (VFS) or virtual filesystem switch is an abstract layer on top of a more concrete file system. The purpose of a VFS is to allow client applications to access different types of concrete file systems in a uniform way. A VFS can, for example, be used to access local and network storage devices transparently without the client application noticing the difference. It can be used to bridge the differences in Windows, classic Mac OS/macOS and Unix filesystems, so that applications can access files on local file systems of those types without having to know what type of file system they are accessing.

Unionfs is a filesystem service for Linux, FreeBSD and NetBSD which implements a union mount for other file systems. It allows files and directories of separate file systems, known as branches, to be transparently overlaid, forming a single coherent file system. Contents of directories which have the same path within the merged branches will be seen together in a single merged directory, within the new, virtual filesystem.

In computing, the Global File System 2 or GFS2 is a shared-disk file system for Linux computer clusters. GFS2 allows all members of a cluster to have direct concurrent access to the same shared block storage, in contrast to distributed file systems which distribute data throughout the cluster. GFS2 can also be used as a local file system on a single computer.

A versioning file system is any computer file system which allows a computer file to exist in several versions at the same time. Thus it is a form of revision control. Most common versioning file systems keep a number of old copies of the file. Some limit the number of changes per minute or per hour to avoid storing large numbers of trivial changes. Others instead take periodic snapshots whose contents can be accessed using methods similar as those for normal file access.

Lustre is a type of parallel distributed file system, generally used for large-scale cluster computing. The name Lustre is a portmanteau word derived from Linux and cluster. Lustre file system software is available under the GNU General Public License and provides high performance file systems for computer clusters ranging in size from small workgroup clusters to large-scale, multi-site systems. Since June 2005, Lustre has consistently been used by at least half of the top ten, and more than 60 of the top 100 fastest supercomputers in the world, including the world's No. 1 ranked TOP500 supercomputer in November 2022, Frontier, as well as previous top supercomputers such as Fugaku, Titan and Sequoia.

FTPFS refers to file systems that support access to a File Transfer Protocol (FTP) server through standard file system application programming interfaces (APIs).

In computing, ioctl is a system call for device-specific input/output operations and other operations which cannot be expressed by regular file semantics. It takes a parameter specifying a request code; the effect of a call depends completely on the request code. Request codes are often device-specific. For instance, a CD-ROM device driver which can instruct a physical device to eject a disc would provide an ioctl request code to do so. Device-independent request codes are sometimes used to give userspace access to kernel functions which are only used by core system software or still under development.

The following tables compare general and technical information for a number of file systems.

<span class="mw-page-title-main">NTFS-3G</span> Implementation of NTFS file system

NTFS-3G is an open-source cross-platform implementation of the Microsoft Windows NTFS file system with read/write support. NTFS-3G often uses the FUSE file system interface, so it can run unmodified on many different operating systems. It is runnable on Linux, FreeBSD, NetBSD, OpenSolaris, illumos, BeOS, QNX, WinCE, Nucleus, VxWorks, Haiku, MorphOS, Minix, macOS and OpenBSD. It is licensed under the GNU General Public License. It is a partial fork of ntfsprogs and is under active maintenance and development.

Ceph is a free and open-source software-defined storage platform that provides object storage, block storage, and file storage built on a common distributed cluster foundation. Ceph provides completely distributed operation without a single point of failure and scalability to the exabyte level, and is freely available. Since version 12 (Luminous), Ceph does not rely on any other conventional filesystem and directly manages HDDs and SSDs with its own storage backend BlueStore and can expose a POSIX filesystem.

GVfs is GNOME's userspace virtual filesystem designed to work with the I/O abstraction of GIO, a library available in GLib since version 2.15.1. It installs several modules that are automatically used by applications using the APIs of libgio. There is also FUSE support that allows applications not using GIO to access the GVfs filesystems.

<span class="mw-page-title-main">ExpanDrive</span>

ExpanDrive is a network filesystem client for MacOS, Microsoft Windows and Linux that facilitates mapping of local volume to many different types of cloud storage. When a server is mounted with ExpanDrive any program can read, write, and manage remote files as if they were stored locally. This is different from most File Transfer Clients because it is integrated into all applications on the operating system. It also does not require a file to be downloaded to access portions of the content. ExpanDrive is commercial software, at a cost of $49.95 per license. A 7-day, unrestricted demo is available for evaluation.

Pass-to-Userspace Framework File System (puffs) is a NetBSD kernel subsystem developed for running filesystems in userspace. It was added to NetBSD in the 5.0 release, and was ported to DragonFly BSD in the 3.2 release.

OpenMediaVault (OMV) is a free Linux distribution designed for network-attached storage (NAS). The project's lead developer is Volker Theile, who instituted it in 2009. OMV is based on the Debian operating system, and is licensed through the GNU General Public License v3.

<span class="mw-page-title-main">Rump kernel</span> Software run in userspace that offers kernel functionality

The NetBSD rump kernel is the first implementation of the "anykernel" concept where drivers either can be compiled into or run in the monolithic kernel or in user space on top of a light-weight kernel. The NetBSD drivers can be used on top of the rump kernel on a wide range of POSIX operating systems, such as the Hurd, Linux, NetBSD, DragonFly BSD, Solaris kernels and even Cygwin, along with the file system utilities built with the rump libraries. The rump kernels can also run without POSIX directly on top of the Xen hypervisor, an L4 microkernel using the Genode OS Framework or even on "OS-less" bare metal.

<span class="mw-page-title-main">OpenZFS</span> Open-source implementation of the ZFS file system

OpenZFS is an open-source implementation of the ZFS file system and volume manager initially developed by Sun Microsystems for the Solaris operating system and now maintained by the OpenZFS Project. It supports features like data compression, data deduplication, copy-on-write clones, snapshots, and RAID-Z. It also supports the creation of virtual devices, which allows for the creation of file systems that span multiple disks.

Stratis is a user-space configuration daemon that configures and monitors existing components from Linux's underlying storage components of logical volume management (LVM) and XFS filesystem via D-Bus.

References

  1. "Release 3.16.2". 10 October 2023. Retrieved 19 October 2023.
  2. "Home - FUSE for OS X".
  3. Zissimopoulos, Bill (2021-02-14), billziss-gh/winfsp , retrieved 2021-02-16
  4. "Some technical advantages of the Hurd". May 15, 2011. Retrieved March 28, 2016.
  5. "WhatsNew/FreeBSD10 - FreeBSD Wiki".
  6. "openbsd dev - tech - Fuse (and sshfs) support for OpenBSD". Archived from the original on 2020-10-26. Retrieved 2013-07-14.
  7. "'CVS: cvs.openbsd.org: src' - MARC".
  8. "file-systems.fuse.devel - FUSE merged to 2.6.14! - msg#00021 - Recent Discussion OSDir.com". Archived from the original on 2016-04-20.
  9. "libfuse/libfuse, the reference implementation of the Linux FUSE (Filesystem in Userspace) interface". libfuse. 9 January 2020. Retrieved 9 January 2020.
  10. "libfuse3 ChangeLog". GitHub. Retrieved 9 January 2020.
  11. "Lustre FreeBSD". Archived from the original on 2008-03-12. Retrieved 2008-03-02.
  12. "Architecture ZFS for Lustre". Sun Microsystems. Archived from the original on 2009-01-22. Retrieved 2008-03-02.
  13. "minio/minfs". GitHub. Retrieved 12 April 2018.