File Systems
1/8
1/12
This material was developed with funding from the
National Science Foundation under Grant # DUE 1601612
Next
Back
Restart
Close
Threeway Hand Shake
What is a File System?
2/12
A file system provides a way of organizing and retrieving files from a storage medium such as a hard drive or a USB drive. A file system handles operations, such as storage management, file naming, directories/folders, metadata, access rules and privileges.
Without a file system, data on a storage device would be one large mass with no way to tell where one file stops and the next begins. File systems differ between operating systems such as Windows, macOS, and Linux, and some file systems are designed for specific applications.
Indexed
a file that allows easy random access to any record given it file key (the key uniquely identifies a record)
Metadata
includes file types, size, creation data and time, and type of compression
First, the storage device must be partitioned. A partition can either contain all the space on a physical storage device or some of it, but there must be at least one partition. Next, the partition must be formatted. Formatting includes the process of writing a file system and selecting an allocation unit size.
Click Here to Partition
and Format Disk
3/12
Partitions
/home/user/lab/file.txt
Apple Path Example
Folder5
Users/Student/Desktop/lab1.pages
Files and Filenames
Folder7
A file system uses a tree structure to group files into directories (or folders) for organizational purposes.
A path specifies a unique location in the file system. By using the directory tree structure, you can pinpoint the location of a file. Each component of the path is separated by a delimiting character which is operating system dependent (the slash (/), the backslash (\) or the colon (:). The very first slash or backslash represents the root directory, the topmost location in the tree structure.
Each file has a filename which can contain a wide range of characters. In some file systems, filenames are case sensitive (File1 is a different file than file1).
Windows Path Example
Click on each example below
Folder2
Root
Folder4
Linux Path Example
Folder6
Folder1
\windows\system32\cmd.exe
5/12
Folder3
Date created
File type
Last backup
Element
with Audio
HTML
Last date of access
File content
File name
File systems use metadata to store and retrieve files. See if you can correctly classify the elements of metadata.
User ID of the
file creator
First backup
Drag and drop the the elements of metadata
Date deleted
Metadata Challenge
Great Job!
Date modified
File title
11/12
ext3
FAT
exFAT
Btrfs
HFS+
Apple
FAT32
ext4
Common File Systems
FAT12
ZFS
Windows
ext2
Each operating system offers several file system choices. Different file systems have different ways of organizing data, limits, metadata, features, and support for other operating systems.
APFS
ext
NTFS
Linux
Click on each operating system to reveal the file system choices
HFS
6/12
FAT16
No
Encryption
4096 bytes
Yes
NTFS is the default file system for Windows
Snapshots
<16 MB
Provided by volume shadow-copying service
2 GB
Linux
macOS
File System Comparison Table
Windows
4GB
16 TB
Linux, macOS
game consoles
Click on each file system to build the table
16 exbibytes1
Linux with ntfs-3g
8/12
4KB-128KB
FAT stands for file allocation table. As FAT file systems evolved, each had an increased number of clusters and maximum file and volume (or partition) size. FAT32 remains popular due to its compatibility with various operating systems.
8 characters
Read/write on macOS
255 characters
Extended File Allocation Table (exFAT)Optimized for high-capacity USB flash drives
Max Volume Size
NTFS
8 (255 using long file names)
“ * / : < > ? \ | and space
Allocation unit size
exFAT
Max File Size
1 An exabyte = 260 bytes
2 A zebibyte = 276 bytes
2 TB
/ and space
Filename
16 MB
64 zebibytes2
" * / : < > \
Case-sensitive
4 GB
512-4096 bytes
Disallowed filename characters
Other OS Support
16TB
2KB-64KB
Journaling
4KB-32KB
Default file system for Linux
12/12
Ext3
Choosing a File System
An SSD on an Apple system
Drag and drop the file system that would work best for each scenario
APFS
Ext4
First Linux file system with journaling
Compatible with Windows, Mac, Linux, and game consoles
High capacity USB drive
HFS+
ZFS
FAT32
Allocation units are the smallest amount of disk space used to hold a file. Selecting Default is usually the best choice. Allocation unit size is adjustable depending on the file system chosen, the size of the drive, or how the drive will be used. If you have lots of small files, keep the allocation size small. A larger allocation size is better for larger file (movies, images, audio), and it will increase system performance because there will be less blocks to find. The size of the allocation unit is important to avoid wasted space. In general, a 4KB block size offers a balance between space efficiency and speed.
4/12
Allocation Units
A computer notes that it is going to write a certain file to disk in the journal, it writes that file to disk, and then removes that job from the journal. If the power goes out during the writing process, the OS checks the file system’s journal when it boots up and resumes any partially completed jobs. This prevents data loss and file corruption.
Journaling does slow disk operation, but it is well-worth it on a desktop or laptop. The full file is not written to the journal; only the file metadata, inode, or disk location is recorded in the journal.
On high-performance servers, extra performance is gained when journaling is NOT used.
3. Files "punch out" after work is done
Snapshots provide read-only copies of the file system at a single point in time. Snapshot versions of individual files or an entire dataset can be easily accessed, searched, and restored. Snapshots can be cloned to create a new copy and provide a replicated backup on a separate server. Snapshots can be rolled back or can be compared to each other to check for modified data. Snapshots are a useful tool in avoiding the impact of ransomware.
Metadata
Rules for Naming Files and Folders in Windows
Avoid extra long folder namesUse the underscore _Use descriptive namesAvoid using special characters (@, ?, #, &, %, $)Writing File or Folder Path
7/12
Journal
File naming includes limits such as number of characters in a file name and which characters can be used. A file system may restrict the use of certain special characters because the character refers to a device, directory prefix, or file path separator. Others limit the use of a space (or NUL).
Filesystem-level Encryption
File systems attach important information describing properties about each file or directory such as date created, date modified, file size, author, or access permissions which help organize, perform operations and track files. File systems store some of the metadata for a file in the directory table and the rest of the metadata in a separate structure (called an inode).
1. Files "punch in" for disk write
File System Features
The file system encrypts individual files or directories rather than the full disk or entire partition.
File naming
2. Files do their work
2TB to 32TB1
16 KB
requires Installable File System (IFS)
16GB to 16TB
9/12
space , /
Ext3
16GB to 2TB1
2TB to 32TB
Read/write on macOS
16 exbibytes
255 bytes
Ext2
1,024, 2,048 or 4,096 bytes
First file system created specifically for LinuxMany Linux distributions no longer support ext
4,096 bytes
Allows journaling (dedicated area where all changes are tracked--if the system crashes, there is less chance of file system corruption)Directories can contain 32,000 subdirectoriesCan easily convert ext2 to ext3 directly (no backup/restore required)
Space
Cannot be read by Windows or Mac systems
16GB to 2TB
1 Depends on allocation unit size
Recommended for flash and usb drives since it does not have the overhead with journalingSupports extended file attributesRemedied fragmentation issues of ExtInodes include data about the size, permission, ownership, and location on disk
Space/
1EB
Ext4
Supports very large individual file size and overall file system sizeCurrent default file system on most Linux distributionsDirectories can contain a max of 64,000 subdirectoriesImproved performance and reliabilityJournaling can be turned off
B-Tree File SystemChecksums on data and metadataDefault file system for SUSE Linux Enterprise ServerEach file and directory object have an inode item (a data structure that describes a file system data--attributes can include metadata, owner, and permission data
16 exbabytes1
Requires Open ZFS on Windows
Originally developed by Sun MicrosystemsEach file has a checksum to determine whether a file is corrupted or notUbuntu uses ZFS by default for containers
128 KB
File System Comparison Table
Linux
4096
:
Hierarchical file system for macOS
Apple file system, a proprietary file system for iOS 10.3 and later, tvOS 10.2 and later, and watchOS 3.2 and later. Uses copy-on-write to avoid metadata corruption (new records are written instead of overwriting existing metadata records. Provides a better choice for solid state and flash drives.
8 EB
2TB
HFS Extended (HFS+), aka Mac OS Extended, introduced journaling. It is still a good option for older drives.
31 characters
File System Comparison Table
Apple
Volumes reside in containers and have no specified size
No native Windows or Linux support
10/12
Depends on volume size
2GB