FILE SYSTEMS AND FILE MANAGEMENT

1. Booting and Bootstrapping

The process of starting a computer involves a hand-off of control from firmware to the operating system.

+2


Traditional BIOS Booting

  1. Initialization: The PC is turned on and the BIOS initializes hardware.

    +1



  2. MBR Access: The BIOS calls code stored in the Master Boot Record (MBR) at the start of disk 0.



  3. Partition Loading: The MBR loads code from the bootsector of the active partition.



  4. Bootloader: The bootsector runs the bootloader, which presents an OS menu and loads the selected OS Kernelinto memory.

    +2


UEFI (Unified Extensible Firmware Interface)

UEFI is a modern replacement for BIOS with several advantages:

+1



  • Storage: Initialization information is stored in an .efi file within a special EFI System Partition (ESP) on the hard drive rather than in firmware.



  • Disk Support: Supports disks larger than 2 TiB using the GUID Partition Table (GPT), which allows for sizes up to 8 ZiB.

    +1



  • Capability: Features a CPU-independent architecture and drivers, along with network capability in the pre-OS environment.



2. File Concepts and Terminology

A file is a collection of usually related data.



  • Block: The smallest unit of data, typically between 256 and 4096 bytes; files require at least a one-block minimum.



  • Cluster: A group of one or more blocks.



  • Logical View: How the user sees the contents and attributes of files.



  • Physical View: The actual way a file is stored within the computer system.


  • Access Methods:


    • Sequential: Records must be retrieved from the beginning.



    • Random/Relative: Records can be retrieved from anywhere in any sequence.



3. File Storage Allocation

How the OS assigns physical blocks to files impacts performance and fragmentation.



  • Contiguous Allocation: Blocks are stored together in a row.

    +2



    • Pros: Simple access for sequential and random methods.

      +1



    • Cons: Disk fragmentation and difficulty handling file growth.

      +1



  • Non-contiguous (Linked) Allocation: Blocks are scattered; each contains a link to the next.

    +1



    • FAT (File Allocation Table): A variation where links are stored in a central table.



  • Indexed Allocation: All pointers for a file are stored in a single index block.



    • Unix i-nodes: Use direct and indirect blocks to accommodate files up to hundreds of gigabytes.



4. Journaling and Protection


  • Journaling File Systems: Use a log file to record every transaction requiring write access.



    • Structure Only: Protects the integrity of the file system structure (e.g., Windows NTFS).



    • Full Data: Guarantees integrity of data not yet written to disk (e.g., Linux ext4).



  • File Protection: Systems typically offer Read, Write, and Execution protection.



    • ACL (Access Control List): A detailed list of users and their specific permissions.



    • Owner/Group/Everyone: A standard method used in UNIX/Linux.

      +1



5. Directory Structures

Directories provide the organization needed to locate files efficiently.



  • Tree-Structure: A hierarchical structure with a top-level root.



    • Absolute Path: Full path starting from the root (e.g., C:\FINANCE\QUICKEN\Q.EXE).



    • Relative Path: Path created starting from the current directory.



  • Acyclic-Graph Directory: Allows links (like Windows shortcuts or Unix symbolic links) between branches, but does not allow cycles.