- Function : main permanent data storage Speed Bottleneck!
- Capacity not a problem nowadays. But backup becoming a problem.
- Logical view (view of programmer) : tree structure of files together with read/write operation and create of directories.
- Physical view : sequence of blocks, which can be read and written. OS has to map logical view to physical view, must impose tree structure and assign blocks for each file.
Two main possibilities to realize filesystem :
- Linked list : Each block contains pointer to next.
Problem : random access (seek()) costly : have to go through whole file until desired position. - Indexed allocation : Store pointers in one location : so-called indexed block (similar to page table). To cope with vastly differing file size, may introduce indirect index blocks.
Indexed blocks are called inodes in Unix.
inodes store additional information about the file (e.g., size, permissions)
Example : FAT
- F(ile) A(llocation) T(able) - dates back to 70s.
- Useful for explaining filesystem concepts, modern filesystems are more complicated
- Variants FAT12. FAT16, FAT32 define number of bits per FAT entry - we focus on FAT16
- Sector = disk unit (e.g. 512 byte), aka block
- Cluster = multiple sectors (factor 1, 2, 4, … , 128) (here: assume cluster = 1 sector)
- Uses linked list (“cluster chain”) to group clusters