Difference between revisions of "File system"

From Computer History Wiki
Jump to: navigation, search
m (+cat)
m (See also: Link to ODS-2 added)
 
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
A '''file system''' is an abstraction provided by an [[operating system]] to users for them to store data aggregates of all sorts (program source, [[executable binary]], document source and formatted output, etc, etc), using names for them which make sense to the users. The actual storage itself typically uses [[secondary storage]] (generally [[disk]]).
+
A '''file system''' is an abstraction provided by an [[operating system]] to users for them to store data aggregates of all sorts ([[program]] [[source code]], [[executable binary]], document source and formatted output, etc, etc), using names for them which make sense to the users. The actual storage itself typically uses [[secondary storage]] (generally [[disk]]).
  
The file system takes the actual storage blocks (normally identified with a block number) on a disk, and starts by allocating enough of them to hold a [[file]] of the desired size, and then makes a record of which blocks belong to which files. It also has to know which blocks are 'free', and available for allocation - a variety of data structures are used to hold this information (free lists, free arrays, etc).
+
The file system takes the actual storage blocks (normally identified with a block number) on a disk, and starts by allocating enough of them to hold a [[file]] of the desired size, and then makes a record of which blocks belong to which files. It also has to know which blocks are 'free', and available for allocation - a variety of data structures are used to hold this information (free [[list]]s, free [[array]]s, etc).
  
A file system also normally includes '''directories''', which are collections of related files. Modern file systems are usually a tree-structured [[hierarchy]]; i.e. a directory can also include other directories, the whole being structured as a tree descending from a '''root directory'''.
+
A file system also normally includes [[directory|directories]], which give the names of the files. Modern file systems are usually a tree-structured [[hierarchy]]; i.e. a directory can also include other directories, the whole being structured as a [[tree]] descending from a '''root directory'''.
  
 
==Operations provided==
 
==Operations provided==
Line 19: Line 19:
 
Two main approaches have been used to organize file systems internally.
 
Two main approaches have been used to organize file systems internally.
  
Originally, the information as to which blocks were part of a file was kept in the directory, along with other meta-information about the file (date last modified, etc); this approach was used in early operating systems such as [[Multics]], as well as later ones like [[Windows]].
+
Originally, the information as to which blocks were part of a file was kept in the directory; this approach was used in early operating systems such as [[Compatible Time-Sharing System|CTSS]] and [[TOPS-10]], as well as later ones like [[Multics]] and [[Windows]].
  
[[UNIX]] started a new approach, in which most information about a file (particularly, which blocks were used to hold it) was kept in a separate structure (called an [[inode]] in UNIX); directories (usually implemented as an abstraction on top of the previous layer) only held mappings from file-names (visible to users) to inode numbers.
+
[[UNIX]] started a new approach, in which most information about a file (particularly, which blocks were used to hold it) was kept in a separate structure (called an [[inode]] in UNIX); directories (usually implemented as an abstraction on top of the file layer) only held mappings from file-names (visible to users) to inode numbers.
  
 
==See also==
 
==See also==
Line 27: Line 27:
 
* [[UNIX file system]]
 
* [[UNIX file system]]
 
* [[BSD Fast File System]]
 
* [[BSD Fast File System]]
 +
* [[On-disk Structure 2]]
  
 
[[Category: OS Basics]]
 
[[Category: OS Basics]]

Latest revision as of 08:48, 26 March 2023

A file system is an abstraction provided by an operating system to users for them to store data aggregates of all sorts (program source code, executable binary, document source and formatted output, etc, etc), using names for them which make sense to the users. The actual storage itself typically uses secondary storage (generally disk).

The file system takes the actual storage blocks (normally identified with a block number) on a disk, and starts by allocating enough of them to hold a file of the desired size, and then makes a record of which blocks belong to which files. It also has to know which blocks are 'free', and available for allocation - a variety of data structures are used to hold this information (free lists, free arrays, etc).

A file system also normally includes directories, which give the names of the files. Modern file systems are usually a tree-structured hierarchy; i.e. a directory can also include other directories, the whole being structured as a tree descending from a root directory.

Operations provided

The typical operations provided by the operating system include:

  • opening and closing files;
  • reading and writing them;
  • moving to a different position in a file prior to reading/writing;
  • creating new files, and deleting existing ones;
  • moving a file to a new location.

Approaches

Two main approaches have been used to organize file systems internally.

Originally, the information as to which blocks were part of a file was kept in the directory; this approach was used in early operating systems such as CTSS and TOPS-10, as well as later ones like Multics and Windows.

UNIX started a new approach, in which most information about a file (particularly, which blocks were used to hold it) was kept in a separate structure (called an inode in UNIX); directories (usually implemented as an abstraction on top of the file layer) only held mappings from file-names (visible to users) to inode numbers.

See also