linked list allocation
In linked allocation, a file is divided into blocks (just like other methods), but instead of storing them contiguously, the blocks can be scattered anywhere on the disk. These blocks are connected using a linked list, where each block contains:
- The data
- A pointer to the next block
The OS only stores the starting block address of the file. From there, it follows the pointers to access the entire file. Suppose a file F needs 4 blocks. Instead of storing them together, the OS may allocate:
To read the file:
1. Start from first block
2. Read data
3. Follow pointer to next block
4. Repeat until NULL
2. Read data
3. Follow pointer to next block
4. Repeat until NULL
Comments
Post a Comment