Your AI powered learning assistant

HOW DOES THE | FAT-32 FILE SYSTEM WORK?

Введение

00:00:00

Digital information is deeply embedded in our daily lives, forming part of our modern nature. Although the basic actions of creating, naming, organizing, and deleting files appear simple, they manage a chaotic stream of bytes stored on devices like flash drives and hard disks. A file system introduces an organized hierarchy, mapping raw data into comprehensible files and directories, thereby transforming randomness into structured information.

Жесткий диск

00:01:05

Physical Disk Structure and Cluster Allocation A hard disk is constructed with multiple platters, each divided into tracks and 512-byte sectors accessed by dedicated read heads. A 32-bit system can address roughly 4 billion sectors, capping usable storage at about 2 TB—a constraint practically overcome by grouping sectors into clusters. Clusters, which typically aggregate several sectors into units like an 8-sector (4 KB) block, optimize data management and align with the infrequent need to handle files as small as a single sector.

Logical Partitioning and File System Deployment Operating systems partition physical disks into logical volumes such as C and D drives where file systems are installed. This strategy abstracts the physical segmentation of sectors and clusters, allowing file systems to manage data more efficiently. By allocating space in fixed cluster sizes, the system streamlines storage management and adapts to both small and larger file requirements.

Файловая система FAT

00:03:28

In 1977, the FAT file system emerged as a straightforward table linking clusters by storing pointers to the next data segment. Its design evolved into various forms such as FAT12, FAT16, FAT32, and even FAT64, each defined by the size of the digital pointers. Initially, all files were stored in a single root directory without any hierarchy, but as memory demands grew, the system underwent continuous improvements. Despite advancements leading modern operating systems like Windows to adopt NTFS, FAT—especially FAT32—remains popular on devices ranging from hard disks to USB flash drives and mobile memory cards.

Интеграция

00:05:08

A recent survey revealed that many experienced front-end developers, with at least three years in the field, are eagerly looking for new career challenges. Yandex is set to host an event on May 27 and 28 that offers a streamlined, weekend hiring process without interrupting current work schedules. Participants can register via a provided link and then access an automated online platform to solve tasks and earn points. Once the required score is achieved, a recruiter will reach out with preparatory materials and detailed information about the interview process.

Главная загрузочная запись MBR

00:06:29

BIOS Initialization and MBR Boot Initiation When the computer powers up, the BIOS performs hardware tests and initializes the system before selecting a boot device. It reads the first sector of the chosen device and copies its content to a specific memory location. This sector, known as the Master Boot Record (MBR), contains executable code that starts the operating system boot process.

Partition Table Structure and Active Boot Process The MBR not only holds the boot code and a termination signature but also includes a partition table with four structures that detail the partition sizes and their positions on the disk. It identifies the active partition, allocates space in memory, and loads its boot sector to transfer control to the OS loader. This legacy approach, based on physical addressing, was standard until updated BIOS versions and GPT replaced it around 2010.

EBPB

00:08:29

Boot Sector Role in FAT32 Structure The FAT32 file system is organized into distinct segments, with the boot sector always occupying the zero-th sector of each partition. This sector holds a jump command and extended parameters that ensure only executable boot code is loaded. It also contains critical driver information for proper interaction with the file system while invalid or non-bootable areas are filled with zeros.

Essential Metadata and System Identification Within the boot sector, vital metadata is stored, including reserved fields, flag settings, and a serial number that originally assisted with physical formatting details. The sector also carries a volume label and a system identifier that define the file system type and highlight compatibility with various operating systems. These fields guarantee that only valid executable code is triggered during boot, protecting the system from unintended errors.

FAT Table Allocation and Replication Strategy Parameters such as bytes per sector and sectors per cluster are used to compute the cluster size, which in turn determines the primary FAT table’s location. The primary table is positioned immediately after the reserved area and is duplicated as a backup to safeguard against data loss. Differentiation between FAT16 and FAT32 is achieved by using a larger, 4-byte field in FAT32, resulting in an extended table consuming nearly 2 MB of memory.

