Networking basics, Understanding File Systems and Disk Structures

File systems and disk structures are essential components of data storage in computers. They define how data is stored, organized, retrieved, and managed on disks. This guide introduces the basic concepts of file systems and how disk structures work under the hood.

Step 1: What is a File System?

A file system is a method and data structure that the operating system uses to control how data is stored and retrieved. Common file systems include:

  • FAT32: Simple and widely compatible (used in USB drives).
  • NTFS: Advanced file system used by Windows with support for permissions and compression.
  • ext4: Default file system in most Linux distributions.
  • APFS: Apple File System used in macOS and iOS.

Step 2: File System Components

  • Files: Collections of data stored on disk.
  • Directories (folders): Used to organize files hierarchically.
  • Inodes: Structures in Unix/Linux systems that store metadata about files.
  • Allocation Tables: Keep track of which parts of disk space are used or free.

Step 3: Disk Structure Basics

Disks are divided into:

  • Sectors: Smallest unit of storage (typically 512 bytes or 4 KB).
  • Tracks and Cylinders: Concentric rings of data.
  • Partitions: Divisions of physical storage into logical volumes.

Each partition can have its own file system.

Step 4: Mounting and Accessing Disks

Operating systems must mount a file system to access it:

# Linux
    mount /dev/sda1 /mnt

    # Windows
    Automatically mounts C:, D:, etc.

Step 5: Formatting a File System

Formatting prepares a disk for use with a specific file system:

mkfs.ext4 /dev/sdb1  # Linux
    format D: /FS:NTFS   # Windows (command line)

Step 6: Journaling and Performance

Modern file systems like NTFS and ext4 use journaling to improve reliability by recording changes before they're committed. This helps recover from crashes.

Step 7: Network File Systems

Remote storage can be accessed via:

  • NFS: Network File System (Unix/Linux)
  • SMB: Windows file sharing (also supported in Linux/macOS)

Next Steps

Explore disk partitions and file system types on your machine. Tools like lsblk, fdisk, or Disk Management (Windows) are great for this. Understanding file systems is crucial for system administration, forensics, and data recovery.