Understanding Hard Disk Structure: Physical, Logical, and File Systems
1. Physical Structure
A hard disk case is tightly composed of two non-interchangeable elements:
- Read/Write Head: A set of electronic and mechanical components enabling data storage and retrieval.
- Disk (Platter): A disk array (plates) storing information magnetically. One plate has two magnetic surfaces (top and bottom) composed of millions of magnetized elements representing bits (0 or 1).
Eight contiguous bits form one byte (one character).
1.1. Hard Disk Mechanics
Mechanisms for accessing data on the platters:
- Each magnetic surface has a dedicated read/write head. The number of heads impacts the hard disk cost.
- One plate equals two faces. The number of disk faces equals twice the number of plates in the stack.
- A mechanical arm moves the heads linearly across the platter stack.
- The hard disk requires constant-speed rotation while the computer is on.
1.1.1. Read/Write Factors
Factors involved in read/write operations: CPU, disk controller, BIOS, OS, RAM, and hard drive.
Read Operation:
- Move the read/write head to the data’s starting location.
- Wait for the data to rotate beneath the head.
- Read the data with the corresponding head.
Write Operation: Similar to the read operation.
1.2. Accessing the Hard Disk
- CHS (Cylinder, Head, Sector): Specifies the cluster location for IDE drives smaller than 516MB.
- LBA (Logical Block Addressing): A software mechanism translates logical addresses to physical addresses for IDE drives larger than 516MB and SCSI disks.
2. Logical Structure
The logical structure consists of:
- The Master Boot Record (MBR)
- Partitioned space
- Unpartitioned space
2.1. Boot Sector (MBR)
The MBR is the first sector of the hard disk (head 0, cylinder 0, sector 1). It stores:
- The partition table
- The Master Boot program, which reads the partition table and transfers control to the active partition’s boot sector. An error message appears if no active partition exists.
2.2. Space Partitioning
Partitioned space is allocated to a partition. Unpartitioned space is not yet assigned to any partition.
3. Partitions
One physical hard drive can have multiple logical drives (partitions). At least one partition is required. Partitioning informs the OS about the hard drive’s capacity.
Partitions are characterized by size, cylinders, and filesystem. Partition types:
- Active: The primary partition controlling the machine’s startup. It must have an OS installed.
- Primary: Can hold an OS (maximum 3). Any primary partition can be active.
- Extended: Extends from the end of the primary partition(s) to the end of the disk (maximum 1). Contains logical partitions for programs and data.
- Logical: Reside within the extended partition (no maximum).
OS installation involves partition creation, OS installation (formatting and file copying), and activation.
Partitioning tools include FDISK, MS-DOS, Windows 95, 98, and Me, and Partition Magic.
4. File System
The file system determines the logical structure and cluster size (minimum file size on disk). Each partition has its own structure.
The boot sector is common to all partition types. In MS-DOS and Windows 95, it contains the boot sector, FAT copies, root directory, and data area.
4.1. File System Classification
File systems vary depending on the OS:
- FAT16 (DOS and Windows 3.11)
- FAT32 (Windows 95/98)
- HPFS (OS/2 and NT)
- NTFS (Windows NT 4.0 and 2000)
- Ext2 and Swap (Linux)
FAT file systems store the File Allocation Table in duplicate.
4.2. NT File Systems
NT supports FAT, NTFS, and CDFS (Compact Disc Filing System).
4.3. FAT Features
- Modified version of DOS’s FAT file system.
- Visible from any OS.
- Supports file and folder security.
- Full Control access for users on FAT partitions.
- Supports long filenames under NT (NTVDM subsystem).
- Maximum path and filename length: 255 characters.
- Retains case but is not case-sensitive.
- File access speed depends on file type, size, partition size, number of files, fragmentation, and search method.
- Efficient for partitions smaller than 500MB.
- Maximum partition size: 4GB.
- Does not support file compression.
4.4. NTFS Features
- Supported only by NT.
- Supports file and folder security (local and network).
- Uses Access Control Lists (ACLs) and Security Identifiers (SIDs).
- Long filenames (255 characters).
- Retains case but is not case-sensitive.
- Faster access for large partitions.
- Theoretical maximum partition size: 16 exabytes, functional limit: 2TB.
- Supports file compression.
- Recoverable file system.
- Reduces fragmentation.
- Per-user Recycle Bin.
- Does not support environment changes without rebooting.
Converting from FAT to NTFS: convert drive /FS:NTFS [/V]