Volume Size Computation and Root Directory Localization The overall volume size is determined by multiplying the total number of sectors by the fixed sector size, applicable to both hard disks and removable drives. Reserved areas and the duplicated FAT tables are taken into account when calculating the precise starting point for the root directory. Revised utilization of formerly designated fields supports BIOS interrupt methods, ensuring accurate conversion from cluster indices to exact byte addresses.

Интеграция

00:14:54

Upgrade your professional skills within an online institution trusted by tech giants, banks, and communication operators. The program delivers an open-door event featuring online conferences where top experts address pressing challenges in Kubernetes and application architecture. Participants receive career consultations, insights into diverse work formats, and practical exposure to state‐of‐the-art training infrastructures. Exclusive benefits, from premium event participation to course subscriptions, round out a comprehensive path to professional growth.

FSINFO

00:16:03

The FSINFO structure is built with redundancy by maintaining a backup copy in a designated low-index sector to safeguard against damage. It streamlines file system operations by storing essential data that indicates either the exact number of free clusters or the starting cluster for subsequent searches, thereby reducing the time spent scanning extensive FAT tables. The remaining fields, set to fixed values with a specialized three-part signature, ensure both the integrity and efficiency of cluster management.

Таблица FAT

00:17:12

FAT Table Structure and Capacity Limits The system reserves initial sectors with zeros and a backup sequence before starting the FAT table at a designated sector. The FAT table assigns clusters using 4-byte cells that essentially provide 28 bits of usable addressing, capping cluster possibilities even with a maximum 32 KB cluster size. A subsequent 64-bit FAT version overcomes these limits by expanding cluster pointers and field sizes.

File Cluster Chaining and Fragmentation Management Files are stored by chaining clusters where each FAT entry points to the next cluster in the file’s sequence. Special markers within the chain denote the end of a file, free space, reserved areas, or errors, thereby segmenting files into discrete groups. These markers help navigate fragmented clusters that may be widely separated, affecting the physical read process. The initial cluster reference is stored separately in a directory structure to initiate the chain assembly.

Root-каталог. SNF

00:20:44

Root Catalog and Metadata Fundamentals The file system begins at a root directory that stores essential details like file names, sizes, and attributes. A designated starting cluster defines the structure, with the FAT table marking clusters for file termination and backup copies. Key metadata, including specific attribute values, distinguishes the root catalog from other directories. This foundation sets the stage for a well-organized disk hierarchy based on reserved clusters and clearly defined file properties.

Bit-Level Timestamp and File Naming Constraints File timestamps are encoded using dedicated bit fields—4 bits for hours, 6 bits for minutes, and 5 bits for seconds—which restricts the seconds value to a maximum of 29. The design embeds both the first cluster number and the file size into subsequent fields, with the latter limited to 4 GB due to a 4-byte cap. A strict 11-byte allocation for file names, divided into an 8-byte main name and a 3-byte extension, adds further constraints. This efficient encoding approach optimizes space while precisely managing file metadata and temporal information.

LFN

00:23:52

An additional structure is introduced to overcome the limitation of standard file name storage, allowing for more characters than the basic allocation permits. This structure is positioned before the main filename format and preserves original case details through a special flag that toggles between uppercase and lowercase displays, while a separate Unicode structure is created when both cases are used. Each supplementary block dedicates 2 bytes per symbol for up to 13 characters, and multiple such blocks are arranged in reverse order to accurately reconstruct the full name. Specific fields, including a structure numbering scheme and a reserved checksum, ensure data integrity, although some Windows versions default to omitting one field entirely.

Адрес файла

00:25:29

The file's exact address in the data block is determined by starting from the first sector of the root catalog and calculating the offset to the file in cluster units. Converting this cluster offset into sectors and adding it to the root catalog’s initial sector yields the starting sector for the file’s data. Multiplying that sector index by the sector size produces the absolute memory address of the file. This structure is maintained through cluster chains, which link directories, file descriptors, and FAT pointers to display the entire file hierarchy.

Удаление файла

00:26:14

File deletion in FAT32 does not remove the actual data; it simply marks the file's clusters as unused by inserting a special byte at the beginning of its structure and zeroing out the cluster pointers. This process leaves the original data intact until it is overwritten with new information. The ability to quickly format a disk and recover deleted files, even after many years, highlights FAT32's efficient and simple design, which is favored for its speed and reduced wear on flash drives.