OS File Systems
An integral part of an OS is what is called a File System. A File System is a data structure that stores data and information on storage devices (hard drives, floppy disc, etc.), making them easily retrievable. Different OS’s use different file systems, but all have similar features.
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 know at any given time where to find a specific file on the hard drive. This index is most typically based on file names. Depending on the operating system there are different file systems, and thus different indexing methods.
In the Windows environment, you will find one of three file systems, each with different indexing methods. The first is known as the FAT (12, 16, or 32) file system. This system uses what is known as a File Allocation Table to index the files on the disc. This file allocation table is very simple to implement and use, but can be somewhat slow. It divides hard disks into one or more partitions (parts) that become letters, like C:, D:, etc.
The second file system you may encounter when using Windows is known as NTFS (New Technology File System). NTFS uses binary trees that, while complex, allow for very fast access times. It builds on the features of FAT, adds new features, and changes a few others. It is a recoverable file system, which means that it keeps track of actions in the file system.
The third file system, exFAT, is a lightweight file system used primarily in flash storage applications and SD cards. It has large file size and partition size limits, which means you can store files over 4GB on a flash drive or SD card that is formatted with exFAT.
In the macOS environment you will find the HFS+ file system. HFS Plus or HFS + uses something known as a B-Tree to index the files on the hard discs. B-Trees (which are different than a binary tree) allow for fast access time, much like the binary tree. As of June 2016, Apple has implemented their new file system “APFS,” which also uses the B-Tree to index files. This has become the replacement for HFS+ on macOS High Sierra and onward, as well as iOS 10.3+.
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. The most common is ext3, which is a journaling extension to the ext2 file system on Linux. Journaling is a method of recording data that results in massively reduced time spent recovering a file system after a crash. XFS is very fast and also uses B-Trees for its file indexing.