4.3: File systems

Introduction to Information Technology · LibreTexts

0%

Contents

    Text

    Size
    100%
    Theme
    Typeface
    Line length
    Spacing

    From LibreTexts, under CC BY-NC-SA 4.0, as the source states it; its equations are written in TeX, which the PDF shows typeset. This page at LibreTexts.

    4.3: File systems

    04.3 File Systems.png



    When a process completes (or crashes), any data stored in the main memory is lost. But data stored on a hard disk drive (HDD) or solid-state drive (SSD) is “persistent;” that is, it survives after the process completes, even if the computer shuts down.

    Hard disk drives (HDD) are complicated. Data is stored in blocks, which are laid out in sectors, which make up tracks, which are arranged in concentric circles on platters.

    Solid-state drives (SSD) are simpler in one sense because blocks are numbered sequentially, but they raise a different complication: each block can be written a limited number of times before it becomes unreliable.

    So, you don’t want to deal with these complications. What you want is an appropriate abstraction of persistent storage hardware. The most common abstraction is called a “file system.”

    04.3 Hard Drive.jpg 04.3 Solid State Drive.jpg

    Hard Disk Drive.

    Image by Azamat Esenaliev from Pexels

    Seagate Solid State Drive.

    Image by Andrey Matveev from Pexels.


    4.3.1. Files, File Systems, Directories, and File Management

    A file is a collection of related information that is stored on a storage instrument such as a disk or secondary/virtual storage.

    It is the smallest storage unit from the user’s perspective. The file name includes two parts: name and extension (e.g., filename.txt). Each extension is for a specific purpose such as .exe (in Windows OS) to run a program and .txt for text files.

    A File System is a data structure that stores data and information on storage devices (hard drives, floppy disc, etc.), making them easily retrievable.

    NC State

    A file system is responsible for defining file names, storing files on a storage device, and retrieving files from a storage device. When designing a file system for managing many files, some issues to consider are as follows: most files are small so per-file overheads must be low; most of the disk space is in large files; many of the I/O operations are for large files so performance must be good for large files; files may grow unpredictably over time; users want to use text names to refer to files.

    Special disk structures called directories are used to map names to support hierarchical directory structures. A directory is a set of files that is managed by the OS, and it also contains all the required information about the files, such as attributes, location, and ownership. The UNIX/Linux approach is as follows: directories are stored on disk just like regular files except with extra information to indicate that it is a directory. Each directory contains <name, address> pairs. The file referred to by the address may be another directory; hence, we can have nested and hierarchical directory structures.

    The problems facing modern file systems include disk management, naming, and protection. File systems are often trying to improve access to files by minimizing seeks, sharing space between users, and making efficient use of disk space. A system’s ability to reduce faults and ensure that the information in the system survives OS crashes and hardware failures is called its reliability. In addition to improving reliability, a file system should guarantee a high level of protection by maintaining isolation between users and controlling the sharing of resources.

    Everything that is stored in a computer system, comes in bits and bytes.

    Bit is short for "binary digit“. It is the smallest unit of digital information in computing, and it can have only two possible values: 0 or 1.

    Byte is a group of binary digits or bits (usually eight) operated on as a unit. It is considered as a unit of memory size.

    04.3 Bit and Byte.png

    Bit and Byte. Image by Luis R Castellanos, Public Domain, Own work.

    4.3.2. Disk Devices

    While file systems are a layer of abstraction that provides structured storage and defines logical objects such as files and directories, disk devices are considered raw storage.

    Data that can be directly accessed by the CPU with minimum or no delay and does not survive a power failure is held in primary storage (usually RAM).

    Persistent memory that survives power failures most of the time, such as spinning disks, SSDs, and USB drives, is considered secondary storage. Routines that interact with disks are typically at a very low level in the OS and are used by many components such as file systems and virtual machines. These secondary storage devices may handle the scheduling of disk operations, error handling, and often the management of space on disks. A trend is for disks to do more of this themselves.


    4.3.3. File names and extensions

    Operating systems impose technical restrictions on filenames to prevent conflicts with file system commands and internal paths. In a directory or folder, there can´t be more that one file with the same name, making it unique per file. It can have the same name if you have different copies in different directory or folder.

    File names

    Some considerations:

    • Each file system has different reserved or forbidden characters to use in the file names.
    • There are also some reserved names that can´t be used as a file name.
    • The majority of the modern file systems limit the individual names to 255 or 260 characters (or bytes).
    • By default, in Windows and macOS the names are case-insensitive, but in Linux they are strictly case-sensitive.

    Information about naming rules and restrictions in Windows can be found in Learn Microsoft.

    File Extensions

    A file extension is a suffix added to the end of a computer file string (separated by a period).

    The purpose of file extensions are:

    • Format Identification: Informs the operating system and applications how the internal binary or text data is formatted.
    • Default Application Mapping: The OS maintains an association table mapping specific extensions to default software (e.g., opening .pdf files in Adobe Acrobat or web browsers).
    • Execution & Security Context: Signals to the system whether a file contains static data (e.g., .png) or executable program instructions (e.g., .exe, .sh).

    FILExt is one of the oldest and most respected compendia on file extensions

    04.3 FilExt.png

    FILExt portal. Screenshot image by Luis R Castellanos, Public Domain, Own work.

    4.3.4. Directory Hierarchies and Paths

    Let's see how operating systems structure file system trees, resolve file locations using path syntax, and translate directory strings into internal data structures.

    Directory tree and paths

    A file system directory tree is a hierarchical structure that modern operating systems use to organize files and folders. It is visualized as an inverted tree, where a single root directory sits at the top, and subdirectories branch downward into further folders and files.

    The root directory is the base of the file system. The folders act as branches that contain files or other subdirectories. Files represent the endpoints or leaves of the tree.

    The specific route taken through the branches to reach a file is called a pathname.

    Advantages of Maintaining Directories

    • Efficiency: A file can be located more quickly.
    • Naming: It becomes convenient for users as two users can have same name for different files or may have different name for same file.
    • Grouping: Logical grouping of files can be done by properties e.g. all java programs, all games etc.

    04.3 Tree hierarchy.png

    Folders tree hierarchy.  Image by Luis R Castellanos, Public Domain, Own work.

    4.3.5. Storage Operations and Maintenance

    Basic operations

    The basic File Systems operations are:

    • Create/Delete: Allocates or frees up space in the system's directory structure and storage sectors.
    • Read/Write: The OS locates the specific data blocks on the drive, reads them into RAM, or writes new data from RAM back to the drive.
    • Open/Close: Operations that grant an application a "handle" or "lock" on a file, preventing other programs from modifying it simultaneously.

    Physical Storage Realities: HDD vs. SSD

    File systems must manage different types of hardware differently to maintain performance and hardware lifespan.

    • Hard Disk Drives (HDDs) & Fragmentation: HDDs use spinning magnetic platters. When large files are written, they may be broken into non-contiguous blocks scattered across the disk. This fragmentation increases the mechanical seek time of the read/write head. Operating systems use defragmentation tools to physically reorganize these blocks into contiguous spaces.
    • Solid-State Drives (SSDs) & TRIM: SSDs use flash memory with no moving parts, making fragmentation irrelevant. However, SSD flash cells must be completely erased before they can be rewritten (erase-before-write). The OS issues a TRIM command to tell the SSD which data blocks are no longer in use by the file system. This allows the SSD's internal controller to erase those blocks in the background (garbage collection), keeping write speeds fast and extending the drive's lifespan.

    File System Integrity & Recovery

    Power outages or system crashes during a write operation can corrupt the entire file system.

    • Journaling: Modern file systems (like NTFS, ext4, and APFS) use a "journal." Before writing actual data to the main disk structure, the OS logs its intent to make a change in a dedicated journal area. If the system crashes mid-write, the OS reads the journal upon reboot and either completes the pending operation or rolls it back, preventing corruption.
    • Integrity Tools: Utilities like chkdsk (Windows) or fsck (Linux/macOS) scan the file allocation tables to locate and repair "orphaned" files or bad storage sectors.

    4.3.6. File Systems used by some Operating Systems

    The most important part of the file system is the method used to index files on the hard drive. This index allows the OS to locate specific files. Typically, this index is based on file names, but different operating systems and file systems use different indexing methods.

    Windows: 3 file systems

    In the Windows environment, you will find one of three file systems, each with different indexing methods.

    1. The File Allocation Table (FAT) file system
    2. The NTFS (New Technology File System)
    3. exFAT (extensible FAT): A lightweight file system used primarily in flash storage applications and SD cards.

    More information about NTFS can be found in Learn Microsoft site.

    Mac OS

    In the macOS environment you will find the HFS+ file system, or in newer computers you may find APFS.

    More information about Apple File Systems can be found in the Apple Developer site.

    Linux

    Depending on which type of Linux environment you are running, you may run into several different file systems. Some of them are ext2, ext3, and ext4. XFS, JFS, and a few others are also used. ext3 is a journaling extension to the ext2 file system on Linux. ext4 is the successor to ext3.

    More information about Linux File Systems can be found in the Linux Kernel site.

    Android

    Android uses a mix of file systems depending on the partition (/data, /system, /sdcard) and hardware manufacturer:

    1. Internal Storage Partitions (/data, /system)

    • F2FS (Flash-Friendly File System)
    • ext4 (Fourth Extended File System)
    • EROFS (Enhanced Read-Only File System)

    2. Removable / External Storage (/sdcard, USB drives)

    • exFAT (Extended File Allocation Table)
    • FAT32 / VFAT

    iOS

    The primary file system across all modern iOS devices is APFS, which is optimized for flash storage and Solid State Drives (SSDs).

    Most used File Systems

    04.3 Logo Windows.png 04.3 Logo MacOS.png 04.3 Linux.png 04.3 Logo Android.png 04.3 Logo iOS.png

    FAT

    NTFS

    exFAT

    HFS+

    APFS

    ext4

    XFS

    JFS

    btrfs

    exFAT

    FAT32

    F2FS

    ext4

    HFS+

    APFS

    Windows 11 logo. Microsoft, Public domain, Wikimedia Commons macOS logo. Apple Inc., Public domain, Wikimedia Commons Tux. Linux mascot. By  TDrzewo from Pixabay Android logo. Google, Public domain, Wikimedia Commons iOS logo. Apple Inc., Public domain, Wikimedia Commons

    References.png

    Apple Inc. Apple File System Guide. Apple Developer Documentation. Link.

    Arpaci-Dusseau, Remzi and Arpaci-Dusseau, Andrea. Operating Systems: Three Easy Pieces. Version 1.10, Arpaci-Dusseau Books, 2023. University of Wisconsin-Madison. Link.

    Franchitti, Jean-Claude. Introduction to Computer Science. OpenStax. Rice University. 2024. Link.

    Geeks for Geeks. File Systems in Operating System. 2026. Link.

    Linux Kernel Organization. Flash-Friendly File System (F2FS). The Linux Kernel Documentation, 2022. Link.

    NC State University. E 115: Introduction to Computing Environments. Link.

    PGCC. INT1010: Concepts in Computing. Libretexts. 2021. Link.

    Silberschatz, Abraham, Peter B. Galvin, and Greg Gagne. Operating System Concepts. 10th ed., John Wiley & Sons, 2018.

    Image by Memed_Nurrohmad from Pixabay

    This page titled 4.3: File systems was last modified on Fri, 04 Sep 2026 15:15:06 GMT and is shared under a CC BY-NC-SA 4.0 license and was authored, remixed, and/or curated by Luis Castellanos Hurtado.