Suggested Exercise 9 Sarah Diesburg Operating Systems CS
Suggested Exercise 9 Sarah Diesburg Operating Systems CS 3430
Hierarchical Name Space n To access the data content of /pets/cat. jpg n The system needs to perform the following disk I/Os 1. Read in the file header for the root directory ‘/’ n Stored at a fixed location on disk /
Hierarchical Name Space n To access the data content of /pets/cat. jpg n The system needs to perform the following disk I/Os 2. Read the first data block for the root directory n Lookup the directory entry for pets / pets
Hierarchical Name Space n To access the data content of /pets/cat. jpg n The system needs to perform the following disk I/Os 3. Read the file header for pets / pets
Hierarchical Name Space n To access the data content of /pets/cat. jpg n The system needs to perform the following disk I/Os 4. Read the first data block for the pet directory n Lookup the directory entry for cat. jpg / pets cat
Hierarchical Name Space n To access the data content of /pets/cat. jpg n The system needs to perform the following disk I/Os 5. Read the file header for cat. jpg / pets cat
Hierarchical Name Space n To access the data content of /pets/cat. jpg n The system needs to perform the following disk I/Os 6. Read the data block for cat. jpg / pets cat
Hierarchical Name Space n So how many disk I/Os do we need to resolve the path? n Depends what resolving means 5 to resolve the path (everything but reading the file) n 6 if resolving includes reading the first file data block n
How would you design your file system differently? n If you have infinite number of CPUs? n If you have infinite memory size? n If you have infinite disk storage? n If you have infinite network bandwidth?
File System Components n Disk layout n Naming n Protection n Reliability
Infinite Number of CPUs n Some of you forgot to think about disk seek and data transfer times n These are separate from computational power n Use naming schemes that take a lot of computational power n E. g. , relational, contextual, content-based n Hash data block locations n Maybe encryption for extra security
Infinite Memory Size n Load (cache) all file to data mappings into memory on boot n Memory-map files to disk
Infinite Disk Storage n Make extra copies for reliability n Make extra copies for speed n Contiguous or segment-based allocation n No longer need to worry about external fragmentation
Infinite Network Bandwidth n Automatic remote copy (remote RAID 1? ) n Store metadata locally (accessed more often), store data remotely (accessed less often)
How would you design a file system n for only large files? n for only small files? n if memory capacity == disk capacity
For large files n Multi-level indexed allocation n Hash allocation – change to one block won’t affect rest
For small files n Indexed allocation n Small segmented allocation
Memory capacity = Disk capacity n Cache all metadata and files as they are being used
- Slides: 18