File system: Difference between revisions

From HandWiki
imported>Sherlock
url
 
Nautica (talk | contribs)
link
 
Line 1: Line 1:
{{Short description|Format or program for storing files and directories}}
{{Short description|Computer filing system}}
In [[Computing|computing]], a '''file system''' or '''filesystem''' (often abbreviated to '''fs''') is a method and [[Data structure|data structure]] that the operating system uses to control how data is [[Computer data storage|stored]] and retrieved.<ref>{{cite web | title=5.10. Filesystems
{{OS}}
{{needs more citations|date=November 2025}}
In [[Computing|computing]], a '''file system''' or '''filesystem''' (often abbreviated to '''FS''' or '''fs''') governs [[Computer file|file]] organization and access. A {{em|local}} file system is a capability of an [[Operating system|operating system]] that services the applications running on the same [[Computer|computer]].<ref>{{cite web | title=5.10. Filesystems
|url=https://tldp.org/LDP/sag/html/filesystems.html
|url=https://tldp.org/LDP/sag/html/filesystems.html
|publisher= The Linux Document Project
|publisher= The Linux Document Project
|access-date=December 11, 2021
|access-date=December 11, 2021
|quote=A ''filesystem'' is the methods and data structures that an operating system uses to keep track of files on a disk or partition; that is, the way the files are organized on the disk.}}</ref> Without a file system, data placed in a storage medium would be one large body of data with no way to tell where one piece of data stopped and the next began, or where any piece of data was located when it was time to retrieve it. By separating the data into pieces and giving each piece a name, the data are easily isolated and identified. Taking its name from the way a paper-based data management system is named, each group of data is called a "[[Computer file|file]]". The structure and logic rules used to manage the groups of data and their names is called a "file system."
|quote=A ''filesystem'' is the methods and data structures that an operating system uses to keep track of files on a disk or partition; that is, the way the files are organized on the disk.}}</ref><ref>{{citation|title=File System Implementation|url=http://pages.cs.wisc.edu/~remzi/OSTEP/file-implementation.pdf|publisher= Arpaci-Dusseau Books|year = 2014|first1 = Remzi H.|last1 =Arpaci-Dusseau|first2=Andrea C.|last2 = Arpaci-Dusseau}}</ref> A [[distributed file system|{{em|distributed}} file system]] is a [[Communication protocol|protocol]] that provides file access between [[Computer network|networked]] computers.


There are many kinds of file systems, each with unique structure and logic, properties of speed, flexibility, security, size and more. Some file systems have been designed to be used for specific applications. For example, the [[ISO 9660]] and [[Universal Disk Format|UDF]] file systems are designed specifically for [[Engineering:Optical disc|optical disc]]s.
A file system provides a [[Computer data storage|data storage]] [[Service (systems architecture)|service]] that allows [[Application software|application]]s to share [[Mass storage|mass storage]]. Without a file system, applications could access the storage in [[Software incompatibility|incompatible]] ways that lead to [[Resource contention|resource contention]], [[Data corruption|data corruption]] and [[Data loss|data loss]].


File systems can be used on many types of storage devices using various media. Introduced by IBM in 1956, HDDs ([[Engineering:Hard disk drive|hard disk drive]]s) beginning in the early 1960s were, and still are, the dominant secondary storage device for general-purpose computers and are projected to remain so for the foreseeable future.<ref>{{cite web | title=Storage, IT Technology and Markets, Status and Evolution
There are many file system [[Software design|designs]] and [[Implementation|implementation]]s {{endash}} with various structure and features and various resulting characteristics such as speed, flexibility, security, size and more.
 
File systems have been developed for many types of storage devices, including [[Engineering:Hard disk drive|hard disk drive]]s (HDDs), [[Solid-state drive|solid-state drive]]s (SSDs), [[Physics:Magnetic tape|magnetic tape]]s and [[Engineering:Optical disc|optical disc]]s.<ref>{{cite web | title=Storage, IT Technology and Markets, Status and Evolution
|url=https://indico.cern.ch/event/713888/contributions/3122779/attachments/1719287/2774787/storage_tech_market_BPS_Sep2018_v6.pdf
|url=https://indico.cern.ch/event/713888/contributions/3122779/attachments/1719287/2774787/storage_tech_market_BPS_Sep2018_v6.pdf
|date=September 20, 2018
|date=September 20, 2018
|quote=HDD still key storage for the foreseeable future, SSDs not cost effective for capacity}}</ref> Other kinds of media that are used include SSDs, [[Physics:Magnetic tape|magnetic tape]]s, and optical discs. In some cases, such as with [[Tmpfs|tmpfs]], the computer's main memory ([[Random-access memory|random-access memory]], RAM) is used to create a temporary file system for short-term use.
|quote=HDD still key storage for the foreseeable future, SSDs not cost effective for capacity}}</ref>
 
A portion of the computer [[Random-access memory|main memory]] can be set up as a RAM disk that serves as a storage device for a file system. File systems such as [[Tmpfs|tmpfs]] can store files in [[Virtual memory|virtual memory]].


{{Anchor|VIRTUAL-FILE}}
{{Anchor|VIRTUAL-FILE}}
Some file systems are used on local [[Engineering:Data storage device|data storage device]]s;<ref>{{citation|title=File System Implementation|url=http://pages.cs.wisc.edu/~remzi/OSTEP/file-implementation.pdf|publisher= Arpaci-Dusseau Books|year = 2014|first1 = Remzi H.|last1 =Arpaci-Dusseau|first2=Andrea C.|last2 = Arpaci-Dusseau}}</ref> others provide file access via a network protocol (for example, NFS,<ref>{{citation|title=Sun's Network File System|url=http://pages.cs.wisc.edu/~remzi/OSTEP/dist-nfs.pdf|publisher= Arpaci-Dusseau Books|year = 2014|first1 = Remzi H.|last1 =Arpaci-Dusseau|first2=Andrea C.|last2 = Arpaci-Dusseau}}</ref> [[Server Message Block|SMB]], or [[9P (protocol)|9P]] clients).  Some file systems are "virtual", meaning that the supplied "files" (called '''virtual files''') are computed on request (such as [[Procfs|procfs]] and [[Sysfs|sysfs]]) or are merely a mapping into a different file system used as a backing store.  The file system manages access to both the content of files and the [[Metadata|metadata]] about those files.  It is responsible for arranging storage space; reliability, efficiency, and tuning with regard to the physical storage medium are important design considerations.
A {{em|virtual}} file system provides access to files that are either computed on request, called ''virtual files'' (for example those provided by [[Procfs|procfs]] and [[Sysfs|sysfs]]), or are mapping into another, backing storage.
 
== Etymology ==
 
From {{circa|1900}} and before the advent of computers, the terms ''file system'', ''filing system'' and ''system for filing'' were used to describe methods of organizing, storing and retrieving paper documents.<ref>{{cite book|last1=McGill|first1=Florence E.|title=Office Practice and Business Procedure|date=1922|publisher=Gregg Publishing Company|page=[https://archive.org/details/officepracticea01mcgigoog/page/n211 197]|url=https://archive.org/details/officepracticea01mcgigoog|access-date=August 1, 2016}}</ref> By 1961, the term ''file system'' was being applied to computerized filing alongside the original meaning.<ref>{{cite book|last1=Waring|first1=R.L.|title=Technical investigations of addition of a hardcopy output to the elements of a mechanized library system : final report, 20 Sept. 1961|date=1961|publisher=Svco Corporation|location=Cincinnati, OH|oclc=310795767}}</ref> By 1964, it was in general use.<ref>{{cite book|title=Disc File Applications: Reports Presented at the Nation's First Disc File Symposium|date=1964|publisher=American Data Processing|url=https://books.google.com/books?id=hJBWAAAAMAAJ|access-date=August 1, 2016}}</ref>


==Origin of the term==
== Architecture ==
From {{circa|1900}} and before the advent of computers the terms ''file system'' and ''system for filing'' were used to describe a method of storing and retrieving paper documents.<ref>{{cite book|last1=McGill|first1=Florence E.|title=Office Practice and Business Procedure|date=1922|publisher=Gregg Publishing Company|page=[https://archive.org/details/officepracticea01mcgigoog/page/n211 197]|url=https://archive.org/details/officepracticea01mcgigoog|access-date=August 1, 2016}}</ref> By 1961, the term ''file system'' was being applied to computerized filing alongside the original meaning.<ref>{{cite book|last1=Waring|first1=R.L.|title=Technical investigations of addition of a hardcopy output to the elements of a mechanized library system : final report, 20 Sept. 1961|date=1961|publisher=Svco Corporation|location=Cincinnati, OH|oclc=310795767}}</ref> By 1964, it was in general use.<ref>{{cite book|title=Disc File Applications: Reports Presented at the Nation's First Disc File Symposium|date=1964|publisher=American Data Processing|url=https://books.google.com/books?id=hJBWAAAAMAAJ|access-date=August 1, 2016}}</ref>


==Architecture==
A local file system's [[Software architecture|architecture]] can be described as [[Abstraction layer|layers of abstraction]] even though a particular file system design may not actually separate the concepts.<ref name="JHU">{{cite web|last1=Amir|first1=Yair|title=Operating Systems 600.418 The File System|url=http://www.cs.jhu.edu/~yairamir/cs418/os7/sld001.htm|website=Department of Computer Science Johns Hopkins University|access-date=July 31, 2016}}</ref>
A file system consists of two or three layers. Sometimes the layers are explicitly separated, and sometimes the functions are combined.<ref name="JHU">{{cite web|last1=Amir|first1=Yair|title=Operating Systems 600.418 The File System|url=http://www.cs.jhu.edu/~yairamir/cs418/os7/sld001.htm|website=Department of Computer Science Johns Hopkins University|access-date=July 31, 2016}}</ref>


The ''logical file system'' is responsible for interaction with the user application. It provides the application program interface (API) for file operations &mdash; <code>OPEN</code>, <code>CLOSE</code>, <code>READ</code>, etc., and passes the requested operation to the layer below it for processing. The logical file system "manage[s] open file table entries and per-process file descriptors".<ref name="IBMKC">{{cite web|last1=IBM Corporation|title=Component Structure of the Logical File System|url=https://www.ibm.com/support/knowledgecenter/ssw_aix_61/com.ibm.aix.kernextc/virtual_fsys.htm|website=IBM Knowledge Center|access-date=July 31, 2016}}</ref> This layer provides "file access, directory operations, [and] security and protection".<ref name=JHU />
The ''logical file system'' layer provides relatively high-level access via an [[Application programming interface|application programming interface]] (API) for file operations including open, close, read and write {{endash}} delegating operations to lower layers. This layer manages open file table entries and per-process file descriptors.<ref name="IBMKC">{{cite web|last1=IBM Corporation|title=Component Structure of the Logical File System|url=https://www.ibm.com/docs/en/aix/7.3?topic=overview-component-structure-logical-file-system|website=IBM Knowledge Center|access-date=April 24, 2024}}</ref> It provides file access, directory operations, security and protection.<ref name=JHU />


The second optional layer is the ''virtual file system''. "This interface allows support for multiple concurrent instances of physical file systems, each of which is called a file system implementation".<ref name=IBMKC />
The ''virtual file system'', an optional layer, supports multiple concurrent instances of physical file systems, each of which is called a file system implementation.<ref name=IBMKC />


The third layer is the ''physical file system''. This layer is concerned with the physical operation of the storage device (e.g. disk). It processes physical [[Block (data storage)|blocks]] being read or written. It handles [[Data buffer|buffer]]ing and [[Memory management|memory management]] and is responsible for the physical placement of blocks in specific locations on the storage medium. The physical file system interacts with the [[Device driver|device driver]]s or with the channel to drive the storage device.<ref name=JHU />
The ''physical file system'' layer provides relatively low-level access to a storage device (e.g. disk). It reads and writes [[Block (data storage)|data blocks]], provides [[Data buffer|buffer]]ing and other [[Memory management|memory management]] and controls placement of blocks in specific locations on the storage medium. This layer uses [[Device driver|device driver]]s or channel I/O to drive the storage device.<ref name=JHU />


==Aspects of file systems==
== Attributes ==


===Space management===
=== File names ===
''Note: this only applies to file systems used in storage devices.''


[[File:100 000-files 5-bytes each -- 400 megs of slack space.png|frame|An example of slack space, demonstrated with 4,096-[[Byte|byte]] NTFS clusters: 100,000 files, each five bytes per file, which equal to 500,000 bytes of actual data but require 409,600,000 bytes of disk space to store <!-- The size listing shown in Explorer is oddly doubly-wrong. The example files are 5 bytes each, not 0.1K, and the clusters are a minimum of 4K not 1K.-->]]
{{Main|Filename}}
A ''file name'', or ''filename'', identifies a file to consuming applications and in some cases users.
 
A file name is unique so that an application can refer to exactly one file for a particular name. If the file system supports directories, then generally file name uniqueness is enforced within the context of each directory. In other words, a storage can contain multiple files with the same name, but not in the same directory.
 
Most file systems restrict the length of a file name.
 
Some file systems match file names as case sensitive and others as case insensitive. For example, the names <code>MYFILE</code> and <code>myfile</code> match the same file for case insensitive, but different files for case sensitive.


File systems allocate space in a granular manner, usually multiple physical units on the device. The file system is responsible for organizing [[Computer file|files]] and [[Directory (file systems)|directories]], and keeping track of which areas of the media belong to which file and which are not being used. For example, in [[Software:Apple DOS|Apple DOS]] of the early 1980s, 256-byte sectors on 140 kilobyte floppy disk used a ''track/sector map''.{{Citation needed|date=September 2012}}
Most modern file systems allow a file name to contain a wide range of characters from the [[Unicode]] character set. Some restrict characters such as those used to indicate special attributes such as a device, device type, directory prefix, file path separator, or file type.


This results in unused space when a file is not an exact multiple of the allocation unit, sometimes referred to as ''slack space''.{{Sfn|Carrier|2005|pp=187–188}} For a 512-byte allocation, the average unused space is 256 bytes. For 64&nbsp;KB clusters, the average unused space is 32&nbsp;KB. The size of the allocation unit is chosen when the file system is created. Choosing the allocation size based on the average size of the files expected to be in the file system can minimize the amount of unusable space. Frequently the default allocation may provide reasonable usage. Choosing an allocation size that is too small results in excessive overhead if the file system will contain mostly very large files.
=== Directories ===


[[File:File system fragmentation.png|thumb|File systems may become [[File system fragmentation|fragmented]]]]
{{Main|Directory (computing)}}


[[File system fragmentation]] occurs when unused space or single files are not contiguous. As a file system is used, files are created, modified and deleted. When a file is created, the file system allocates space for the data. Some file systems permit or require specifying an initial space allocation and subsequent incremental allocations as the file grows. As files are deleted, the space they were allocated eventually is considered available for use by other files. This creates alternating used and unused areas of various sizes. This is free space fragmentation. When a file is created and there is not an area of contiguous space available for its initial allocation, the space must be assigned in fragments. When a file is modified such that it becomes larger, it may exceed the space initially allocated to it, another allocation must be assigned elsewhere and the file becomes fragmented.<ref>{{cite book|url=https://books.google.com/books?id=dSMJAAAAQBAJ&pg=PA524|title=Embedded Microcomputer Systems: Real Time Interfacing|edition=Third|last=Valvano|first=Jonathan W.|publisher=Cengage Learning|date=2011|access-date=June 30, 2022|page=524|isbn=978-1-111-42625-5}}</ref>
File systems typically support organizing files into ''directories'', also called ''folders'', which segregate files into groups.


In some operating systems, a system administrator may use [[Disk quota|disk quota]]s to limit the allocation of disk space.
This may be implemented by associating the file name with an index in a [[Table of contents|table of contents]] or an [[Inode|inode]] in a [[Unix-like]] file system.


===Filenames===
Directory structures may be flat (i.e. linear), or allow hierarchies by allowing a directory to contain directories, called subdirectories.
{{Main|Filename}}
A '''filename''' (or '''file name''') is used to identify a storage location in the file system. Most file systems have restrictions on the length of filenames. In some file systems, filenames are not case sensitive (i.e., the names <code>MYFILE</code> and <code>myfile</code> refer to the same file in a directory); in others, filenames are case sensitive (i.e., the names <code>MYFILE</code>, <code>MyFile</code>, and <code>myfile</code> refer to three separate files that are in the same directory).


Most modern file systems allow filenames to contain a wide range of characters from the [[Unicode]] character set. However, they may have restrictions on the use of certain special characters, disallowing them within filenames; those characters might be used to indicate a device, device type, directory prefix, file path separator, or file type.
The first file system to support arbitrary hierarchies of directories was used in the [[Software:Multics|Multics]] operating system.<ref>{{cite conference|chapter-url=http://www.multicians.org/fjcc4.html|chapter=A General-Purpose File System For Secondary Storage|author=R. C. Daley|author2=P. G. Neumann|title=Proceedings of the November 30--December 1, 1965, fall joint computer conference, Part I on XX - AFIPS '65 (Fall, part I) |year=1965|conference=Fall Joint Computer Conference|publisher=AFIPS|pages=213–229|doi=10.1145/1463891.1463915|access-date=2011-07-30|doi-access=free}}</ref> The native file systems of Unix-like systems also support arbitrary directory hierarchies, as do, [[Company:Apple Inc.|Apple]]'s [[Hierarchical File System (Apple)|Hierarchical File System]] and its successor [[HFS Plus|HFS+]] in [[Software:Classic Mac OS|classic Mac OS]], the [[File Allocation Table|FAT]] file system in [[Software:MS-DOS|MS-DOS]] 2.0 and later versions of MS-DOS and in [[Software:Microsoft Windows|Microsoft Windows]], the [[NTFS]] file system in the [[Software:Windows NT|Windows NT]] family of operating systems, and the ODS-2 (On-Disk Structure-2) and higher levels of the [[Files-11]] file system in [[Software:OpenVMS|OpenVMS]].


===Directories===
===<span class="anchor" id="METADATA"></span>Metadata===
{{Main|Directory (file systems)}}
{{uncited section|date=November 2025}}
File systems typically have '''directories''' (also called '''folders''') which allow the user to group files into separate collections. This may be implemented by associating the file name with an index in a [[Table of contents|table of contents]] or an [[Inode|inode]] in a [[Unix-like]] file system. Directory structures may be flat (i.e. linear), or allow hierarchies where directories may contain subdirectories. The first file system to support arbitrary hierarchies of directories was used in the [[Software:Multics|Multics]] operating system.<ref>{{cite conference|chapter-url=http://www.multicians.org/fjcc4.html|chapter=A General-Purpose File System For Secondary Storage|author=R. C. Daley|author2=P. G. Neumann|title=Proceedings of the November 30--December 1, 1965, fall joint computer conference, Part I on XX - AFIPS '65 (Fall, part I) |year=1965|conference=Fall Joint Computer Conference|publisher=AFIPS|pages=213–229|doi=10.1145/1463891.1463915|access-date=2011-07-30|doi-access=free}}</ref> The native file systems of Unix-like systems also support arbitrary directory hierarchies, as do, for example, [[Company:Apple Inc.|Apple]]'s [[Hierarchical File System (Apple)|Hierarchical File System]] and its successor [[HFS Plus|HFS+]] in [[Software:Classic Mac OS|classic Mac OS]], the [[File Allocation Table|FAT]] file system in [[Software:MS-DOS|MS-DOS]] 2.0 and later versions of MS-DOS and in [[Software:Microsoft Windows|Microsoft Windows]], the [[NTFS]] file system in the [[Software:Windows NT|Windows NT]] family of operating systems, and the ODS-2 (On-Disk Structure-2) and higher levels of the [[Files-11]] file system in [[Software:OpenVMS|OpenVMS]].
In addition to data, the file content, a file system also manages associated [[Metadata|metadata]] which may include but is not limited to:


==={{Anchor|METADATA}}Metadata===
* name
Other bookkeeping information is typically associated with each file within a file system. The [[File size|length]] of the data contained in a file may be stored as the number of blocks allocated for the file or as a [[Byte|byte]] count. The [[System time|time]] that the file was last modified may be stored as the file's timestamp. File systems might store the file creation time, the time it was last accessed, the time the file's [[Metadata|metadata]] was changed, or the time the file was last backed up. Other information can include the file's [[Device file|device type]] (e.g. block, character, socket, subdirectory, etc.), its owner user ID and group ID, its access permissions and other [[File attribute|file attribute]]s (e.g. whether the file is read-only, [[Executable|executable]], etc.).
* [[File size|size]] which may be stored as the number of blocks allocated or as a [[Byte|byte]] count
* [[System time|when]] created, last accessed, last modified
* owner user and group
* access permissions
* [[File attribute|file attribute]]s such as whether the file is read-only, [[Executable|executable]], etc.
* [[Device file|device type]] (e.g. block, character, socket, subdirectory, etc.)


A file system stores all the metadata associated with the file—including the file name, the length of the contents of a file, and the location of the file in the folder hierarchy—separate from the contents of the file.
A file system stores associated metadata separate from the content of the file.


Most file systems store the names of all the files in one directory in one place—the directory table for that directory—which is often stored like any other file.
Most file systems store the names of all the files in one directory in one place—the directory table for that directory—which is often stored like any other file.
Line 69: Line 86:
Additional attributes can be associated on file systems, such as [[NTFS]], [[XFS]], [[Ext2|ext2]], [[Ext3|ext3]], some versions of [[Unix File System|UFS]], and HFS+, using [[Extended file attributes|extended file attributes]]. Some file systems provide for user defined attributes such as the author of the document, the character encoding of a document or the size of an image.
Additional attributes can be associated on file systems, such as [[NTFS]], [[XFS]], [[Ext2|ext2]], [[Ext3|ext3]], some versions of [[Unix File System|UFS]], and HFS+, using [[Extended file attributes|extended file attributes]]. Some file systems provide for user defined attributes such as the author of the document, the character encoding of a document or the size of an image.


Some file systems allow for different data collections to be associated with one file name. These separate collections may be referred to as ''streams'' or ''forks''. Apple has long used a forked file system on the Macintosh, and Microsoft supports streams in NTFS. Some file systems maintain multiple past revisions of a file under a single file name; the filename by itself retrieves the most recent version, while prior saved version can be accessed using a special naming convention such as "filename;4" or "filename(-4)" to access the version four saves ago.
Some file systems allow for different data collections to be associated with one file name. These separate collections may be referred to as ''streams'' or ''forks''. Apple has long used a forked file system on the Macintosh, and Microsoft supports streams in NTFS. Some file systems maintain multiple past revisions of a file under a single file name; the file name by itself retrieves the most recent version, while prior saved versions can be accessed using a special naming convention such as "filename;4" or "filename(-4)" to access the version four saves ago.
 
{{xref|See [[Software:Comparison of file systems#Metadata|comparison of file systems § Metadata]] for details on which file systems support which kinds of metadata.}}
 
=== Storage space organization ===
 
A local file system tracks which areas of storage belong to which file and which are not being used.
 
When a file system creates a file, it allocates space for data. Some file systems permit or require specifying an initial space allocation and subsequent incremental allocations as the file grows.
 
To delete a file, the file system records that the file's space is free (available to use for another file).
 
[[File:100 000-files 5-bytes each -- 400 megs of slack space.png|frame|An example of slack space, demonstrated with 4,096-[[Byte|byte]] NTFS clusters: 100,000 files, each five bytes per file, which equal to 500,000 bytes of actual data but require 409,600,000 bytes of disk space to store <!-- The size listing shown in Explorer is oddly doubly-wrong. The example files are 5 bytes each, not 0.1K, and the clusters are a minimum of 4K not 1K.-->]]
 
 
The granular nature results in unused space, sometimes called slack space, for each file except for those that have the rare size that is a multiple of the granular allocation.{{Sfn|Carrier|2005|pp=187–188}} For a 512-byte allocation, the average unused space is 256 bytes. For 64&nbsp;KB clusters, the average unused space is 32&nbsp;KB.
 
Generally, the allocation unit size is set when the storage is configured.
Choosing a relatively small size compared to the files stored, results in excessive access overhead.
Choosing a relatively large size results in excessive unused space.
Choosing an allocation size based on the average size of files expected to be in the storage tends to minimize unusable space.
 
=== Fragmentation ===
 
[[File:File system fragmentation.svg|thumb|File systems may become [[File system fragmentation|fragmented]]]]
 
As a file system creates, modifies and deletes files, the underlying storage representation may become [[File system fragmentation|fragmented]]. Files and the unused space between files will occupy allocation blocks that are not contiguous.
 
A file becomes fragmented if space needed to store its content cannot be allocated in contiguous blocks. Free space becomes fragmented when files are deleted.<ref>{{cite book|url=https://books.google.com/books?id=dSMJAAAAQBAJ&pg=PA524|title=Embedded Microcomputer Systems: Real Time Interfacing|edition=Third|last=Valvano|first=Jonathan W.|publisher=Cengage Learning|date=2011|access-date=June 30, 2022|page=524|isbn=978-1-111-42625-5}}</ref>
 
Fragmentation is invisible to the end user and the system still works correctly. However, this can degrade performance on some storage hardware that works better with contiguous blocks such as [[Engineering:Hard disk drive#Performance characteristics|hard disk drives]]. Other hardware such as [[Solid-state drive|solid-state drives]] are not affected by fragmentation.


See [[Software:Comparison of file systems#Metadata|comparison of file systems#Metadata]] for details on which file systems support which kinds of metadata.
=== Access control ===


===File system as an abstract user interface===
<!-- Too many 'see also' links, perhaps these should be moved to the 'See also' sect at the end -->
In some cases, a file system may not make use of a storage device but can be used to organize and represent access to any data, whether it is stored or dynamically generated (e.g. [[Procfs|procfs]]).
{{See also|Computer security|Password cracking|Filesystem-level encryption|Encrypting File System}}


===Utilities===
A file system often supports access control of data that it manages.
File systems include utilities to initialize, alter parameters of and remove an instance of the file system. Some include the ability to extend or truncate the space allocated to the file system.
 
The intent of access control is often to prevent certain users from reading or modifying certain files.
 
Access control can also restrict access by program in order to ensure that data is modified in a controlled way. Examples include passwords stored in the metadata of the file or elsewhere and file permissions in the form of permission bits, [[Access control list|access control list]]s, or [[Capability-based security|capabilities]]. The need for file system utilities to be able to access the data at the media level to reorganize the structures and provide efficient backup usually means that these are only effective for polite users but are not effective against intruders.
<!-- Please don't make this article really big by including all the issues of file security here. Please add it to a file system security article -->
 
Methods for encrypting file data are sometimes included in the file system. This is very effective since there is no need for file system utilities to know the encryption seed to effectively manage the data. The risks of relying on encryption include the fact that an attacker can copy the data and use brute force to decrypt the data. Additionally, losing the seed means losing the data.
 
=== Storage quota ===
[[File:Btrfs qgroup screenshot.png|thumb|upright=1.5|Example of qgroup (quota group) of a [[Btrfs|btrfs]] filesystem]]
Some operating systems allow a system administrator to enable [[Disk quota|disk quota]]s to limit a user's use of storage space.
 
=== Data integrity ===
 
A file system typically ensures that stored data remains consistent in both normal operations as well as exceptional situations like:
* accessing program neglects to inform the file system that it has completed file access (to close a file)
* accessing program terminates abnormally (crashes)
* media failure
* loss of connection to remote systems
* operating system failure
* system reset (soft reboot)
* power failure (hard reboot)
 
Recovery from exceptional situations may include updating metadata, directory entries and handling data that was buffered but not written to storage media.
 
=== Recording ===
 
A file system might record events to allow analysis of issues such as:
* file or systemic problems and performance
* nefarious access
 
=== Data access ===
 
==== Byte stream access ====
 
Many file systems access data as a stream of bytes. Typically, to read file data, a program provides a memory buffer and the file system retrieves data from the medium and then writes the data to the buffer. A write involves the program providing a buffer of bytes that the file system reads and then stores to the medium.
 
==== Record access ====
 
Some file systems, or layers on top of a file system, allow a program to define a [[Record (computer science)|record]] so that a program can read and write data as a structure, not an unorganized sequence of bytes.
 
If a ''fixed length'' record definition is used, then locating the n<sup>th</sup> record can be calculated mathematically, which is relatively fast compared to parsing the data for record separators.
 
An identification for each record, also known as a key, allows a program to read, write and update records without regard to their location in storage. Such storage requires managing blocks of media, usually separating key blocks and data blocks. Efficient algorithms can be developed with pyramid structures for locating records.<ref>{{cite web|url=https://www.researchgate.net/publication/234789457|title=KSAM: A B + -tree-based keyed sequential-access method|work=ResearchGate|access-date=29 April 2016}}</ref>
 
=== Utilities ===
 
Typically, a file system can be managed by the user via various utility programs.
 
Some utilities allow the user to create, configure and remove an instance of a file system. It may allow extending or truncating the space allocated to the file system.


{{Anchor|DENTRY}}
{{Anchor|DENTRY}}
Line 100: Line 196:
Some of the most important features of file system utilities are supervisory activities which may involve bypassing ownership or direct access to the underlying device. These include high-performance backup and recovery, data replication, and reorganization of various data structures and allocation tables within the file system.
Some of the most important features of file system utilities are supervisory activities which may involve bypassing ownership or direct access to the underlying device. These include high-performance backup and recovery, data replication, and reorganization of various data structures and allocation tables within the file system.


===Restricting and permitting access===
=== File system API ===
<!-- Too many 'see also' links, perhaps these should be moved to the 'See also' sect at the end -->


There are several mechanisms used by file systems to control access to data. Usually the intent is to prevent reading or modifying files by a user or group of users. Another reason is to ensure data is modified in a controlled way so access may be restricted to a specific program. Examples include passwords stored in the metadata of the file or elsewhere and file permissions in the form of permission bits, [[Access control list|access control list]]s, or [[Capability-based security|capabilities]]. The need for file system utilities to be able to access the data at the media level to reorganize the structures and provide efficient backup usually means that these are only effective for polite users but are not effective against intruders.
Utilities, libraries and programs use [[File system API|file system API]]s to make requests of the file system. These include data transfer, positioning, updating metadata, managing directories, managing access specifications, and removal.
<!-- Please don't make this article really big by including all the issues of file security here. Please add it to a file system security article -->


Methods for encrypting file data are sometimes included in the file system. This is very effective since there is no need for file system utilities to know the encryption seed to effectively manage the data. The risks of relying on encryption include the fact that an attacker can copy the data and use brute force to decrypt the data. Additionally, losing the seed means losing the data.
=== Multiple file systems within a single system ===


===Maintaining integrity===
One significant responsibility of a file system is to ensure that the file system structures in secondary storage remain consistent, regardless of the actions by programs accessing the file system. This includes actions taken if a program modifying the file system terminates abnormally or neglects to inform the file system that it has completed its activities. This may include updating the metadata, the directory entry and handling any data that was buffered but not yet updated on the physical storage media.
Other failures which the file system must deal with include media failures or loss of connection to remote systems.
In the event of an operating system failure or "soft" power failure, special routines in the file system must be invoked similar to when an individual program fails.
The file system must also be able to correct damaged structures. These may occur as a result of an operating system failure for which the OS was unable to notify the file system, a power failure, or a reset.
The file system must also record events to allow analysis of systemic issues as well as problems with specific files or directories.
===User data===
The most important purpose of a file system is to manage user data. This includes storing, retrieving and updating data.
Some file systems accept data for storage as a stream of bytes which are collected and stored in a manner efficient for the media. When a program retrieves the data, it specifies the size of a memory buffer and the file system transfers data from the media to the buffer. A runtime library routine may sometimes allow the user program to define a ''record'' based on a library call specifying a length. When the user program reads the data, the library retrieves data via the file system and returns a ''record''.
Some file systems allow the specification of a fixed record length which is used for all writes and reads. This facilitates locating the n<sup>th</sup> record as well as updating records.
An identification for each record, also known as a key, makes for a more sophisticated file system. The user program can read, write and update records without regard to their location. This requires complicated management of blocks of media usually separating key blocks and data blocks. Very efficient algorithms can be developed with pyramid structures for locating records.<ref>{{cite web|url=https://www.researchgate.net/publication/234789457|title=KSAM: A B + -tree-based keyed sequential-access method|work=ResearchGate|access-date=29 April 2016}}</ref>
===Using a file system===
Utilities, language specific run-time libraries and user programs use [[File system API|file system API]]s to make requests of the file system. These include data transfer, positioning, updating metadata, managing directories, managing access specifications, and removal.
===Multiple file systems within a single system===
Frequently, retail systems are configured with a single file system occupying the entire storage device.
Frequently, retail systems are configured with a single file system occupying the entire storage device.


Another approach is to [[Disk partitioning|partition]] the disk so that several file systems with different attributes can be used. One file system, for use as browser cache or email storage, might be configured with a small allocation size. This keeps the activity of creating and deleting files typical of browser activity in a narrow area of the disk where it will not interfere with other file allocations. Another partition might be created for the storage of audio or video files with a relatively large block size. Yet another may normally be set ''read-only'' and only periodically be set writable.
Another approach is to [[Disk partitioning|partition]] the disk so that several file systems with different attributes can be used. One file system, for use as browser cache or email storage, might be configured with a small allocation size. This keeps the activity of creating and deleting files typical of browser activity in a narrow area of the disk where it will not interfere with other file allocations. Another partition might be created for the storage of audio or video files with a relatively large block size. Yet another may normally be set ''read-only'' and only periodically be set writable. Some file systems, such as [[ZFS]] and APFS, support multiple file systems sharing a common pool of free blocks, supporting several file systems with different attributes without having to reserved a fixed amount of space for each file system.<ref>{{cite web|url=https://docs.freebsd.org/en/books/handbook/zfs/|title=Chapter 22. The Z File System (ZFS)|work=The FreeBSD Handbook|quote=Pooled storage: adding physical storage devices to a pool, and allocating storage space from that shared pool. Space is available to all file systems and volumes, and increases by adding new storage devices to the pool.}}</ref><ref>{{cite web|url=https://daisydiskapp.com/guide/4/en/APFS/|title=About Apple File System (APFS)|work=DaisyDisk User Guide|quote=APFS introduces space sharing between volumes. In APFS, every physical disk is a container that can have multiple volumes inside, which share the same pool of free space.}}</ref>


A third approach, which is mostly used in cloud systems, is to use "[[Disk image|disk image]]s" to house additional file systems, with the same attributes or not, within another (host) file system as a file. A common example is virtualization: one user can run an experimental Linux distribution (using the [[Ext4|ext4]] file system) in a virtual machine under his/her production Windows environment (using [[NTFS]]). The ext4 file system resides in a disk image, which is treated as a file (or multiple files, depending on the [[Hypervisor|hypervisor]] and settings) in the NTFS host file system.
A third approach, which is mostly used in cloud systems, is to use "[[Disk image|disk image]]s" to house additional file systems, with the same attributes or not, within another (host) file system as a file. A common example is virtualization: one user can run an experimental Linux distribution (using the [[Ext4|ext4]] file system) in a virtual machine under their production Windows environment (using [[NTFS]]). The ext4 file system resides in a disk image, which is treated as a file (or multiple files, depending on the [[Hypervisor|hypervisor]] and settings) in the NTFS host file system.


Having multiple file systems on a single system has the additional benefit that in the event of a corruption of a single partition, the remaining file systems will frequently still be intact. This includes virus destruction of the ''system'' partition or even a system that will not boot. File system utilities which require dedicated access can be effectively completed piecemeal. In addition, [[Defragmentation|defragmentation]] may be more effective. Several system maintenance utilities, such as virus scans and backups, can also be processed in segments. For example, it is not necessary to backup the file system containing videos along with all the other files if none have been added since the last backup. As for the image files, one can easily "spin off" differential images which contain only "new" data written to the master (original) image. Differential images can be used for both safety concerns (as a "disposable" system - can be quickly restored if destroyed or contaminated by a virus, as the old image can be removed and a new image can be created in matter of seconds, even without automated procedures) and quick virtual machine deployment (since the differential images can be quickly spawned using a script in batches).
Having multiple file systems on a single system has the additional benefit that in the event of a corruption of a single file system, the remaining file systems will frequently still be intact. This includes virus destruction of the ''system'' file system or even a system that will not boot. File system utilities which require dedicated access can be effectively completed piecemeal. In addition, [[Defragmentation|defragmentation]] may be more effective. Several system maintenance utilities, such as virus scans and backups, can also be processed in segments. For example, it is not necessary to backup the file system containing videos along with all the other files if none have been added since the last backup. As for the image files, one can easily "spin off" differential images which contain only "new" data written to the master (original) image. Differential images can be used for both safety concerns (as a "disposable" system - can be quickly restored if destroyed or contaminated by a virus, as the old image can be removed and a new image can be created in matter of seconds, even without automated procedures) and quick virtual machine deployment (since the differential images can be quickly spawned using a script in batches).


===Design limitations===
== Types ==
All file systems have some functional limit that defines [[Software:Comparison of file systems#Limits|the maximum storable data capacity within that system]]. These functional limits are a best-guess effort by the designer based on how large the storage systems are right now and how large storage systems are likely to become in the future. Disk storage has continued to increase at near [[Exponential growth|exponential]] rates (see [[Moore's law]]), so after a few years, file systems have kept reaching design limitations that require computer users to repeatedly move to a newer system with ever-greater capacity.


File system complexity typically varies proportionally with the available storage capacity. The file systems of early 1980s [[Engineering:Home computer|home computer]]s with 50&nbsp;KB to 512&nbsp;KB of storage would not be a reasonable choice for modern storage systems with hundreds of gigabytes of capacity. Likewise, modern file systems would not be a reasonable choice for these early systems, since the complexity of modern file system structures would quickly consume or even exceed the very limited capacity of the early storage systems.
=== Storage media ===
==== Disk file systems ====


==Types of file systems==
A ''disk file system'' takes advantages of the ability of disk storage media to randomly address data in a short amount of time. Additional considerations include the speed of accessing data following that initially requested and the anticipation that the following data may also be requested. This permits multiple users (or processes) access to various data on the disk without regard to the sequential location of the data. Examples include [[File Allocation Table|FAT]] ([[FAT12]], [[FAT16]], [[FAT32]]), [[ExFAT|exFAT]], [[NTFS]], ReFS, [[Hierarchical File System (Apple)|HFS]] and [[HFS Plus|HFS+]], [[High Performance File System|HPFS]], [[Apple File System|APFS]], [[Unix File System|UFS]], [[Ext2|ext2]], [[Ext3|ext3]], [[Ext4|ext4]], [[XFS]], [[Btrfs|btrfs]], [[Files-11]], [[Veritas File System]], VMFS, [[ZFS]], [[ReiserFS]], [[Novell Storage Services|NSS]] and ScoutFS. Some disk file systems are [[Journaling file system|journaling file system]]s or [[Versioning file system|versioning file system]]s.
File system types can be classified into disk/tape file systems, network file systems and special-purpose file systems.


===Disk file systems===
===== Optical discs =====
A ''disk file system'' takes advantages of the ability of disk storage media to randomly address data in a short amount of time. Additional considerations include the speed of accessing data following that initially requested and the anticipation that the following data may also be requested. This permits multiple users (or processes) access to various data on the disk without regard to the sequential location of the data. Examples include [[File Allocation Table|FAT]] ([[FAT12]], [[FAT16]], [[FAT32]]), [[ExFAT|exFAT]], [[NTFS]], ReFS, [[Hierarchical File System (Apple)|HFS]] and [[HFS Plus|HFS+]], [[High Performance File System|HPFS]], [[Apple File System|APFS]], [[Unix File System|UFS]], [[Ext2|ext2]], [[Ext3|ext3]], [[Ext4|ext4]], [[XFS]], [[Btrfs|btrfs]], [[Files-11]], [[Veritas File System]], VMFS, [[ZFS]], [[ReiserFS]], [[Novell Storage Services|NSS]] and ScoutFS. Some disk file systems are [[Journaling file system|journaling file system]]s or [[Versioning file system|versioning file system]]s.


====Optical discs====
[[ISO 9660]] and [[Universal Disk Format]] (UDF) are two common formats that target Compact Discs, [[Engineering:DVD|DVD]]s and [[Engineering:Blu-ray|Blu-ray]] [[Engineering:Optical disc|discs]]. [[Mount Rainier (packet writing)|Mount Rainier]] is an extension to UDF supported since 2.6 series of the Linux kernel and since Windows Vista that facilitates rewriting to DVDs.
[[ISO 9660]] and [[Universal Disk Format]] (UDF) are two common formats that target Compact Discs, [[Engineering:DVD|DVD]]s and [[Engineering:Blu-ray|Blu-ray]] discs. [[Mount Rainier (packet writing)|Mount Rainier]] is an extension to UDF supported since 2.6 series of the Linux kernel and since Windows Vista that facilitates rewriting to DVDs.


===Flash file systems===
==== Flash file systems ====
{{Main|Flash file system}}
{{Main|Flash file system}}


A ''flash file system'' considers the special abilities, performance and restrictions of [[Flash memory|flash memory]] devices. Frequently a disk file system can use a flash memory device as the underlying storage media, but it is much better to use a file system specifically designed for a flash device.<ref>{{cite book|chapter=18. Storage Alternatives for Mobile Computers|title=Mobile Computing|last1=Douglis|first1=Fred|last2=Cáceres|first2=Ramón|last3=Kaashoek|first3=M. Frans|last4=Krishnan|first4=P.|last5=Li|first5=Kai|author6-link=Kai Li|last6=Marsh|first6=Brian|last7=Tauber|first7=Joshua|publisher=[[Organization:USENIX|USENIX]]|date=1994|volume=353|pages=473–505|isbn=978-0-585-29603-6|doi=10.1007/978-0-585-29603-6_18|s2cid=2441760 }}</ref>
A ''flash file system'' considers the special abilities, performance and restrictions of [[Flash memory|flash memory]] devices. Frequently a disk file system can use a flash memory device as the underlying storage media, but it is much better to use a file system specifically designed for a flash device.<ref>{{cite book|chapter=18. Storage Alternatives for Mobile Computers|title=Mobile Computing|last1=Douglis|first1=Fred|last2=Cáceres|first2=Ramón|last3=Kaashoek|first3=M. Frans|last4=Krishnan|first4=P.|last5=Li|first5=Kai|author6-link=Kai Li|last6=Marsh|first6=Brian|last7=Tauber|first7=Joshua|publisher=[[Organization:USENIX|USENIX]]|date=1994|volume=353|pages=473–505|isbn=978-0-585-29603-6|doi=10.1007/978-0-585-29603-6_18|s2cid=2441760 }}</ref>


===Tape file systems===
==== Tape file systems ====
 
A ''tape file system'' is a file system and tape format designed to store files on tape. [[Physics:Magnetic tape|Magnetic tape]]s are sequential storage media with significantly longer random data access times than disks, posing challenges to the creation and efficient management of a general-purpose file system.
A ''tape file system'' is a file system and tape format designed to store files on tape. [[Physics:Magnetic tape|Magnetic tape]]s are sequential storage media with significantly longer random data access times than disks, posing challenges to the creation and efficient management of a general-purpose file system.


Line 174: Line 242:
IBM has developed a file system for tape called the [[Linear Tape File System]]. The IBM implementation of this file system has been released as the open-source [[Linear Tape File System#IBM Linear Tape File System - Single Drive Edition|IBM Linear Tape File System — Single Drive Edition (LTFS-SDE)]] product. The Linear Tape File System uses a separate partition on the tape to record the index meta-data, thereby avoiding the problems associated with scattering directory entries across the entire tape.
IBM has developed a file system for tape called the [[Linear Tape File System]]. The IBM implementation of this file system has been released as the open-source [[Linear Tape File System#IBM Linear Tape File System - Single Drive Edition|IBM Linear Tape File System — Single Drive Edition (LTFS-SDE)]] product. The Linear Tape File System uses a separate partition on the tape to record the index meta-data, thereby avoiding the problems associated with scattering directory entries across the entire tape.


====Tape formatting====
===== Tape formatting =====
Writing data to a tape, erasing, or formatting a tape is often a significantly time-consuming process and can take several hours on large tapes.{{Efn|An LTO-6 2.5 TB tape requires more than 4 hours to write at 160 MB/Sec}} With many data tape technologies it is not necessary to format the tape before over-writing new data to the tape. This is due to the inherently destructive nature of overwriting data on sequential media.
 
Writing data to a tape, erasing, or formatting a tape is often a significantly time-consuming process and can take several hours on large tapes.{{Efn|An LTO-6 2.5 TB tape requires more than 4 hours to write at 160 MB/Sec}} With many data tape technologies it is not necessary to format the tape before over-writing new data to the tape. This is due to the inherently destructive nature of overwriting data on sequential media.


Because of the time it can take to format a tape, typically tapes are pre-formatted so that the tape user does not need to spend time preparing each new tape for use. All that is usually necessary is to write an identifying media label to the tape before use, and even this can be automatically written by software when a new tape is used for the first time.
Because of the time it can take to format a tape, typically tapes are pre-formatted so that the tape user does not need to spend time preparing each new tape for use. All that is usually necessary is to write an identifying media label to the tape before use, and even this can be automatically written by software when a new tape is used for the first time.
====Minimal file system / audio-cassette storage====
In the 1970s disk and digital tape devices were too expensive for some early [[Microcomputer|microcomputer]] users. An inexpensive basic data storage system was devised that used common audio cassette tape.
When the system needed to write data, the user was notified to press "RECORD" on the cassette recorder, then press "RETURN" on the keyboard to notify the system that the cassette recorder was recording. The system wrote a sound to provide time synchronization, then [[Kansas City standard|modulated sounds]] that encoded a prefix, the data, a [[Checksum|checksum]] and a suffix. When the system needed to read data, the user was instructed to press "PLAY" on the cassette recorder. The system would ''listen'' to the sounds on the tape waiting until a burst of sound could be recognized as the synchronization. The system would then interpret subsequent sounds as data. When the data read was complete, the system would notify the user to press "STOP" on the cassette recorder. It was primitive, but it (mostly) worked. Data was stored sequentially, usually in an unnamed format, although some systems (such as the Commodore PET series of computers) did allow the files to be named. Multiple sets of data could be written and located by fast-forwarding the tape and observing at the tape counter to find the approximate start of the next data region on the tape. The user might have to listen to the sounds to find the right spot to begin playing the next data region. Some implementations even included audible sounds interspersed with the data.


===Database file systems===
===Database file systems===
Another concept for file management is the idea of a database-based file system. Instead of, or in addition to, hierarchical structured management, files are identified by their characteristics, like type of file, topic, author, or similar rich metadata.<ref>{{cite web|url=https://www.theregister.co.uk/2002/03/29/windows_on_a_database_sliced/ |title=Windows on a database – sliced and diced by BeOS vets |publisher=theregister.co.uk |date=2002-03-29 |access-date=2014-02-07}}</ref>
Another concept for file management is the idea of a database-based file system. Instead of, or in addition to, hierarchical structured management, files are identified by their characteristics, like type of file, topic, author, or similar rich metadata.<ref>{{cite web|url=https://www.theregister.co.uk/2002/03/29/windows_on_a_database_sliced/ |title=Windows on a database – sliced and diced by BeOS vets |publisher=theregister.co.uk |date=2002-03-29 |access-date=2014-02-07}}</ref>


 
IBM DB2 for i <ref>{{cite web|url=http://www-03.ibm.com/systems/i/software/db2/index.html |title=IBM DB2 for i: Overview |publisher=03.ibm.com |access-date=2014-02-07 |archive-url=https://web.archive.org/web/20130802153156/http://www-03.ibm.com/systems/i/software/db2/index.html |archive-date=2013-08-02 |url-status=dead}}</ref> (formerly known as DB2/400 and DB2 for i5/OS) is a database file system as part of the object based [[Software:IBM i|IBM i]]<ref>{{cite web|url=http://www.ibm.com/developerworks/ibmi/newto/ |title=IBM developerWorks : New to IBM i |publisher=Ibm.com |date=2011-03-08 |access-date=2014-02-07}}</ref> operating system (formerly known as OS/400 and i5/OS), incorporating a single level store and running on IBM Power Systems (formerly known as AS/400 and iSeries), designed by Frank G. Soltis IBM's former chief scientist for IBM i. Around 1978 to 1988 Frank G. Soltis and his team at IBM Rochester had successfully designed and applied technologies like the database file system where others like Microsoft later failed to accomplish.<ref>{{cite web |url=https://www.theregister.co.uk/2002/01/28/xp_successor_longhorn_goes_sql/ |title=XP successor Longhorn goes SQL, P2P – Microsoft leaks |publisher=theregister.co.uk |date=2002-01-28 |access-date=2014-02-07}}</ref> These technologies are informally known as 'Fortress Rochester' and were in few basic aspects extended from early Mainframe technologies but in many ways more advanced from a technological perspective{{Citation needed|date = June 2014|reason = Is there any articles supporting this technological superiority?}}.
Some other projects that are not "pure" database file systems but that use some aspects of a database file system:
Some other projects that are not "pure" database file systems but that use some aspects of a database file system:
* Many [[Web content management system]]s use a relational DBMS to store and retrieve files. For example, [[XHTML]] files are stored as [[XML]] or text fields, while image files are stored as blob fields; [[SQL]] SELECT (with optional [[XPath]]) statements retrieve the files, and allow the use of a sophisticated logic and more rich information associations than "usual file systems." Many CMSs also have the option of storing only [[Metadata|metadata]] within the database, with the standard filesystem used to store the content of files.
* Many [[Web content management system]]s use a relational DBMS to store and retrieve files. For example, [[XHTML]] files are stored as [[XML]] or text fields, while image files are stored as blob fields; [[SQL]] SELECT (with optional [[XPath]]) statements retrieve the files, and allow the use of a sophisticated logic and more rich information associations than "usual file systems." Many CMSs also have the option of storing only [[Metadata|metadata]] within the database, with the standard filesystem used to store the content of files.
Line 203: Line 277:
===Network file systems===
===Network file systems===


A ''network file system'' is a file system that acts as a client for a remote file access protocol, providing access to files on a server. Programs using local interfaces can transparently create, manage and access hierarchical directories and files in remote network-connected computers. Examples of network file systems include clients for the NFS, AFS, [[Server Message Block|SMB]] protocols, and file-system-like clients for [[File Transfer Protocol|FTP]] and [[WebDAV]].
A ''network file system'' is a file system that acts as a client for a remote file access protocol, providing access to files on a server. Programs using local interfaces can transparently create, manage and access hierarchical directories and files in remote network-connected computers. Examples of network file systems include clients for the NFS,<ref>{{citation|title=Sun's Network File System|url=http://pages.cs.wisc.edu/~remzi/OSTEP/dist-nfs.pdf|publisher= Arpaci-Dusseau Books|year = 2014|first1 = Remzi H.|last1 =Arpaci-Dusseau|first2=Andrea C.|last2 = Arpaci-Dusseau}}</ref> [[Andrew File System|AFS]], [[Server Message Block|SMB]] protocols, and file-system-like clients for [[File Transfer Protocol|FTP]] and [[WebDAV]].


===Shared disk file systems===
===Shared disk file systems===


A ''shared disk file system'' is one in which a number of machines (usually servers) all have access to the same external disk subsystem (usually a [[Storage area network|storage area network]]). The file system arbitrates access to that subsystem, preventing write collisions.<ref>{{cite book|url=https://books.google.com/books?id=TUtrRoDhNm4C&pg=PA124|title=Storage Networks Explained: Basics and Application of Fibre Channel SAN, NAS, iSCSI and InfiniBand|last1=Troppens|first1=Ulf|last2=Erkens|first2=Rainer|last3=Müller|first3=Wolfgang|publisher={{wipe|John Wiley & Sons}}|date=2004|access-date=June 30, 2022|pages=124–125|isbn=0-470-86182-7}}</ref> Examples include [[GFS2]] from [[Company:Red Hat|Red Hat]], GPFS, now known as Spectrum Scale, from IBM, SFS from DataPlow, [[CXFS]] from [[Company:Silicon Graphics International|SGI]], StorNext from [[Company:Quantum Corporation|Quantum Corporation]] and ScoutFS from Versity.
A ''shared disk file system'' is one in which a number of machines (usually servers) all have access to the same external disk subsystem (usually a [[Storage area network|storage area network]]). The file system arbitrates access to that subsystem, preventing write collisions.<ref>{{cite book|url=https://books.google.com/books?id=TUtrRoDhNm4C&pg=PA124|title=Storage Networks Explained: Basics and Application of Fibre Channel SAN, NAS, iSCSI and InfiniBand|last1=Troppens|first1=Ulf|last2=Erkens|first2=Rainer|last3=Müller|first3=Wolfgang|publisher=[[Company:John Wiley & Sons|John Wiley & Sons]]|date=2004|access-date=June 30, 2022|pages=124–125|isbn=0-470-86182-7}}</ref> Examples include [[GFS2]] from [[Company:Red Hat|Red Hat]], GPFS, now known as Spectrum Scale, from IBM, SFS from DataPlow, [[CXFS]] from [[Company:Silicon Graphics International|SGI]], StorNext from [[Company:Quantum Corporation|Quantum Corporation]] and ScoutFS from Versity.
 
=== Special file systems ===
{{anchor|special file system}}
 
Some file systems expose elements of the operating system as files so they can be acted on via the [[File system API|file system API]]. This is common in [[Unix-like]] operating systems, and to a lesser extent in other operating systems. Examples include:
 
{{anchor|device file system}}
* devfs, [[Software:Udev|udev]], [[Software:TOPS-10|TOPS-10]] expose I/O devices or pseudo-devices as special files
* [[Configfs|configfs]] and [[Sysfs|sysfs]] expose special files that can be used to query and configure [[Software:Linux|Linux]] kernel information
* [[Procfs|procfs]] exposes process information as special files
 
===Directory hierarchy support===


===Special file systems {{anchor|special file system}}===
====Flat file systems====
A ''special file system'' presents non-file elements of an operating system as files so they can be acted on using file system APIs. This is most commonly done in [[Unix-like]] operating systems, but devices are given file names in some non-Unix-like operating systems as well.
<!-- linked from redirect Flat file system -->
{{Distinguish|Flat-file database}}
In a flat file system, there are no subdirectories; files are stored on a disk without hierarchy. While simple, this become awkward as the number of files grows and makes it difficult to organize files into related groups.


====Device file systems {{anchor|device file system}}====
The mainframe DOS/360 and OS/360 store entries for all files on a disk pack (''volume'') in a directory on the pack called a ''[[Volume Table of Contents]]'' (VTOC).
A ''device file system'' represents I/O devices and pseudo-devices as files, called [[Device file|device file]]s. Examples in [[Unix-like]] systems include devfs and, in [[Software:Linux|Linux]] 2.6 systems, [[Software:Udev|udev]]. In non-Unix-like systems, such as [[Software:TOPS-10|TOPS-10]] and other operating systems influenced by it, where the full filename or pathname of a file can include a device prefix, devices other than those containing file systems are referred to by a device prefix specifying the device, without anything following it.


====Other special file systems====
Some [[Minicomputer|minicomputer]] operating systems, such as [[Software:RT-11|RT-11]], had a flat file system with only one top-level directory. Others, such as [[Software:RSX-11|RSX-11]], supported a top-level directory and subdirectories for user accounts, but did not support subdirectories of the user-account directories.
* In the Linux kernel, [[Configfs|configfs]] and [[Sysfs|sysfs]] provide files that can be used to query the kernel for information and configure entities in the kernel.
* [[Procfs|procfs]] maps processes and, on Linux, other operating system structures into a filespace.


===Minimal file system / audio-cassette storage===
Most 8-bit microcomputer operating systems originally used flat file systems (e.g., [[Software:Apple DOS|Apple DOS]], [[Software:Atari DOS|Atari DOS]]). CP/M machines use a flat file system, where files can be assigned to one of 16 ''user areas'' and generic file operations narrowed to work on one instead of defaulting to work on all of them. These user areas are no more than special attributes associated with the files; it is not necessary to define specific [[Disk quota|quota]] for each of these areas and files can be added to groups for as long as there is free storage space on the disk.
In the 1970s disk and digital tape devices were too expensive for some early [[Microcomputer|microcomputer]] users. An inexpensive basic data storage system was devised that used common audio cassette tape.


When the system needed to write data, the user was notified to press "RECORD" on the cassette recorder, then press "RETURN" on the keyboard to notify the system that the cassette recorder was recording. The system wrote a sound to provide time synchronization, then [[Kansas City standard|modulated sounds]] that encoded a prefix, the data, a [[Checksum|checksum]] and a suffix. When the system needed to read data, the user was instructed to press "PLAY" on the cassette recorder. The system would ''listen'' to the sounds on the tape waiting until a burst of sound could be recognized as the synchronization. The system would then interpret subsequent sounds as data. When the data read was complete, the system would notify the user to press "STOP" on the cassette recorder. It was primitive, but it (mostly) worked. Data was stored sequentially, usually in an unnamed format, although some systems (such as the Commodore PET series of computers) did allow the files to be named. Multiple sets of data could be written and located by fast-forwarding the tape and observing at the tape counter to find the approximate start of the next data region on the tape. The user might have to listen to the sounds to find the right spot to begin playing the next data region. Some implementations even included audible sounds interspersed with the data.
The FAT file system in [[Software:IBM PC DOS|IBM PC DOS]]/[[Software:MS-DOS|MS-DOS]] was a flat file system until DOS version 2.0, when support for subdirectories was added.


===Flat file systems===
The [[Software:Classic Mac OS|classic Mac OS]] for the [[Engineering:Macintosh|Macintosh]] supported only the flat [[Macintosh File System]] until the [[Hierarchical File System (Apple)|Hierarchical File System]] was introduced in version 2.1. The file management program, the [[Software:Finder|Finder]], created the illusion of a partially hierarchical filing system. This structure required every file to have a unique name, even if it appeared to be in a separate folder.  
<!-- linked from redirect Flat file system -->
In a flat file system, there are no subdirectories; directory entries for all files are stored in a single directory.


When [[Floppy disk|floppy disk]] media was first available this type of file system was adequate due to the relatively small amount of data space available. CP/M machines featured a flat file system, where files could be assigned to one of 16 ''user areas'' and generic file operations narrowed to work on one instead of defaulting to work on all of them. These user areas were no more than special attributes associated with the files; that is, it was not necessary to define specific [[Disk quota|quota]] for each of these areas and files could be added to groups for as long as there was still free storage space on the disk. The early [[Software:Apple Macintosh|Apple Macintosh]] also featured a flat file system, the [[Macintosh File System]]. It was unusual in that the file management program (Macintosh Finder) created the illusion of a partially hierarchical filing system on top of EMFS. This structure required every file to have a unique name, even if it appeared to be in a separate folder. [[Company:IBM|IBM]] DOS/360 and OS/360 store entries for all files on a disk pack (''volume'') in a directory on the pack called a ''[[Volume Table of Contents]]'' (VTOC).
A 21st century addition to the flat file system family is Amazon's [[Amazon S3|S3]], a remote storage service, which is intentionally simplistic to allow users the ability to customize how their data is stored. The only constructs are buckets (imagine a disk drive of unlimited size) and objects (similar, but not identical to the standard concept of a file). Advanced file management is allowed by being able to use nearly any character (including '/') in the object's name, and the ability to select subsets of the bucket's content based on identical prefixes.


While simple, flat file systems become awkward as the number of files grows and makes it difficult to organize data into related groups of files.
====Hierarchical file systems====
{{main|Hierarchical file system}}
In a [[Hierarchical file system|hierarchical file system]], all directories can have subdirectories.


A recent addition to the flat file system family is Amazon's [[Amazon S3|S3]], a remote storage service, which is intentionally simplistic to allow users the ability to customize how their data is stored. The only constructs are buckets (imagine a disk drive of unlimited size) and objects (similar, but not identical to the standard concept of a file). Advanced file management is allowed by being able to use nearly any character (including '/') in the object's name, and the ability to select subsets of the bucket's content based on identical prefixes.
== Implementations ==


==File systems and operating systems==
An [[Operating system|operating system]] (OS) typically supports one or more file systems. Sometimes an OS and its file system are so tightly interwoven that it is difficult to describe them independently.
Many [[Operating system|operating system]]s include support for more than one file system. Sometimes the OS and the file system are so tightly interwoven that it is difficult to separate out file system functions.


There needs to be an interface provided by the operating system software between the user and the file system. This interface can be textual (such as provided by a command line interface, such as the [[Unix shell]], or [[DIGITAL Command Language|OpenVMS DCL]]) or graphical (such as provided by a [[Graphical user interface|graphical user interface]], such as file browsers). If graphical, the metaphor of the ''folder'', containing documents, other files, and nested folders is often used (see also: [[Directory (file systems)|directory]] and folder).
An OS typically provides file system access to the user. Often an OS provides a [[Command line interface|command line interface]], such as a [[Unix shell]], Windows Command Prompt and [[PowerShell]], or [[DIGITAL Command Language|OpenVMS DCL]]. An OS often also provides a file browser in a [[Graphical user interface|graphical user interface]] such as [[Software:Finder|Finder]] on macOS, [[Software:File Explorer|File Explorer]] on Windows, [[Software:GNOME Files|GNOME Files]] in [[Software:GNOME|GNOME]], or [[Software:Dolphin (file manager)|Dolphin]] in [[Software:KDE Plasma|KDE Plasma]].


===Unix and Unix-like operating systems===
===Unix and Unix-like operating systems===
[[Unix-like]] operating systems create a virtual file system, which makes all the files on all the devices appear to exist in a single hierarchy. This means, in those systems, there is one root directory, and every file existing on the system is located under it somewhere. Unix-like systems can use a RAM disk or network shared resource as its root directory.
{{uncited section|date=November 2025}}<!-- excluding subsections -->
[[Unix-like]] operating systems create a virtual file system, which makes all files on all connected storage devices appear to exist in a single hierarchy. This means, in those systems, there is one root directory, and every file existing on the system is located under it somewhere. Unix-like systems can use a RAM disk or network shared resource as its root directory.


Unix-like systems assign a device name to each device, but this is not how the files on that device are accessed. Instead, to gain access to files on another device, the operating system must first be informed where in the directory tree those files should appear. This process is called [[Mount (computing)|mounting]] a file system. For example, to access the files on a [[CD-ROM]], one must tell the operating system "Take the file system from this CD-ROM and make it appear under such-and-such directory." The directory given to the operating system is called the ''mount point''&nbsp;– it might, for example, be {{mono|/media}}. The {{mono|/media}} directory exists on many Unix systems (as specified in the [[Filesystem Hierarchy Standard]]) and is intended specifically for use as a mount point for removable media such as CDs, DVDs, USB drives or floppy disks. It may be empty, or it may contain subdirectories for mounting individual devices. Generally, only the [[System administrator|administrator]] (i.e. root user) may authorize the mounting of file systems.
Unix-like systems assign a device name to each device, but this is not how the files on that device are accessed. Instead, to gain access to files on another device, the operating system must first be informed where in the directory tree those files should appear. This process is called [[Mount (computing)|mounting]] a file system. For example, to access the files on a [[CD-ROM]], one must tell the operating system "Take the file system from this CD-ROM and make it appear under such-and-such directory." The directory given to the operating system is called the ''mount point''&nbsp;– it might, for example, be {{mono|/media}}. The {{mono|/media}} directory exists on many Unix systems (as specified in the [[Filesystem Hierarchy Standard]]) and is intended specifically for use as a mount point for removable media such as CDs, DVDs, USB drives or floppy disks. It may be empty, or it may contain subdirectories for mounting individual devices. Generally, only the [[System administrator|administrator]] (i.e. root user) may authorize the mounting of file systems.
Line 250: Line 334:
<!-- supermount definition may be inaccurate -->
<!-- supermount definition may be inaccurate -->
<!-- there may be some concepts I {forgot, omitted, did not know, am not creative enough to invent} -->
<!-- there may be some concepts I {forgot, omitted, did not know, am not creative enough to invent} -->
* Progressive Unix-like systems have also introduced a concept called '''supermounting'''; see, for example, [http://sourceforge.net/projects/supermount-ng the Linux supermount-ng project]. For example, a floppy disk that has been supermounted can be physically removed from the system. Under normal circumstances, the disk should have been synchronized and then unmounted before its removal. Provided synchronization has occurred, a different disk can be inserted into the drive. The system automatically notices that the disk has changed and updates the mount point contents to reflect the new medium.
* Progressive Unix-like systems have also introduced a concept called '''supermounting'''; see, for example, [https://sourceforge.net/projects/supermount-ng the Linux supermount-ng project]. For example, a floppy disk that has been supermounted can be physically removed from the system. Under normal circumstances, the disk should have been synchronized and then unmounted before its removal. Provided synchronization has occurred, a different disk can be inserted into the drive. The system automatically notices that the disk has changed and updates the mount point contents to reflect the new medium.
* An [[Automounter|automounter]] will automatically mount a file system when a reference is made to the directory atop which it should be mounted. This is usually used for file systems on network servers, rather than relying on events such as the insertion of media, as would be appropriate for removable media.
* An [[Automounter|automounter]] will automatically mount a file system when a reference is made to the directory atop which it should be mounted. This is usually used for file systems on network servers, rather than relying on events such as the insertion of media, as would be appropriate for removable media.


===={{Anchor|LINUX}}Linux====
====<span class="anchor" id="LINUX"></span>Linux====
{{uncited section|date=November 2025}}
[[Software:Linux|Linux]] supports numerous file systems, but common choices for the system disk on a block device include the ext* family ([[Ext2|ext2]], [[Ext3|ext3]] and [[Ext4|ext4]]), [[XFS]], [[JFS (file system)|JFS]], and [[Btrfs|btrfs]]. For raw flash without a [[Software:Flash translation layer|flash translation layer]] (FTL) or [[Engineering:Memory Technology Device|Memory Technology Device]] (MTD), there are [[UBIFS]], [[JFFS2]] and YAFFS, among others. [[SquashFS]] is a common compressed read-only file system.
[[Software:Linux|Linux]] supports numerous file systems, but common choices for the system disk on a block device include the ext* family ([[Ext2|ext2]], [[Ext3|ext3]] and [[Ext4|ext4]]), [[XFS]], [[JFS (file system)|JFS]], and [[Btrfs|btrfs]]. For raw flash without a [[Software:Flash translation layer|flash translation layer]] (FTL) or [[Engineering:Memory Technology Device|Memory Technology Device]] (MTD), there are [[UBIFS]], [[JFFS2]] and YAFFS, among others. [[SquashFS]] is a common compressed read-only file system.


====Solaris====
====Solaris====
{{uncited section|date=November 2025}}
[[Software:Solaris (operating system)|Solaris]] in earlier releases defaulted to (non-journaled or non-logging) [[Unix File System|UFS]] for bootable and supplementary file systems. Solaris defaulted to, supported, and extended UFS.
[[Software:Solaris (operating system)|Solaris]] in earlier releases defaulted to (non-journaled or non-logging) [[Unix File System|UFS]] for bootable and supplementary file systems. Solaris defaulted to, supported, and extended UFS.


Line 266: Line 352:


====macOS====
====macOS====
{{needs more citations|date=November 2025}}
[[Software:MacOS|macOS (formerly Mac OS X)]] uses the [[Apple File System]] (APFS), which in 2017 replaced a file system inherited from [[Software:Classic Mac OS|classic Mac OS]] called [[HFS Plus]] (HFS+). Apple also uses the term "Mac OS Extended" for HFS+.<ref>{{cite web|title=Mac OS X: About file system journaling|url=http://support.apple.com/kb/ht2355|publisher=Apple|access-date=8 February 2014}}</ref> HFS Plus is a metadata-rich and [[Case preservation|case-preserving]] but (usually) case-insensitive file system. Due to the Unix roots of macOS, Unix permissions were added to HFS Plus. Later versions of HFS Plus added journaling to prevent corruption of the file system structure and introduced a number of optimizations to the allocation algorithms in an attempt to defragment files automatically without requiring an external defragmenter.
[[Software:MacOS|macOS (formerly Mac OS X)]] uses the [[Apple File System]] (APFS), which in 2017 replaced a file system inherited from [[Software:Classic Mac OS|classic Mac OS]] called [[HFS Plus]] (HFS+). Apple also uses the term "Mac OS Extended" for HFS+.<ref>{{cite web|title=Mac OS X: About file system journaling|url=http://support.apple.com/kb/ht2355|publisher=Apple|access-date=8 February 2014}}</ref> HFS Plus is a metadata-rich and [[Case preservation|case-preserving]] but (usually) case-insensitive file system. Due to the Unix roots of macOS, Unix permissions were added to HFS Plus. Later versions of HFS Plus added journaling to prevent corruption of the file system structure and introduced a number of optimizations to the allocation algorithms in an attempt to defragment files automatically without requiring an external defragmenter.


Filenames can be up to 255 characters. HFS Plus uses [[Unicode]] to store filenames. On macOS, the [[File format|filetype]] can come from the [[Type code|type code]], stored in file's metadata, or the [[Filename extension|filename extension]].
File names can be up to 255 characters. HFS Plus uses [[Unicode]] to store file names. On macOS, the [[File format|filetype]] can come from the [[Type code|type code]], stored in file's metadata, or the [[Filename extension|filename extension]].


HFS Plus has three kinds of links: Unix-style [[Hard link|hard link]]s, Unix-style [[Symbolic link|symbolic link]]s, and [[Software:Alias (Mac OS)|aliases]]. Aliases are designed to maintain a link to their original file even if they are moved or renamed; they are not interpreted by the file system itself, but by the File Manager code in userland.
HFS Plus has three kinds of links: Unix-style [[Hard link|hard link]]s, Unix-style [[Symbolic link|symbolic link]]s, and [[Software:Alias (Mac OS)|aliases]]. Aliases are designed to maintain a link to their original file even if they are moved or renamed; they are not interpreted by the file system itself, but by the File Manager code in userland.


macOS 10.13 High Sierra, which was announced on June 5, 2017 at Apple's WWDC event, uses the [[Apple File System]] on [[Solid-state drive|solid-state drive]]s.
macOS 10.13 High Sierra, which was announced on June 5, 2017, at Apple's WWDC event, uses the [[Apple File System]] on [[Solid-state drive|solid-state drive]]s.


macOS also supported the [[Unix File System|UFS]] file system, derived from the BSD Unix Fast File System via [[Software:NeXTSTEP|NeXTSTEP]]. However, as of [[Software:Mac OS X Leopard|Mac OS X Leopard]], macOS could no longer be installed on a UFS volume, nor can a pre-Leopard system installed on a UFS volume be upgraded to Leopard.<ref>{{cite web|url=http://docs.info.apple.com/article.html?artnum=306516|title=Mac OS X 10.5 Leopard: Installing on a UFS-formatted volume|work=apple.com|date=19 October 2007|access-date=29 April 2016|archive-url=https://web.archive.org/web/20080316033439/http://docs.info.apple.com/article.html?artnum=306516|archive-date=16 March 2008|url-status=dead}}</ref> As of [[Software:Mac OS X Lion|Mac OS X Lion]] UFS support was completely dropped.
macOS also supported the [[Unix File System|UFS]] file system, derived from the BSD Unix Fast File System via [[Software:NeXTSTEP|NeXTSTEP]]. However, as of [[Software:Mac OS X Leopard|Mac OS X Leopard]], macOS could no longer be installed on a UFS volume, nor can a pre-Leopard system installed on a UFS volume be upgraded to Leopard.<ref>{{cite web|url=http://docs.info.apple.com/article.html?artnum=306516|title=Mac OS X 10.5 Leopard: Installing on a UFS-formatted volume|work=apple.com|date=19 October 2007|access-date=29 April 2016|archive-url=https://web.archive.org/web/20080316033439/http://docs.info.apple.com/article.html?artnum=306516|archive-date=16 March 2008|url-status=dead}}</ref> As of [[Software:Mac OS X Lion|Mac OS X Lion]] UFS support was completely dropped.


Newer versions of macOS are capable of reading and writing to the legacy [[File Allocation Table|FAT]] file systems (16 and 32) common on Windows. They are also capable of ''reading'' the newer [[NTFS]] file systems for Windows. In order to ''write'' to NTFS file systems on macOS versions prior to [[Software:Mac OS X Snow Leopard|Mac OS X Snow Leopard]] third party software is necessary. Mac OS X 10.6 (Snow Leopard) and later allow writing to NTFS file systems, but only after a non-trivial system setting change (third party software exists that automates this).<ref>{{cite web|last=OSXDaily|title=How to Enable NTFS Write Support in Mac OS X|url=http://osxdaily.com/2013/10/02/enable-ntfs-write-support-mac-os-x/|access-date=6 February 2014|date=2013-10-02}}</ref>
Newer versions of macOS are capable of reading and writing to the legacy [[File Allocation Table|FAT]] file systems (16 and 32) common on Windows. They are also capable of ''reading'' the newer [[NTFS]] file systems for Windows. In order to ''write'' to NTFS file systems on macOS versions prior to [[Software:Mac OS X Snow Leopard|Mac OS X Snow Leopard]] third-party software is necessary. Mac OS X 10.6 (Snow Leopard) and later allow writing to NTFS file systems, but only after a non-trivial system setting change (third-party software exists that automates this).<ref>{{cite web|last=OSXDaily|title=How to Enable NTFS Write Support in Mac OS X|url=http://osxdaily.com/2013/10/02/enable-ntfs-write-support-mac-os-x/|access-date=6 February 2014|date=2013-10-02}}</ref>


Finally, macOS supports reading and writing of the [[ExFAT|exFAT]] file system since Mac OS X Snow Leopard, starting from version 10.6.5.<ref name="encase-book">{{cite book|url=https://books.google.com/books?id=c1mezk6uHfIC&q=os+x+exfat+10.6.5&pg=PA79 |title=EnCase Computer Forensics - The Official EnCE: EnCase Certified Examiner |author=Steve Bunting |date=2012-08-14 |access-date=2014-02-07|isbn=9781118219409 }}</ref>
Finally, macOS supports reading and writing of the [[ExFAT|exFAT]] file system since Mac OS X Snow Leopard, starting from version 10.6.5.<ref name="encase-book">{{cite book|url=https://books.google.com/books?id=c1mezk6uHfIC&q=os+x+exfat+10.6.5&pg=PA79 |title=EnCase Computer Forensics - The Official EnCE: EnCase Certified Examiner |author=Steve Bunting |date=2012-08-14 |publisher=Wiley |access-date=2014-02-07|isbn=9781118219409 }}</ref>


===OS/2===
===OS/2===
Line 287: Line 374:


===Plan 9===
===Plan 9===
Plan&nbsp;9 from Bell Labs treats everything as a file and accesses all objects as a file would be accessed (i.e., there is no [[Ioctl|ioctl]] or [[Mmap|mmap]]): networking, graphics, debugging, authentication, capabilities, encryption, and other services are accessed via I/O operations on [[File descriptor|file descriptor]]s. The [[9P (protocol)|9P]] protocol removes the difference between local and remote files. File systems in Plan&nbsp;9 are organized with the help of private, per-process namespaces, allowing each process to have a different view of the many file systems that provide resources in a distributed system.
{{uncited section|date=November 2025}}
Plan&nbsp;9 from Bell Labs treats everything as a file and accesses all objects as a file would be accessed (i.e., there is no [[Ioctl|ioctl]] or [[Mmap|mmap]]): networking, graphics, debugging, authentication, capabilities, encryption, and other services are accessed via I/O operations on [[File descriptor|file descriptor]]s. The [[9P (protocol)|9P]] protocol removes the difference between local and remote files. File systems in Plan&nbsp;9 are organized with the help of private, per-process namespaces, allowing each process to have a different view of the many file systems that provide resources in a distributed system.


The [[Software:Inferno (operating system)|Inferno]] operating system shares these concepts with Plan&nbsp;9.
The [[Software:Inferno (operating system)|Inferno]] operating system shares these concepts with Plan&nbsp;9.


===Microsoft Windows===
===Microsoft Windows===
[[File:Dir command in Windows Command Prompt.png|thumb|right|300px|Directory listing in a Windows command shell]]
{{needs more citations|date=November 2025}}
[[File:Dir command in Windows Command Prompt.png|thumb|right|300px|Directory listing in a [[Software:Microsoft Windows|Windows]] command shell]]
Windows makes use of the [[File Allocation Table|FAT]], [[NTFS]], [[ExFAT|exFAT]], [[Live File System]] and ReFS file systems (the last of these is only supported and usable in [[Software:Windows Server 2012|Windows Server 2012]], [[Software:Windows Server 2016|Windows Server 2016]], [[Software:Windows 8|Windows 8]], [[Software:Windows 8.1|Windows 8.1]], and [[Software:Windows 10|Windows 10]]; Windows cannot boot from it).
Windows makes use of the [[File Allocation Table|FAT]], [[NTFS]], [[ExFAT|exFAT]], [[Live File System]] and ReFS file systems (the last of these is only supported and usable in [[Software:Windows Server 2012|Windows Server 2012]], [[Software:Windows Server 2016|Windows Server 2016]], [[Software:Windows 8|Windows 8]], [[Software:Windows 8.1|Windows 8.1]], and [[Software:Windows 10|Windows 10]]; Windows cannot boot from it).


Line 302: Line 391:
The family of [[File Allocation Table|FAT]] file systems is supported by almost all operating systems for personal computers, including all versions of [[Software:Microsoft Windows|Windows]] and [[Software:MS-DOS|MS-DOS]]/PC&nbsp;DOS, OS/2, and [[Software:DR-DOS|DR-DOS]]. (PC&nbsp;DOS is an OEM version of MS-DOS, MS-DOS was originally based on [[Company:Seattle Computer Products|SCP]]'s [[Software:86-DOS|86-DOS]]. DR-DOS was based on [[Company:Digital Research|Digital Research]]'s [[Software:Concurrent DOS|Concurrent DOS]], a successor of CP/M-86.) The FAT file systems are therefore well-suited as a universal exchange format between computers and devices of most any type and age.
The family of [[File Allocation Table|FAT]] file systems is supported by almost all operating systems for personal computers, including all versions of [[Software:Microsoft Windows|Windows]] and [[Software:MS-DOS|MS-DOS]]/PC&nbsp;DOS, OS/2, and [[Software:DR-DOS|DR-DOS]]. (PC&nbsp;DOS is an OEM version of MS-DOS, MS-DOS was originally based on [[Company:Seattle Computer Products|SCP]]'s [[Software:86-DOS|86-DOS]]. DR-DOS was based on [[Company:Digital Research|Digital Research]]'s [[Software:Concurrent DOS|Concurrent DOS]], a successor of CP/M-86.) The FAT file systems are therefore well-suited as a universal exchange format between computers and devices of most any type and age.


The FAT file system traces its roots back to an (incompatible) 8-bit FAT precursor in Standalone Disk BASIC and the short-lived MDOS/MIDAS project.{{Citation needed|date=September 2012}}


Over the years, the file system has been expanded from [[FAT12]] to [[FAT16]] and [[FAT32]]. Various features have been added to the file system including subdirectories, codepage support, extended attributes, and long filenames. Third parties such as Digital Research have incorporated optional support for deletion tracking, and volume/directory/file-based multi-user security schemes to support file and directory passwords and permissions such as read/write/execute/delete access rights. Most of these extensions are not supported by Windows.
Over the years, the file system has been expanded from [[FAT12]] to [[FAT16]] and [[FAT32]]. Various features have been added to the file system including subdirectories, codepage support, extended attributes, and long filenames. Third parties such as Digital Research have incorporated optional support for deletion tracking, and volume/directory/file-based multi-user security schemes to support file and directory passwords and permissions such as read/write/execute/delete access rights. Most of these extensions are not supported by Windows.
Line 318: Line 406:


====exFAT====
====exFAT====
{{Main|ExFAT}}


[[ExFAT|exFAT]] has certain advantages over NTFS with regard to file system overhead.{{citation needed|date=March 2021}}


exFAT is not backward compatible with FAT file systems such as FAT12, FAT16 or FAT32. The file system is supported with newer Windows systems, such as Windows XP, Windows Server 2003, Windows Vista, Windows 2008, Windows 7, Windows 8, Windows 8.1, Windows 10 and Windows 11.
exFAT is not backward compatible with FAT file systems such as FAT12, FAT16 or FAT32. The file system is supported with newer Windows systems, such as Windows XP, Windows Server 2003, Windows Vista, Windows 2008, Windows 7, Windows 8, Windows 8.1, Windows 10 and Windows 11.


exFAT is supported in macOS starting with version 10.6.5 (Snow Leopard).<ref name="encase-book" /> Support in other operating systems is sparse since implementing support for exFAT requires a license. exFAT is the only file system that is fully supported on both macOS and Windows that can hold files larger than 4&nbsp;GB.<ref>{{cite web|url=https://support.apple.com/guide/disk-utility/dsku19ed921c/mac|title=File system formats available in Disk Utility on Mac|website=Apple Support}}</ref><ref>{{cite web|url=https://docs.microsoft.com/en-us/windows/win32/fileio/exfat-specification|title=exFAT file system specification|website=Microsoft Docs}}</ref>
exFAT is supported in macOS starting with version 10.6.5 (Snow Leopard).<ref name="encase-book" /> Support in other operating systems is sparse since implementing support for exFAT requires a license. exFAT is the only file system that is fully supported on both macOS and Windows that can hold files larger than 4&nbsp;GB.<ref>{{cite web|url=https://support.apple.com/guide/disk-utility/dsku19ed921c/mac|title=File system formats available in Disk Utility on Mac|website=Apple Support}}</ref><ref>{{cite web|url=https://docs.microsoft.com/en-us/windows/win32/fileio/exfat-specification|title=exFAT file system specification|website=Microsoft Docs}}</ref>


===OpenVMS===
===OpenVMS===
Line 330: Line 416:


===MVS===
===MVS===
Prior to the introduction of VSAM, OS/360 systems implemented a hybrid file system. The system was designed to easily support [[Removable media|removable disk packs]], so the information relating to all files on one disk (''volume'' in IBM terminology) is stored on that disk in a flat system file called the ''[[Volume Table of Contents]]'' (VTOC). The VTOC stores all metadata for the file. Later a hierarchical directory structure was imposed with the introduction of the ''System Catalog'', which can optionally catalog files (datasets) on resident and removable volumes. The catalog only contains information to relate a dataset to a specific volume. If the user requests access to a dataset on an offline volume, and they have suitable privileges, the system will attempt to mount the required volume. Cataloged and non-cataloged datasets can still be accessed using information in the VTOC, bypassing the catalog, if the required volume id is provided to the OPEN request. Still later the VTOC was indexed to speed up access.
Prior to the introduction of VSAM, OS/360 systems implemented a hybrid file system. The system was designed to easily support [[Removable media|removable disk packs]], so the information relating to all files on one disk (''volume'' in IBM terminology) is stored on that disk in a flat system file called the ''[[Volume Table of Contents]]'' (VTOC). The VTOC stores all metadata for the file. Later a hierarchical directory structure was imposed with the introduction of the ''System Catalog'', which can optionally catalog files (datasets) on resident and removable volumes. The catalog only contains information to relate a dataset to a specific volume. If the user requests access to a dataset on an offline volume, and they have suitable privileges, the system will attempt to mount the required volume. Cataloged and non-cataloged datasets can still be accessed using information in the VTOC, bypassing the catalog, if the required volume id is provided to the OPEN request. Still later the VTOC was indexed to speed up access.


===Conversational Monitor System===
===Conversational Monitor System===
Line 337: Line 423:


===AS/400 file system===
===AS/400 file system===
{{uncited section|date=November 2025}}
Data on the AS/400 and its successors consists of system objects mapped into the system virtual address space in a single-level store. Many types of objects are defined including the directories and files found in other file systems. File objects, along with other types of objects, form the basis of the AS/400's support for an integrated [[Relational database|relational database]].
Data on the AS/400 and its successors consists of system objects mapped into the system virtual address space in a single-level store. Many types of objects are defined including the directories and files found in other file systems. File objects, along with other types of objects, form the basis of the AS/400's support for an integrated [[Relational database|relational database]].


===Other file systems===
===Other file systems===
* The Prospero File System is a file system based on the Virtual System Model.<ref>{{cite book|url=http://citeseer.ist.psu.edu/viewdoc/summary?doi=10.1.1.132.7982|title=The Prospero File System: A Global File System Based on the Virtual System Model|year=1992}}</ref> The system was created by B. Clifford Neuman of the Information Sciences Institute at the University of Southern California.
* [[Flex machine#RSRE FLEX Computer System|RSRE FLEX file system]] - written in [[ALGOL 68]]{{cn|date=November 2025}}
* [[Flex machine#RSRE FLEX Computer System|RSRE FLEX file system]] - written in [[ALGOL 68]]
* The file system of the [[Software:Michigan Terminal System|Michigan Terminal System]] (MTS) is interesting because: (i) it provides "line files" where record lengths and line numbers are associated as metadata with each record in the file, lines can be added, replaced, updated with the same or different length records, and deleted anywhere in the file without the need to read and rewrite the entire file; (ii) using program keys files may be shared or permitted to commands and programs in addition to users and groups; and (iii) there is a comprehensive file locking mechanism that protects both the file's data and its metadata.<ref>{{cite journal|title=A file system for a general-purpose time-sharing environment|first=G. C.|last=Pirkola|journal=[[Proceedings of the IEEE]]|date=June 1975|volume=63|issue=6|pages=918–924|doi=10.1109/PROC.1975.9856 |bibcode=1975IEEEP..63..918P |s2cid=12982770 |issn=0018-9219}}</ref><ref name=Protection1977>{{cite conference|url=https://docs.google.com/viewer?a=v&pid=sites&srcid=ZGVmYXVsdGRvbWFpbnxtaWNoaWdhbnRlcm1pbmFsc3lzdGVtfGd4Ojc5MTAxNzg1NTVmMjg5Mzk|title=The Protection of Information in a General Purpose Time-Sharing Environment|first1=Gary C.|last1=Pirkola|first2=John|last2=Sanguinetti|book-title=Proceedings of the IEEE Symposium on Trends and Applications 1977: Computer Security and Integrity|volume=10|issue=4|pages=106–114}}</ref>
* The file system of the [[Software:Michigan Terminal System|Michigan Terminal System]] (MTS) is interesting because: (i) it provides "line files" where record lengths and line numbers are associated as metadata with each record in the file, lines can be added, replaced, updated with the same or different length records, and deleted anywhere in the file without the need to read and rewrite the entire file; (ii) using program keys files may be shared or permitted to commands and programs in addition to users and groups; and (iii) there is a comprehensive file locking mechanism that protects both the file's data and its metadata.<ref>{{cite journal|url=https://ieeexplore.ieee.org/document/1451786|title=A file system for a general-purpose time-sharing environment|first=G. C.|last=Pirkola|journal=[[Proceedings of the IEEE]]|date=June 1975|volume=63|issue=6|pages=918–924|doi=10.1109/PROC.1975.9856 |s2cid=12982770 |issn=0018-9219}}</ref><ref name=Protection1977>{{cite conference|url=https://docs.google.com/viewer?a=v&pid=sites&srcid=ZGVmYXVsdGRvbWFpbnxtaWNoaWdhbnRlcm1pbmFsc3lzdGVtfGd4Ojc5MTAxNzg1NTVmMjg5Mzk|title=The Protection of Information in a General Purpose Time-Sharing Environment|first1=Gary C.|last1=Pirkola|first2=John|last2=Sanguinetti|book-title=Proceedings of the IEEE Symposium on Trends and Applications 1977: Computer Security and Integrity|volume=10|issue=4|pages=106–114}}</ref>
* [[Software:TempleOS|TempleOS]] uses RedSea, a file system made by Terry A. Davis.<ref name="00yK1">{{Cite web|last=Davis|first=Terry A.|date=n.d.|url=http://www.templeos.org/Wb/Doc/Features.html#l1|title=The Temple Operating System|website=www.templeos.org|access-date=March 30, 2017|url-status=dead|archive-url=https://web.archive.org/web/20170331120502/http://www.templeos.org/Wb/Doc/Features.html#l1|archive-date=March 31, 2017}}</ref>
 
== Limitations ==
 
=== Design limitations ===
{{uncited section|date=November 2025}}


==Limitations==
File systems limit [[Software:Comparison of file systems#Limits|storable data capacity]] {{endash}} generally driven by the typical size of storage devices at the time the file system is designed and anticipated into the foreseeable future.
 
Since storage sizes have increased at near [[Exponential growth|exponential]] rate (see [[Moore's law]]), newer storage devices often exceed existing file system limits within only a few years after introduction.{{Update inline|date=November 2025|?=yes}} This requires new file systems with ever increasing capacity.
 
With higher capacity, the need for capabilities and therefore complexity increases as well. File system complexity typically varies proportionally with available storage capacity. Capacity issues aside, the file systems of early 1980s [[Engineering:Home computer|home computer]]s with 50&nbsp;KB to 512&nbsp;KB of storage would not be a reasonable choice for modern storage systems with hundreds of gigabytes of capacity. Likewise, modern file systems would not be a reasonable choice for these early systems, since the complexity of modern file system structures would quickly consume the limited capacity of early storage systems.


===Converting the type of a file system===
===Converting the type of a file system===
Line 360: Line 456:


===Long file paths and long file names===
===Long file paths and long file names===
In [[Hierarchical file system|hierarchical file system]]s, files are accessed by means of a ''[[Path (computing)|path]]'' that is a branching list of directories containing the file. Different file systems have different limits on the depth of the path. File systems also have a limit on the length of an individual filename.
In [[Hierarchical file system|hierarchical file system]]s, files are accessed by means of a ''[[Path (computing)|path]]'' that is a branching list of directories containing the file. Different file systems have different limits on the depth of the path. File systems also have a limit on the length of an individual file name.


Copying files with long names or located in paths of significant depth from one file system to another may cause undesirable results. This depends on how the utility doing the copying handles the discrepancy.
Copying files with long names or located in paths of significant depth from one file system to another may cause undesirable results. This depends on how the utility doing the copying handles the discrepancy.
Line 367: Line 463:
{{Div col|colwidth=25em}}
{{Div col|colwidth=25em}}
* [[Software:Comparison of file systems|Comparison of file systems]]
* [[Software:Comparison of file systems|Comparison of file systems]]
* [[Computer data storage]]
* [[Disk quota]]
* [[Disk quota]]
* [[List of file systems]]
* [[List of file systems]]
Line 379: Line 476:
* [[Global file system]]
* [[Global file system]]
* [[Object storage]]
* [[Object storage]]
* [[Computer data storage]]
* [[Storage efficiency]]
* [[Storage efficiency]]
* [[Synthetic file system]]
* [[Virtual file system]]
* [[Virtual file system]]
{{div col end}}
{{div col end}}
Line 397: Line 494:


{{Refbegin|30em}}
{{Refbegin|30em}}
* {{cite web |access-date=February 9, 2005|
* {{cite web|
access-date=February 9, 2005|
url=http://jdebp.eu/FGA/os2-disc-and-volume-size-limits.html|
url=http://jdebp.eu/FGA/os2-disc-and-volume-size-limits.html|
author-first=Jonathan|author-last=de Boyne Pollard|
author-first=Jonathan|
author-last=de Boyne Pollard|
title=Disc and volume size limits|
title=Disc and volume size limits|
work=Frequently Given Answers|year=1996}}
work=Frequently Given Answers|
* {{cite web |access-date=February 9, 2005|
year=1996}}
url=ftp://service.boulder.ibm.com/ps/products/os2/fixes/v4warp/english-us/jr09427/JR09427.TXT|
* {{Cite FTP |
title=OS/2 corrective service fix JR09427|
access-date=February 9, 2005|
website=IBM}}
url=ftp://service.boulder.ibm.com/ps/products/os2/fixes/v4warp/english-us/jr09427/JR09427.TXT| server=IBM| url-status=dead|
* {{cite web|access-date=February 9, 2005|
title=OS/2 corrective service fix JR09427}}
url=http://linux-ntfs.sourceforge.net/ntfs/attributes/ea_information.html|
* {{cite web|
access-date=February 9, 2005|
url=https://linux-ntfs.sourceforge.net/ntfs/attributes/ea_information.html|
title=Attribute - $EA_INFORMATION (0xD0)|
title=Attribute - $EA_INFORMATION (0xD0)|
work=NTFS Information, Linux-NTFS Project}}
work=NTFS Information, Linux-NTFS Project}}
* {{cite web|access-date=February 9, 2005|
* {{cite web|
url=http://linux-ntfs.sourceforge.net/ntfs/attributes/ea.html|
access-date=February 9, 2005|
url=https://linux-ntfs.sourceforge.net/ntfs/attributes/ea.html|
title=Attribute - $EA (0xE0)|
title=Attribute - $EA (0xE0)|
work=NTFS Information, Linux-NTFS Project}}
work=NTFS Information, Linux-NTFS Project}}
* {{cite web|access-date=February 21, 2005|
* {{cite web|
url=http://linux-ntfs.sourceforge.net/ntfs/attributes/standard_information.html|
access-date=February 21, 2005|
url=https://linux-ntfs.sourceforge.net/ntfs/attributes/standard_information.html|
title=Attribute - $STANDARD_INFORMATION (0x10)|
title=Attribute - $STANDARD_INFORMATION (0x10)|
work=NTFS Information, Linux-NTFS Project}}
work=NTFS Information, Linux-NTFS Project}}
Line 433: Line 536:
* {{cite book|first=Stan|last=Mitchell|title=Inside the Windows 95 File System|publisher=O'Reilly|year=1997|isbn=1-56592-200-X|url=http://oreilly.com/catalog/156592200X}}
* {{cite book|first=Stan|last=Mitchell|title=Inside the Windows 95 File System|publisher=O'Reilly|year=1997|isbn=1-56592-200-X|url=http://oreilly.com/catalog/156592200X}}
* {{cite book|first=Rajeev|last=Nagar|title=Windows NT File System Internals : A Developer's Guide|publisher=O'Reilly|year=1997|isbn=978-1-56592-249-5|url=https://archive.org/details/windowsntfilesys00naga|url-access=registration}}
* {{cite book|first=Rajeev|last=Nagar|title=Windows NT File System Internals : A Developer's Guide|publisher=O'Reilly|year=1997|isbn=978-1-56592-249-5|url=https://archive.org/details/windowsntfilesys00naga|url-access=registration}}
* {{cite book|first=Steve D.|last=Pate|title=UNIX Filesystems: Evolution, Design, and Implementation|publisher={{wipe|John Wiley & Sons}}|year=2003|isbn=0-471-16483-6|url=http://eu.wiley.com/WileyCDA/WileyTitle/productCd-0471164836.html}}
* {{cite book|first=Steve D.|last=Pate|title=UNIX Filesystems: Evolution, Design, and Implementation|publisher=[[Company:John Wiley & Sons|Wiley]]|year=2003|isbn=0-471-16483-6|url=http://eu.wiley.com/WileyCDA/WileyTitle/productCd-0471164836.html|archive-date=2013-11-24|access-date=2010-10-17|archive-url=https://web.archive.org/web/20131124021318/http://eu.wiley.com/WileyCDA/WileyTitle/productCd-0471164836.html|url-status=dead}}
* {{cite book|first=Mendel|last=Rosenblum|title=The Design and Implementation of a Log-Structured File System|series=The Springer International Series in Engineering and Computer Science|publisher=Springer|year=1994|isbn=0-7923-9541-7}}
* {{cite book|first=Mendel|last=Rosenblum|title=The Design and Implementation of a Log-Structured File System|series=The Springer International Series in Engineering and Computer Science|publisher=Springer|year=1994|isbn=0-7923-9541-7}}
* {{cite book|first1=Mark|last1=Russinovich|first2=David A.|last2=Solomon|first3=Alex|last3=Ionescu|chapter=File Systems|title=Windows Internals|edition=5th|publisher=Microsoft Press|year=2009|isbn=978-0-7356-2530-3}}
* {{cite book|first1=Mark|last1=Russinovich|first2=David A.|last2=Solomon|first3=Alex|last3=Ionescu|chapter=File Systems|title=Windows Internals|edition=5th|publisher=Microsoft Press|year=2009|isbn=978-0-7356-2530-3}}
Line 461: Line 564:


==External links==
==External links==
{{Wikibooks|Guide to Unix|Explanations/Filesystems and Swap|Filesystems and Swap}}
* {{cite web|url=http://www.forensics.nl/filesystems|title=Filesystem Specifications - Links & Whitepapers|archive-url=https://web.archive.org/web/20151103192057/http://www.forensics.nl/filesystems|archive-date=2015-11-03|url-status=unfit}}
* {{cite web|url=http://www.forensics.nl/filesystems|title=Filesystem Specifications - Links & Whitepapers|archive-url=https://web.archive.org/web/20151103192057/http://www.forensics.nl/filesystems|archive-date=2015-11-03|url-status=unfit}}
* [http://filesystems.org/all-projects.html Interesting File System Projects]
* [http://filesystems.org/all-projects.html Interesting File System Projects]

Latest revision as of 23:05, 23 May 2026

Short description: Computer filing system

Template:OS Template:Needs more citations In computing, a file system or filesystem (often abbreviated to FS or fs) governs file organization and access. A local file system is a capability of an operating system that services the applications running on the same computer.[1][2] A distributed file system is a protocol that provides file access between networked computers.

A file system provides a data storage service that allows applications to share mass storage. Without a file system, applications could access the storage in incompatible ways that lead to resource contention, data corruption and data loss.

There are many file system designs and implementations – with various structure and features and various resulting characteristics such as speed, flexibility, security, size and more.

File systems have been developed for many types of storage devices, including hard disk drives (HDDs), solid-state drives (SSDs), magnetic tapes and optical discs.[3]

A portion of the computer main memory can be set up as a RAM disk that serves as a storage device for a file system. File systems such as tmpfs can store files in virtual memory.

A virtual file system provides access to files that are either computed on request, called virtual files (for example those provided by procfs and sysfs), or are mapping into another, backing storage.

Etymology

From c. 1900 and before the advent of computers, the terms file system, filing system and system for filing were used to describe methods of organizing, storing and retrieving paper documents.[4] By 1961, the term file system was being applied to computerized filing alongside the original meaning.[5] By 1964, it was in general use.[6]

Architecture

A local file system's architecture can be described as layers of abstraction even though a particular file system design may not actually separate the concepts.[7]

The logical file system layer provides relatively high-level access via an application programming interface (API) for file operations including open, close, read and write – delegating operations to lower layers. This layer manages open file table entries and per-process file descriptors.[8] It provides file access, directory operations, security and protection.[7]

The virtual file system, an optional layer, supports multiple concurrent instances of physical file systems, each of which is called a file system implementation.[8]

The physical file system layer provides relatively low-level access to a storage device (e.g. disk). It reads and writes data blocks, provides buffering and other memory management and controls placement of blocks in specific locations on the storage medium. This layer uses device drivers or channel I/O to drive the storage device.[7]

Attributes

File names

A file name, or filename, identifies a file to consuming applications and in some cases users.

A file name is unique so that an application can refer to exactly one file for a particular name. If the file system supports directories, then generally file name uniqueness is enforced within the context of each directory. In other words, a storage can contain multiple files with the same name, but not in the same directory.

Most file systems restrict the length of a file name.

Some file systems match file names as case sensitive and others as case insensitive. For example, the names MYFILE and myfile match the same file for case insensitive, but different files for case sensitive.

Most modern file systems allow a file name to contain a wide range of characters from the Unicode character set. Some restrict characters such as those used to indicate special attributes such as a device, device type, directory prefix, file path separator, or file type.

Directories

File systems typically support organizing files into directories, also called folders, which segregate files into groups.

This may be implemented by associating the file name with an index in a table of contents or an inode in a Unix-like file system.

Directory structures may be flat (i.e. linear), or allow hierarchies by allowing a directory to contain directories, called subdirectories.

The first file system to support arbitrary hierarchies of directories was used in the Multics operating system.[9] The native file systems of Unix-like systems also support arbitrary directory hierarchies, as do, Apple's Hierarchical File System and its successor HFS+ in classic Mac OS, the FAT file system in MS-DOS 2.0 and later versions of MS-DOS and in Microsoft Windows, the NTFS file system in the Windows NT family of operating systems, and the ODS-2 (On-Disk Structure-2) and higher levels of the Files-11 file system in OpenVMS.

Metadata

In addition to data, the file content, a file system also manages associated metadata which may include but is not limited to:

  • name
  • size which may be stored as the number of blocks allocated or as a byte count
  • when created, last accessed, last modified
  • owner user and group
  • access permissions
  • file attributes such as whether the file is read-only, executable, etc.
  • device type (e.g. block, character, socket, subdirectory, etc.)

A file system stores associated metadata separate from the content of the file.

Most file systems store the names of all the files in one directory in one place—the directory table for that directory—which is often stored like any other file. Many file systems put only some of the metadata for a file in the directory table, and the rest of the metadata for that file in a completely separate structure, such as the inode.

Most file systems also store metadata not associated with any one particular file. Such metadata includes information about unused regions—free space bitmap, block availability map—and information about bad sectors. Often such information about an allocation group is stored inside the allocation group itself.

Additional attributes can be associated on file systems, such as NTFS, XFS, ext2, ext3, some versions of UFS, and HFS+, using extended file attributes. Some file systems provide for user defined attributes such as the author of the document, the character encoding of a document or the size of an image.

Some file systems allow for different data collections to be associated with one file name. These separate collections may be referred to as streams or forks. Apple has long used a forked file system on the Macintosh, and Microsoft supports streams in NTFS. Some file systems maintain multiple past revisions of a file under a single file name; the file name by itself retrieves the most recent version, while prior saved versions can be accessed using a special naming convention such as "filename;4" or "filename(-4)" to access the version four saves ago.

See comparison of file systems § Metadata for details on which file systems support which kinds of metadata.

Storage space organization

A local file system tracks which areas of storage belong to which file and which are not being used.

When a file system creates a file, it allocates space for data. Some file systems permit or require specifying an initial space allocation and subsequent incremental allocations as the file grows.

To delete a file, the file system records that the file's space is free (available to use for another file).

An example of slack space, demonstrated with 4,096-byte NTFS clusters: 100,000 files, each five bytes per file, which equal to 500,000 bytes of actual data but require 409,600,000 bytes of disk space to store


The granular nature results in unused space, sometimes called slack space, for each file except for those that have the rare size that is a multiple of the granular allocation.[10] For a 512-byte allocation, the average unused space is 256 bytes. For 64 KB clusters, the average unused space is 32 KB.

Generally, the allocation unit size is set when the storage is configured. Choosing a relatively small size compared to the files stored, results in excessive access overhead. Choosing a relatively large size results in excessive unused space. Choosing an allocation size based on the average size of files expected to be in the storage tends to minimize unusable space.

Fragmentation

File systems may become fragmented

As a file system creates, modifies and deletes files, the underlying storage representation may become fragmented. Files and the unused space between files will occupy allocation blocks that are not contiguous.

A file becomes fragmented if space needed to store its content cannot be allocated in contiguous blocks. Free space becomes fragmented when files are deleted.[11]

Fragmentation is invisible to the end user and the system still works correctly. However, this can degrade performance on some storage hardware that works better with contiguous blocks such as hard disk drives. Other hardware such as solid-state drives are not affected by fragmentation.

Access control

A file system often supports access control of data that it manages.

The intent of access control is often to prevent certain users from reading or modifying certain files.

Access control can also restrict access by program in order to ensure that data is modified in a controlled way. Examples include passwords stored in the metadata of the file or elsewhere and file permissions in the form of permission bits, access control lists, or capabilities. The need for file system utilities to be able to access the data at the media level to reorganize the structures and provide efficient backup usually means that these are only effective for polite users but are not effective against intruders.

Methods for encrypting file data are sometimes included in the file system. This is very effective since there is no need for file system utilities to know the encryption seed to effectively manage the data. The risks of relying on encryption include the fact that an attacker can copy the data and use brute force to decrypt the data. Additionally, losing the seed means losing the data.

Storage quota

Example of qgroup (quota group) of a btrfs filesystem

Some operating systems allow a system administrator to enable disk quotas to limit a user's use of storage space.

Data integrity

A file system typically ensures that stored data remains consistent in both normal operations as well as exceptional situations like:

  • accessing program neglects to inform the file system that it has completed file access (to close a file)
  • accessing program terminates abnormally (crashes)
  • media failure
  • loss of connection to remote systems
  • operating system failure
  • system reset (soft reboot)
  • power failure (hard reboot)

Recovery from exceptional situations may include updating metadata, directory entries and handling data that was buffered but not written to storage media.

Recording

A file system might record events to allow analysis of issues such as:

  • file or systemic problems and performance
  • nefarious access

Data access

Byte stream access

Many file systems access data as a stream of bytes. Typically, to read file data, a program provides a memory buffer and the file system retrieves data from the medium and then writes the data to the buffer. A write involves the program providing a buffer of bytes that the file system reads and then stores to the medium.

Record access

Some file systems, or layers on top of a file system, allow a program to define a record so that a program can read and write data as a structure, not an unorganized sequence of bytes.

If a fixed length record definition is used, then locating the nth record can be calculated mathematically, which is relatively fast compared to parsing the data for record separators.

An identification for each record, also known as a key, allows a program to read, write and update records without regard to their location in storage. Such storage requires managing blocks of media, usually separating key blocks and data blocks. Efficient algorithms can be developed with pyramid structures for locating records.[12]

Utilities

Typically, a file system can be managed by the user via various utility programs.

Some utilities allow the user to create, configure and remove an instance of a file system. It may allow extending or truncating the space allocated to the file system.

Directory utilities may be used to create, rename and delete directory entries, which are also known as dentries (singular: dentry),[13] and to alter metadata associated with a directory. Directory utilities may also include capabilities to create additional links to a directory (hard links in Unix), to rename parent links (".." in Unix-like operating systems),[clarification needed] and to create bidirectional links to files.

File utilities create, list, copy, move and delete files, and alter metadata. They may be able to truncate data, truncate or extend space allocation, append to, move, and modify files in-place. Depending on the underlying structure of the file system, they may provide a mechanism to prepend to or truncate from the beginning of a file, insert entries into the middle of a file, or delete entries from a file. Utilities to free space for deleted files, if the file system provides an undelete function, also belong to this category.

Some file systems defer operations such as reorganization of free space, secure erasing of free space, and rebuilding of hierarchical structures by providing utilities to perform these functions at times of minimal activity. An example is the file system defragmentation utilities.

Some of the most important features of file system utilities are supervisory activities which may involve bypassing ownership or direct access to the underlying device. These include high-performance backup and recovery, data replication, and reorganization of various data structures and allocation tables within the file system.

File system API

Utilities, libraries and programs use file system APIs to make requests of the file system. These include data transfer, positioning, updating metadata, managing directories, managing access specifications, and removal.

Multiple file systems within a single system

Frequently, retail systems are configured with a single file system occupying the entire storage device.

Another approach is to partition the disk so that several file systems with different attributes can be used. One file system, for use as browser cache or email storage, might be configured with a small allocation size. This keeps the activity of creating and deleting files typical of browser activity in a narrow area of the disk where it will not interfere with other file allocations. Another partition might be created for the storage of audio or video files with a relatively large block size. Yet another may normally be set read-only and only periodically be set writable. Some file systems, such as ZFS and APFS, support multiple file systems sharing a common pool of free blocks, supporting several file systems with different attributes without having to reserved a fixed amount of space for each file system.[14][15]

A third approach, which is mostly used in cloud systems, is to use "disk images" to house additional file systems, with the same attributes or not, within another (host) file system as a file. A common example is virtualization: one user can run an experimental Linux distribution (using the ext4 file system) in a virtual machine under their production Windows environment (using NTFS). The ext4 file system resides in a disk image, which is treated as a file (or multiple files, depending on the hypervisor and settings) in the NTFS host file system.

Having multiple file systems on a single system has the additional benefit that in the event of a corruption of a single file system, the remaining file systems will frequently still be intact. This includes virus destruction of the system file system or even a system that will not boot. File system utilities which require dedicated access can be effectively completed piecemeal. In addition, defragmentation may be more effective. Several system maintenance utilities, such as virus scans and backups, can also be processed in segments. For example, it is not necessary to backup the file system containing videos along with all the other files if none have been added since the last backup. As for the image files, one can easily "spin off" differential images which contain only "new" data written to the master (original) image. Differential images can be used for both safety concerns (as a "disposable" system - can be quickly restored if destroyed or contaminated by a virus, as the old image can be removed and a new image can be created in matter of seconds, even without automated procedures) and quick virtual machine deployment (since the differential images can be quickly spawned using a script in batches).

Types

Storage media

Disk file systems

A disk file system takes advantages of the ability of disk storage media to randomly address data in a short amount of time. Additional considerations include the speed of accessing data following that initially requested and the anticipation that the following data may also be requested. This permits multiple users (or processes) access to various data on the disk without regard to the sequential location of the data. Examples include FAT (FAT12, FAT16, FAT32), exFAT, NTFS, ReFS, HFS and HFS+, HPFS, APFS, UFS, ext2, ext3, ext4, XFS, btrfs, Files-11, Veritas File System, VMFS, ZFS, ReiserFS, NSS and ScoutFS. Some disk file systems are journaling file systems or versioning file systems.

Optical discs

ISO 9660 and Universal Disk Format (UDF) are two common formats that target Compact Discs, DVDs and Blu-ray discs. Mount Rainier is an extension to UDF supported since 2.6 series of the Linux kernel and since Windows Vista that facilitates rewriting to DVDs.

Flash file systems

A flash file system considers the special abilities, performance and restrictions of flash memory devices. Frequently a disk file system can use a flash memory device as the underlying storage media, but it is much better to use a file system specifically designed for a flash device.[16]

Tape file systems

A tape file system is a file system and tape format designed to store files on tape. Magnetic tapes are sequential storage media with significantly longer random data access times than disks, posing challenges to the creation and efficient management of a general-purpose file system.

In a disk file system there is typically a master file directory, and a map of used and free data regions. Any file additions, changes, or removals require updating the directory and the used/free maps. Random access to data regions is measured in milliseconds so this system works well for disks.

Tape requires linear motion to wind and unwind potentially very long reels of media. This tape motion may take several seconds to several minutes to move the read/write head from one end of the tape to the other.

Consequently, a master file directory and usage map can be extremely slow and inefficient with tape. Writing typically involves reading the block usage map to find free blocks for writing, updating the usage map and directory to add the data, and then advancing the tape to write the data in the correct spot. Each additional file write requires updating the map and directory and writing the data, which may take several seconds to occur for each file.

Tape file systems instead typically allow for the file directory to be spread across the tape intermixed with the data, referred to as streaming, so that time-consuming and repeated tape motions are not required to write new data.

However, a side effect of this design is that reading the file directory of a tape usually requires scanning the entire tape to read all the scattered directory entries. Most data archiving software that works with tape storage will store a local copy of the tape catalog on a disk file system, so that adding files to a tape can be done quickly without having to rescan the tape media. The local tape catalog copy is usually discarded if not used for a specified period of time, at which point the tape must be re-scanned if it is to be used in the future.

IBM has developed a file system for tape called the Linear Tape File System. The IBM implementation of this file system has been released as the open-source IBM Linear Tape File System — Single Drive Edition (LTFS-SDE) product. The Linear Tape File System uses a separate partition on the tape to record the index meta-data, thereby avoiding the problems associated with scattering directory entries across the entire tape.

Tape formatting

Writing data to a tape, erasing, or formatting a tape is often a significantly time-consuming process and can take several hours on large tapes.[lower-alpha 1] With many data tape technologies it is not necessary to format the tape before over-writing new data to the tape. This is due to the inherently destructive nature of overwriting data on sequential media.

Because of the time it can take to format a tape, typically tapes are pre-formatted so that the tape user does not need to spend time preparing each new tape for use. All that is usually necessary is to write an identifying media label to the tape before use, and even this can be automatically written by software when a new tape is used for the first time.

Minimal file system / audio-cassette storage

In the 1970s disk and digital tape devices were too expensive for some early microcomputer users. An inexpensive basic data storage system was devised that used common audio cassette tape.

When the system needed to write data, the user was notified to press "RECORD" on the cassette recorder, then press "RETURN" on the keyboard to notify the system that the cassette recorder was recording. The system wrote a sound to provide time synchronization, then modulated sounds that encoded a prefix, the data, a checksum and a suffix. When the system needed to read data, the user was instructed to press "PLAY" on the cassette recorder. The system would listen to the sounds on the tape waiting until a burst of sound could be recognized as the synchronization. The system would then interpret subsequent sounds as data. When the data read was complete, the system would notify the user to press "STOP" on the cassette recorder. It was primitive, but it (mostly) worked. Data was stored sequentially, usually in an unnamed format, although some systems (such as the Commodore PET series of computers) did allow the files to be named. Multiple sets of data could be written and located by fast-forwarding the tape and observing at the tape counter to find the approximate start of the next data region on the tape. The user might have to listen to the sounds to find the right spot to begin playing the next data region. Some implementations even included audible sounds interspersed with the data.

Database file systems

Another concept for file management is the idea of a database-based file system. Instead of, or in addition to, hierarchical structured management, files are identified by their characteristics, like type of file, topic, author, or similar rich metadata.[17]

IBM DB2 for i [18] (formerly known as DB2/400 and DB2 for i5/OS) is a database file system as part of the object based IBM i[19] operating system (formerly known as OS/400 and i5/OS), incorporating a single level store and running on IBM Power Systems (formerly known as AS/400 and iSeries), designed by Frank G. Soltis IBM's former chief scientist for IBM i. Around 1978 to 1988 Frank G. Soltis and his team at IBM Rochester had successfully designed and applied technologies like the database file system where others like Microsoft later failed to accomplish.[20] These technologies are informally known as 'Fortress Rochester' and were in few basic aspects extended from early Mainframe technologies but in many ways more advanced from a technological perspective[citation needed]. Some other projects that are not "pure" database file systems but that use some aspects of a database file system:

  • Many Web content management systems use a relational DBMS to store and retrieve files. For example, XHTML files are stored as XML or text fields, while image files are stored as blob fields; SQL SELECT (with optional XPath) statements retrieve the files, and allow the use of a sophisticated logic and more rich information associations than "usual file systems." Many CMSs also have the option of storing only metadata within the database, with the standard filesystem used to store the content of files.
  • Very large file systems, embodied by applications like Apache Hadoop and Google File System, use some database file system concepts.

Transactional file systems

Some programs need to either make multiple file system changes, or, if one or more of the changes fail for any reason, make none of the changes. For example, a program which is installing or updating software may write executables, libraries, and/or configuration files. If some of the writing fails and the software is left partially installed or updated, the software may be broken or unusable. An incomplete update of a key system utility, such as the command shell, may leave the entire system in an unusable state.

Transaction processing introduces the atomicity guarantee, ensuring that operations inside of a transaction are either all committed or the transaction can be aborted and the system discards all of its partial results. This means that if there is a crash or power failure, after recovery, the stored state will be consistent. Either the software will be completely installed or the failed installation will be completely rolled back, but an unusable partial install will not be left on the system. Transactions also provide the isolation guarantee[clarification needed], meaning that operations within a transaction are hidden from other threads on the system until the transaction commits, and that interfering operations on the system will be properly serialized with the transaction.

Windows, beginning with Vista, added transaction support to NTFS, in a feature called Transactional NTFS, but its use is now discouraged.[21] There are a number of research prototypes of transactional file systems for UNIX systems, including the Valor file system,[22] Amino,[23] LFS,[24] and a transactional ext3 file system on the TxOS kernel,[25] as well as transactional file systems targeting embedded systems, such as TFFS.[26]

Ensuring consistency across multiple file system operations is difficult, if not impossible, without file system transactions. File locking can be used as a concurrency control mechanism for individual files, but it typically does not protect the directory structure or file metadata. For instance, file locking cannot prevent TOCTTOU race conditions on symbolic links. File locking also cannot automatically roll back a failed operation, such as a software upgrade; this requires atomicity.

Journaling file systems is one technique used to introduce transaction-level consistency to file system structures. Journal transactions are not exposed to programs as part of the OS API; they are only used internally to ensure consistency at the granularity of a single system call.

Data backup systems typically do not provide support for direct backup of data stored in a transactional manner, which makes the recovery of reliable and consistent data sets difficult. Most backup software simply notes what files have changed since a certain time, regardless of the transactional state shared across multiple files in the overall dataset. As a workaround, some database systems simply produce an archived state file containing all data up to that point, and the backup software only backs that up and does not interact directly with the active transactional databases at all. Recovery requires separate recreation of the database from the state file after the file has been restored by the backup software.

Network file systems

A network file system is a file system that acts as a client for a remote file access protocol, providing access to files on a server. Programs using local interfaces can transparently create, manage and access hierarchical directories and files in remote network-connected computers. Examples of network file systems include clients for the NFS,[27] AFS, SMB protocols, and file-system-like clients for FTP and WebDAV.

Shared disk file systems

A shared disk file system is one in which a number of machines (usually servers) all have access to the same external disk subsystem (usually a storage area network). The file system arbitrates access to that subsystem, preventing write collisions.[28] Examples include GFS2 from Red Hat, GPFS, now known as Spectrum Scale, from IBM, SFS from DataPlow, CXFS from SGI, StorNext from Quantum Corporation and ScoutFS from Versity.

Special file systems

Some file systems expose elements of the operating system as files so they can be acted on via the file system API. This is common in Unix-like operating systems, and to a lesser extent in other operating systems. Examples include:

  • devfs, udev, TOPS-10 expose I/O devices or pseudo-devices as special files
  • configfs and sysfs expose special files that can be used to query and configure Linux kernel information
  • procfs exposes process information as special files

Directory hierarchy support

Flat file systems

In a flat file system, there are no subdirectories; files are stored on a disk without hierarchy. While simple, this become awkward as the number of files grows and makes it difficult to organize files into related groups.

The mainframe DOS/360 and OS/360 store entries for all files on a disk pack (volume) in a directory on the pack called a Volume Table of Contents (VTOC).

Some minicomputer operating systems, such as RT-11, had a flat file system with only one top-level directory. Others, such as RSX-11, supported a top-level directory and subdirectories for user accounts, but did not support subdirectories of the user-account directories.

Most 8-bit microcomputer operating systems originally used flat file systems (e.g., Apple DOS, Atari DOS). CP/M machines use a flat file system, where files can be assigned to one of 16 user areas and generic file operations narrowed to work on one instead of defaulting to work on all of them. These user areas are no more than special attributes associated with the files; it is not necessary to define specific quota for each of these areas and files can be added to groups for as long as there is free storage space on the disk.

The FAT file system in IBM PC DOS/MS-DOS was a flat file system until DOS version 2.0, when support for subdirectories was added.

The classic Mac OS for the Macintosh supported only the flat Macintosh File System until the Hierarchical File System was introduced in version 2.1. The file management program, the Finder, created the illusion of a partially hierarchical filing system. This structure required every file to have a unique name, even if it appeared to be in a separate folder.

A 21st century addition to the flat file system family is Amazon's S3, a remote storage service, which is intentionally simplistic to allow users the ability to customize how their data is stored. The only constructs are buckets (imagine a disk drive of unlimited size) and objects (similar, but not identical to the standard concept of a file). Advanced file management is allowed by being able to use nearly any character (including '/') in the object's name, and the ability to select subsets of the bucket's content based on identical prefixes.

Hierarchical file systems

In a hierarchical file system, all directories can have subdirectories.

Implementations

An operating system (OS) typically supports one or more file systems. Sometimes an OS and its file system are so tightly interwoven that it is difficult to describe them independently.

An OS typically provides file system access to the user. Often an OS provides a command line interface, such as a Unix shell, Windows Command Prompt and PowerShell, or OpenVMS DCL. An OS often also provides a file browser in a graphical user interface such as Finder on macOS, File Explorer on Windows, GNOME Files in GNOME, or Dolphin in KDE Plasma.

Unix and Unix-like operating systems

Unix-like operating systems create a virtual file system, which makes all files on all connected storage devices appear to exist in a single hierarchy. This means, in those systems, there is one root directory, and every file existing on the system is located under it somewhere. Unix-like systems can use a RAM disk or network shared resource as its root directory.

Unix-like systems assign a device name to each device, but this is not how the files on that device are accessed. Instead, to gain access to files on another device, the operating system must first be informed where in the directory tree those files should appear. This process is called mounting a file system. For example, to access the files on a CD-ROM, one must tell the operating system "Take the file system from this CD-ROM and make it appear under such-and-such directory." The directory given to the operating system is called the mount point – it might, for example, be /media. The /media directory exists on many Unix systems (as specified in the Filesystem Hierarchy Standard) and is intended specifically for use as a mount point for removable media such as CDs, DVDs, USB drives or floppy disks. It may be empty, or it may contain subdirectories for mounting individual devices. Generally, only the administrator (i.e. root user) may authorize the mounting of file systems.

Unix-like operating systems often include software and tools that assist in the mounting process and provide it new functionality. Some of these strategies have been coined "auto-mounting" as a reflection of their purpose.

  • In many situations, file systems other than the root need to be available as soon as the operating system has booted. All Unix-like systems therefore provide a facility for mounting file systems at boot time. System administrators define these file systems in the configuration file fstab (vfstab in Solaris), which also indicates options and mount points.
  • In some situations, there is no need to mount certain file systems at boot time, although their use may be desired thereafter. There are some utilities for Unix-like systems that allow the mounting of predefined file systems upon demand.
  • Removable media allow programs and data to be transferred between machines without a physical connection. Common examples include USB flash drives, CD-ROMs, and DVDs. Utilities have therefore been developed to detect the presence and availability of a medium and then mount that medium without any user intervention.
  • Progressive Unix-like systems have also introduced a concept called supermounting; see, for example, the Linux supermount-ng project. For example, a floppy disk that has been supermounted can be physically removed from the system. Under normal circumstances, the disk should have been synchronized and then unmounted before its removal. Provided synchronization has occurred, a different disk can be inserted into the drive. The system automatically notices that the disk has changed and updates the mount point contents to reflect the new medium.
  • An automounter will automatically mount a file system when a reference is made to the directory atop which it should be mounted. This is usually used for file systems on network servers, rather than relying on events such as the insertion of media, as would be appropriate for removable media.

Linux

Linux supports numerous file systems, but common choices for the system disk on a block device include the ext* family (ext2, ext3 and ext4), XFS, JFS, and btrfs. For raw flash without a flash translation layer (FTL) or Memory Technology Device (MTD), there are UBIFS, JFFS2 and YAFFS, among others. SquashFS is a common compressed read-only file system.

Solaris

Solaris in earlier releases defaulted to (non-journaled or non-logging) UFS for bootable and supplementary file systems. Solaris defaulted to, supported, and extended UFS.

Support for other file systems and significant enhancements were added over time, including Veritas Software Corp. (journaling) VxFS, Sun Microsystems (clustering) QFS, Sun Microsystems (journaling) UFS, and Sun Microsystems (open source, poolable, 128 bit compressible, and error-correcting) ZFS.

Kernel extensions were added to Solaris to allow for bootable Veritas VxFS operation. Logging or journaling was added to UFS in Sun's Solaris 7. Releases of Solaris 10, Solaris Express, OpenSolaris, and other open source variants of the Solaris operating system later supported bootable ZFS.

Logical Volume Management allows for spanning a file system across multiple devices for the purpose of adding redundancy, capacity, and/or throughput. Legacy environments in Solaris may use Solaris Volume Manager (formerly known as Solstice DiskSuite). Multiple operating systems (including Solaris) may use Veritas Volume Manager. Modern Solaris based operating systems eclipse the need for volume management through leveraging virtual storage pools in ZFS.

macOS

Template:Needs more citations macOS (formerly Mac OS X) uses the Apple File System (APFS), which in 2017 replaced a file system inherited from classic Mac OS called HFS Plus (HFS+). Apple also uses the term "Mac OS Extended" for HFS+.[29] HFS Plus is a metadata-rich and case-preserving but (usually) case-insensitive file system. Due to the Unix roots of macOS, Unix permissions were added to HFS Plus. Later versions of HFS Plus added journaling to prevent corruption of the file system structure and introduced a number of optimizations to the allocation algorithms in an attempt to defragment files automatically without requiring an external defragmenter.

File names can be up to 255 characters. HFS Plus uses Unicode to store file names. On macOS, the filetype can come from the type code, stored in file's metadata, or the filename extension.

HFS Plus has three kinds of links: Unix-style hard links, Unix-style symbolic links, and aliases. Aliases are designed to maintain a link to their original file even if they are moved or renamed; they are not interpreted by the file system itself, but by the File Manager code in userland.

macOS 10.13 High Sierra, which was announced on June 5, 2017, at Apple's WWDC event, uses the Apple File System on solid-state drives.

macOS also supported the UFS file system, derived from the BSD Unix Fast File System via NeXTSTEP. However, as of Mac OS X Leopard, macOS could no longer be installed on a UFS volume, nor can a pre-Leopard system installed on a UFS volume be upgraded to Leopard.[30] As of Mac OS X Lion UFS support was completely dropped.

Newer versions of macOS are capable of reading and writing to the legacy FAT file systems (16 and 32) common on Windows. They are also capable of reading the newer NTFS file systems for Windows. In order to write to NTFS file systems on macOS versions prior to Mac OS X Snow Leopard third-party software is necessary. Mac OS X 10.6 (Snow Leopard) and later allow writing to NTFS file systems, but only after a non-trivial system setting change (third-party software exists that automates this).[31]

Finally, macOS supports reading and writing of the exFAT file system since Mac OS X Snow Leopard, starting from version 10.6.5.[32]

OS/2

OS/2 1.2 introduced the High Performance File System (HPFS). HPFS supports mixed case file names in different code pages, long file names (255 characters), more efficient use of disk space, an architecture that keeps related items close to each other on the disk volume, less fragmentation of data, extent-based space allocation, a B+ tree structure for directories, and the root directory located at the midpoint of the disk, for faster average access. A journaled filesystem (JFS) was shipped in 1999.

PC-BSD

PC-BSD is a desktop version of FreeBSD, which inherits FreeBSD's ZFS support, similarly to FreeNAS. The new graphical installer of PC-BSD can handle / (root) on ZFS and RAID-Z pool installs and disk encryption using Geli right from the start in an easy convenient (GUI) way. The current PC-BSD 9.0+ 'Isotope Edition' has ZFS filesystem version 5 and ZFS storage pool version 28.

Plan 9

Plan 9 from Bell Labs treats everything as a file and accesses all objects as a file would be accessed (i.e., there is no ioctl or mmap): networking, graphics, debugging, authentication, capabilities, encryption, and other services are accessed via I/O operations on file descriptors. The 9P protocol removes the difference between local and remote files. File systems in Plan 9 are organized with the help of private, per-process namespaces, allowing each process to have a different view of the many file systems that provide resources in a distributed system.

The Inferno operating system shares these concepts with Plan 9.

Microsoft Windows

Template:Needs more citations

Directory listing in a Windows command shell

Windows makes use of the FAT, NTFS, exFAT, Live File System and ReFS file systems (the last of these is only supported and usable in Windows Server 2012, Windows Server 2016, Windows 8, Windows 8.1, and Windows 10; Windows cannot boot from it).

Windows uses a drive letter abstraction at the user level to distinguish one disk or partition from another. For example, the path C:\WINDOWS represents a directory WINDOWS on the partition represented by the letter C. Drive C: is most commonly used for the primary hard disk drive partition, on which Windows is usually installed and from which it boots. This "tradition" has become so firmly ingrained that bugs exist in many applications which make assumptions that the drive that the operating system is installed on is C. The use of drive letters, and the tradition of using "C" as the drive letter for the primary hard disk drive partition, can be traced to MS-DOS, where the letters A and B were reserved for up to two floppy disk drives. This in turn derived from CP/M in the 1970s, and ultimately from IBM's CP/CMS of 1967.

FAT

The family of FAT file systems is supported by almost all operating systems for personal computers, including all versions of Windows and MS-DOS/PC DOS, OS/2, and DR-DOS. (PC DOS is an OEM version of MS-DOS, MS-DOS was originally based on SCP's 86-DOS. DR-DOS was based on Digital Research's Concurrent DOS, a successor of CP/M-86.) The FAT file systems are therefore well-suited as a universal exchange format between computers and devices of most any type and age.


Over the years, the file system has been expanded from FAT12 to FAT16 and FAT32. Various features have been added to the file system including subdirectories, codepage support, extended attributes, and long filenames. Third parties such as Digital Research have incorporated optional support for deletion tracking, and volume/directory/file-based multi-user security schemes to support file and directory passwords and permissions such as read/write/execute/delete access rights. Most of these extensions are not supported by Windows.

The FAT12 and FAT16 file systems had a limit on the number of entries in the root directory of the file system and had restrictions on the maximum size of FAT-formatted disks or partitions.

FAT32 addresses the limitations in FAT12 and FAT16, except for the file size limit of close to 4 GB, but it remains limited compared to NTFS.

FAT12, FAT16 and FAT32 also have a limit of eight characters for the file name, and three characters for the extension (such as .exe). This is commonly referred to as the 8.3 filename limit. VFAT, an optional extension to FAT12, FAT16 and FAT32, introduced in Windows 95 and Windows NT 3.5, allowed long file names (LFN) to be stored in the FAT file system in a backwards compatible fashion.

NTFS

NTFS, introduced with the Windows NT operating system in 1993, allowed ACL-based permission control. Other features also supported by NTFS include hard links, multiple file streams, attribute indexing, quota tracking, sparse files, encryption, compression, and reparse points (directories working as mount-points for other file systems, symlinks, junctions, remote storage links).

exFAT

exFAT is not backward compatible with FAT file systems such as FAT12, FAT16 or FAT32. The file system is supported with newer Windows systems, such as Windows XP, Windows Server 2003, Windows Vista, Windows 2008, Windows 7, Windows 8, Windows 8.1, Windows 10 and Windows 11.

exFAT is supported in macOS starting with version 10.6.5 (Snow Leopard).[32] Support in other operating systems is sparse since implementing support for exFAT requires a license. exFAT is the only file system that is fully supported on both macOS and Windows that can hold files larger than 4 GB.[33][34]

OpenVMS

MVS

Prior to the introduction of VSAM, OS/360 systems implemented a hybrid file system. The system was designed to easily support removable disk packs, so the information relating to all files on one disk (volume in IBM terminology) is stored on that disk in a flat system file called the Volume Table of Contents (VTOC). The VTOC stores all metadata for the file. Later a hierarchical directory structure was imposed with the introduction of the System Catalog, which can optionally catalog files (datasets) on resident and removable volumes. The catalog only contains information to relate a dataset to a specific volume. If the user requests access to a dataset on an offline volume, and they have suitable privileges, the system will attempt to mount the required volume. Cataloged and non-cataloged datasets can still be accessed using information in the VTOC, bypassing the catalog, if the required volume id is provided to the OPEN request. Still later the VTOC was indexed to speed up access.

Conversational Monitor System

The IBM Conversational Monitor System (CMS) component of VM/370 uses a separate flat file system for each virtual disk (minidisk). File data and control information are scattered and intermixed. The anchor is a record called the Master File Directory (MFD), always located in the fourth block on the disk. Originally CMS used fixed-length 800-byte blocks, but later versions used larger size blocks up to 4K. Access to a data record requires two levels of indirection, where the file's directory entry (called a File Status Table (FST) entry) points to blocks containing a list of addresses of the individual records.

AS/400 file system

Data on the AS/400 and its successors consists of system objects mapped into the system virtual address space in a single-level store. Many types of objects are defined including the directories and files found in other file systems. File objects, along with other types of objects, form the basis of the AS/400's support for an integrated relational database.

Other file systems

  • RSRE FLEX file system - written in ALGOL 68[citation needed]
  • The file system of the Michigan Terminal System (MTS) is interesting because: (i) it provides "line files" where record lengths and line numbers are associated as metadata with each record in the file, lines can be added, replaced, updated with the same or different length records, and deleted anywhere in the file without the need to read and rewrite the entire file; (ii) using program keys files may be shared or permitted to commands and programs in addition to users and groups; and (iii) there is a comprehensive file locking mechanism that protects both the file's data and its metadata.[35][36]
  • TempleOS uses RedSea, a file system made by Terry A. Davis.[37]

Limitations

Design limitations

File systems limit storable data capacity – generally driven by the typical size of storage devices at the time the file system is designed and anticipated into the foreseeable future.

Since storage sizes have increased at near exponential rate (see Moore's law), newer storage devices often exceed existing file system limits within only a few years after introduction.[needs update?] This requires new file systems with ever increasing capacity.

With higher capacity, the need for capabilities and therefore complexity increases as well. File system complexity typically varies proportionally with available storage capacity. Capacity issues aside, the file systems of early 1980s home computers with 50 KB to 512 KB of storage would not be a reasonable choice for modern storage systems with hundreds of gigabytes of capacity. Likewise, modern file systems would not be a reasonable choice for these early systems, since the complexity of modern file system structures would quickly consume the limited capacity of early storage systems.

Converting the type of a file system

It may be advantageous or necessary to have files in a different file system than they currently exist. Reasons include the need for an increase in the space requirements beyond the limits of the current file system. The depth of path may need to be increased beyond the restrictions of the file system. There may be performance or reliability considerations. Providing access to another operating system which does not support the existing file system is another reason.

In-place conversion

In some cases conversion can be done in-place, although migrating the file system is more conservative, as it involves a creating a copy of the data and is recommended.[38] On Windows, FAT and FAT32 file systems can be converted to NTFS via the convert.exe utility, but not the reverse.[38] On Linux, ext2 can be converted to ext3 (and converted back), and ext3 can be converted to ext4 (but not back),[39] and both ext3 and ext4 can be converted to btrfs, and converted back until the undo information is deleted.[40] These conversions are possible due to using the same format for the file data itself, and relocating the metadata into empty space, in some cases using sparse file support.[40]

Migrating to a different file system

Migration has the disadvantage of requiring additional space although it may be faster. The best case is if there is unused space on media which will contain the final file system.

For example, to migrate a FAT32 file system to an ext2 file system, a new ext2 file system is created. Then the data from the FAT32 file system is copied to the ext2 one, and the old file system is deleted.

An alternative, when there is not sufficient space to retain the original file system until the new one is created, is to use a work area (such as a removable media). This takes longer but has the benefit of producing a backup.

Long file paths and long file names

In hierarchical file systems, files are accessed by means of a path that is a branching list of directories containing the file. Different file systems have different limits on the depth of the path. File systems also have a limit on the length of an individual file name.

Copying files with long names or located in paths of significant depth from one file system to another may cause undesirable results. This depends on how the utility doing the copying handles the discrepancy.

See also

Notes

  1. An LTO-6 2.5 TB tape requires more than 4 hours to write at 160 MB/Sec

References

  1. "5.10. Filesystems". The Linux Document Project. https://tldp.org/LDP/sag/html/filesystems.html. "A filesystem is the methods and data structures that an operating system uses to keep track of files on a disk or partition; that is, the way the files are organized on the disk." 
  2. Arpaci-Dusseau, Remzi H.; Arpaci-Dusseau, Andrea C. (2014), File System Implementation, Arpaci-Dusseau Books, http://pages.cs.wisc.edu/~remzi/OSTEP/file-implementation.pdf 
  3. "Storage, IT Technology and Markets, Status and Evolution". September 20, 2018. https://indico.cern.ch/event/713888/contributions/3122779/attachments/1719287/2774787/storage_tech_market_BPS_Sep2018_v6.pdf. "HDD still key storage for the foreseeable future, SSDs not cost effective for capacity" 
  4. McGill, Florence E. (1922). Office Practice and Business Procedure. Gregg Publishing Company. p. 197. https://archive.org/details/officepracticea01mcgigoog. Retrieved August 1, 2016. 
  5. Waring, R.L. (1961). Technical investigations of addition of a hardcopy output to the elements of a mechanized library system : final report, 20 Sept. 1961. Cincinnati, OH: Svco Corporation. OCLC 310795767. 
  6. Disc File Applications: Reports Presented at the Nation's First Disc File Symposium. American Data Processing. 1964. https://books.google.com/books?id=hJBWAAAAMAAJ. Retrieved August 1, 2016. 
  7. 7.0 7.1 7.2 Amir, Yair. "Operating Systems 600.418 The File System". http://www.cs.jhu.edu/~yairamir/cs418/os7/sld001.htm. 
  8. 8.0 8.1 IBM Corporation. "Component Structure of the Logical File System". https://www.ibm.com/docs/en/aix/7.3?topic=overview-component-structure-logical-file-system. 
  9. R. C. Daley; P. G. Neumann (1965). "Proceedings of the November 30--December 1, 1965, fall joint computer conference, Part I on XX - AFIPS '65 (Fall, part I)". Fall Joint Computer Conference. AFIPS. pp. 213–229. doi:10.1145/1463891.1463915. 
  10. Carrier 2005, pp. 187–188.
  11. Valvano, Jonathan W. (2011). Embedded Microcomputer Systems: Real Time Interfacing (Third ed.). Cengage Learning. p. 524. ISBN 978-1-111-42625-5. https://books.google.com/books?id=dSMJAAAAQBAJ&pg=PA524. Retrieved June 30, 2022. 
  12. "KSAM: A B + -tree-based keyed sequential-access method". ResearchGate. https://www.researchgate.net/publication/234789457. 
  13. Mohan, I. Chandra (2013). Operating Systems. Delhi: PHI Learning Pvt. Ltd.. p. 166. ISBN 9788120347267. https://books.google.com/books?id=eei_jHVJi3oC. Retrieved 2014-07-27. "The word dentry is short for 'directory entry'. A dentry is nothing but a specific component in the path from the root. They (directory name or file name) provide for accessing files or directories[.]" 
  14. "Chapter 22. The Z File System (ZFS)". The FreeBSD Handbook. https://docs.freebsd.org/en/books/handbook/zfs/. "Pooled storage: adding physical storage devices to a pool, and allocating storage space from that shared pool. Space is available to all file systems and volumes, and increases by adding new storage devices to the pool." 
  15. "About Apple File System (APFS)". DaisyDisk User Guide. https://daisydiskapp.com/guide/4/en/APFS/. "APFS introduces space sharing between volumes. In APFS, every physical disk is a container that can have multiple volumes inside, which share the same pool of free space." 
  16. Douglis, Fred; Cáceres, Ramón; Kaashoek, M. Frans; Krishnan, P.; Li, Kai; Marsh, Brian; Tauber, Joshua (1994). "18. Storage Alternatives for Mobile Computers". Mobile Computing. 353. USENIX. pp. 473–505. doi:10.1007/978-0-585-29603-6_18. ISBN 978-0-585-29603-6. 
  17. "Windows on a database – sliced and diced by BeOS vets". theregister.co.uk. 2002-03-29. https://www.theregister.co.uk/2002/03/29/windows_on_a_database_sliced/. 
  18. "IBM DB2 for i: Overview". 03.ibm.com. http://www-03.ibm.com/systems/i/software/db2/index.html. 
  19. "IBM developerWorks : New to IBM i". Ibm.com. 2011-03-08. http://www.ibm.com/developerworks/ibmi/newto/. 
  20. "XP successor Longhorn goes SQL, P2P – Microsoft leaks". theregister.co.uk. 2002-01-28. https://www.theregister.co.uk/2002/01/28/xp_successor_longhorn_goes_sql/. 
  21. "Alternatives to using Transactional NTFS (Windows)". Msdn.microsoft.com. 2013-12-05. http://msdn.microsoft.com/en-us/library/windows/desktop/hh802690(v=vs.85).aspx. 
  22. Spillane, Richard; Gaikwad, Sachin; Chinni, Manjunath; Zadok, Erez; Wright, Charles P. (2009). "Enabling transactional file access via lightweight kernel extensions". Seventh USENIX Conference on File and Storage Technologies (FAST 2009). http://www.fsl.cs.sunysb.edu/docs/valor/valor_fast2009.pdf. 
  23. Wright, Charles P.; Spillane, Richard; Sivathanu, Gopalan; Zadok, Erez (2007). "Extending ACID Semantics to the File System". ACM Transactions on Storage 3 (2): 4. doi:10.1145/1242520.1242521. http://www.fsl.cs.sunysb.edu/docs/amino-tos06/amino.pdf. 
  24. Seltzer, Margo I. (1993). "Transaction Support in a Log-Structured File System". http://www.eecs.harvard.edu/~margo/papers/icde93/paper.pdf. 
  25. Porter, Donald E.; Hofmann, Owen S.; Rossbach, Christopher J.; Benn, Alexander; Witchel, Emmett (October 2009). "Operating System Transactions". Big Sky, MT. http://www.sigops.org/sosp/sosp09/papers/porter-sosp09.pdf. 
  26. Gal, Eran; Toledo, Sivan. "A Transactional Flash File System for Microcontrollers". USENIX 2005. http://www.usenix.org/event/usenix05/tech/general/full_papers/gal/gal.pdf. 
  27. Arpaci-Dusseau, Remzi H.; Arpaci-Dusseau, Andrea C. (2014), Sun's Network File System, Arpaci-Dusseau Books, http://pages.cs.wisc.edu/~remzi/OSTEP/dist-nfs.pdf 
  28. Troppens, Ulf; Erkens, Rainer; Müller, Wolfgang (2004). Storage Networks Explained: Basics and Application of Fibre Channel SAN, NAS, iSCSI and InfiniBand. John Wiley & Sons. pp. 124–125. ISBN 0-470-86182-7. https://books.google.com/books?id=TUtrRoDhNm4C&pg=PA124. Retrieved June 30, 2022. 
  29. "Mac OS X: About file system journaling". Apple. http://support.apple.com/kb/ht2355. 
  30. "Mac OS X 10.5 Leopard: Installing on a UFS-formatted volume". apple.com. 19 October 2007. http://docs.info.apple.com/article.html?artnum=306516. 
  31. OSXDaily (2013-10-02). "How to Enable NTFS Write Support in Mac OS X". http://osxdaily.com/2013/10/02/enable-ntfs-write-support-mac-os-x/. 
  32. 32.0 32.1 Steve Bunting (2012-08-14). EnCase Computer Forensics - The Official EnCE: EnCase Certified Examiner. Wiley. ISBN 9781118219409. https://books.google.com/books?id=c1mezk6uHfIC&q=os+x+exfat+10.6.5&pg=PA79. Retrieved 2014-02-07. 
  33. "File system formats available in Disk Utility on Mac". https://support.apple.com/guide/disk-utility/dsku19ed921c/mac. 
  34. "exFAT file system specification". https://docs.microsoft.com/en-us/windows/win32/fileio/exfat-specification. 
  35. Pirkola, G. C. (June 1975). "A file system for a general-purpose time-sharing environment". Proceedings of the IEEE 63 (6): 918–924. doi:10.1109/PROC.1975.9856. ISSN 0018-9219. Bibcode1975IEEEP..63..918P. 
  36. Pirkola, Gary C.; Sanguinetti, John. "The Protection of Information in a General Purpose Time-Sharing Environment". 10. pp. 106–114. https://docs.google.com/viewer?a=v&pid=sites&srcid=ZGVmYXVsdGRvbWFpbnxtaWNoaWdhbnRlcm1pbmFsc3lzdGVtfGd4Ojc5MTAxNzg1NTVmMjg5Mzk. 
  37. Davis, Terry A. (n.d.). "The Temple Operating System". http://www.templeos.org/Wb/Doc/Features.html#l1. 
  38. 38.0 38.1 "How to Convert FAT Disks to NTFS". https://learn.microsoft.com/en-us/previous-versions/windows/it-pro/windows-xp/bb456984(v=technet.10). 
  39. "Ext4 Howto". kernel.org. https://ext4.wiki.kernel.org/index.php/Ext4_Howto#Converting_an_ext3_filesystem_to_ext4. 
  40. 40.0 40.1 "Conversion from Ext3". https://btrfs.wiki.kernel.org/index.php/Conversion_from_Ext3. 

Sources

Further reading

Books

Online