Operating System - Files & File Systems

Introduction to File Management in Operating Systems

  • Storing a single file in a cabinet is simple, but handling hundreds of thousands of files is a challenge.

  • On computers, we can store vast amounts of files, but tracking them is essential.

  • The kernel is responsible for file storage and file systems in the operating system.

Key Components of File Management

  • Three main components to handling files in an OS:

    • File Data: The actual content being stored.

    • Metadata: Information that describes the file.

    • File System: Organizes how files are stored and accessed.

Understanding File Systems

  • Initial Setup:

    • A new hard disk must be erased and configured before the OS can read and write data.

    • The OS needs to recognize the type of file system used.

  • Types of File Systems:

    • Different file systems suit different needs:

      • Some support large volumes of data, while others handle small amounts.

      • Varying speeds and levels of resiliency against data corruption.

    • Major OS manufacturers have dedicated file systems:

      • Windows:

        • NTFS (New Technology File System) is primarily used.

        • Features include:

          • Encryption

          • Faster access speeds

          • Enhanced security

        • ReFS (Resilient File System) is under development but not yet ready for general use.

      • Linux:

        • Multiple distributions utilize different file systems.

        • EXT4 is a standard that supports compatibility with older EXT types.

    • File systems generally do not interact seamlessly, affecting file transfers between them.

    • Guideline: Use the operating system's recommended file system for optimal performance.

Storing File Data

  • Data is stored in data blocks:

    • Files can be fragmented and stored in non-contiguous areas on the disk.

    • This approach leads to:

      • Faster access to data due to parallel storage.

      • Better utilization of disk space, avoiding large contiguous blocks being filled unnecessarily.

Importance of Metadata

  • Metadata includes crucial information about the files:

    • Creator's information

    • Last modification date

    • Access rights and permissions

  • Determines the type of file via file extensions:

    • Example: "cool_image.JPEG" indicates an image file type.

  • Familiarity with file systems and metadata aids in various IT tasks, including:

    • Data recovery from damaged disks.

    • Setting up dual-boot systems with different operating systems.