1. Scattered Storage
The OS rarely saves files in a perfect sequence.
- When you save a file, the OS finds any available empty blocks on the Hard Drive.
- A single image might be shattered across Block 2, Block 45, and Block 60. This is called Fragmentation.
2. Linked Lists vs Inodes
How does the OS remember where the scattered pieces are?
- Linked Allocation (FAT32): Block 2 contains data + a pointer to Block 45. Block 45 points to 60. You must traverse them sequentially like a Linked List.
- Indexed Allocation (Inodes - Linux): The OS creates a central "Index Node" containing an array of all pointers
[2, 45, 60]. Much faster for random access!
3. Loading to RAM
The Hard Drive is permanent but slow. RAM is volatile but fast.
- To open a file, the OS reads the Inode, hunts down every scattered physical block on the disk, and copies the data into continuous, sequential memory in the RAM so the CPU can process it.