Weekly Note 10 - Week 15
04 April 2019
Lecture - Tuesday, April 9nd.
16-19 in U82
This week we will cover the most relevant parts of the three chapters that relate to file systems: 13 - File system interface, 14 - File System Implementation and 15 - File system internals.
We will have a small review of the previous lecture, so this time it will be chapters 11 and 12, and have the Kahoot as well.
Tutorial session
Thursday April 11th. 08-10 or 12-14 in U166.
Preparation:
Make a list of 10-15 keywords for a 10 min. presentation with the topic: "File-System and Implementing File-Systems"
Prepare at home to discuss:
-
Consider a file system where a file can be deleted and its disk space Reclaimed while links to that file still exist. What problems may occur if a new file is created in the same storage area or with the same absolute path name? How can these problems be avoided?
-
The open-file table is used to maintain information about files that are currently open. Should the operating system maintain a separate table for each user or just maintain one table that contains references to files that are being accessed by all users at the current time? If the same file is being accessed by two different programs or users, should there be separate entries in the open file table?
-
What are the advantages and disadvantages of a system providing mandatory locks instead of providing advisory locks whose usage is left to the users' discretion?
-
Provide examples of applications that typically access files according to the following methods: i.) Sequential, ii.) Random
-
Some systems automatically open a file when it is referenced for the first time, and close the file when the job terminates. Discuss the advantages and disadvantages of this scheme as compared to the more traditional one, where the user has to open and close the file explicitly.
-
If the operating system were to know that a certain application is going to access the file data in a sequential manner, how could it exploit this information to improve performance?
-
Give an example of an application that could benefit from operating system support for random access to indexed files.
-
Contrast the performance of the three techniques for allocating disk blocks (contiguous, linked, and indexed) for both sequential and random file access.
-
Consider a system where free space is kept in a free-space list. Suppose that the pointer to the free-space list is lost. Can the system reconstruct the free-space list? Explain your answer. Consider a file system similar to the one used by UNIX with indexed allocation. How many disk I/O operations might be required to read the contents of a small local file at /a/b/c? Assume that none of the disk blocks is currently being cached. Suggest a scheme to ensure that the pointer is never lost as a result of memory failure.
-
Some file systems allow disk storage to be allocated at different levels of granularity. For instance, a file system could allocate 4 KB of disk space as a single 4-KB block or as eight 512-byte blocks. How could we take advantage of this exibility to improve performance? What modifications would have to be made to the freespace management scheme in order to support this feature?
-
Consider a file system on a disk that has both logical and physical block sizes of 512 bytes. Assume that the information about each file is already in memory. For each of the three allocation strategies (contiguous, linked, and indexed), answer these questions: How is the logical-to-physical address mapping accomplished in this system? (For the indexed allocation, assume that a file is always less than 512 blocks long.) If we are currently at logical block 10 (the last block accessed was block 10) and want to access logical block 4, how many physical blocks must be read from the disk?
-
Fragmentation on a storage device could be eliminated by recompaction of the information. Typical disk devices do not have relocation or base registers (such as are used when memory is to be compacted), so how can we relocate files? Give three reasons why recompacting and relocation of files often are avoided.
-
Explain why logging metadata updates ensures recovery of a file system after a file system crash.
In class:
Use the first 30 minutes to work on those exercises:
-
Discuss the advantages and disadvantages of supporting links to files that cross mount points (that is, the file link refers to a file that is stored in a different volume).
-
Some systems provide file sharing by maintaining a single copy of a file; other systems maintain several copies, one for each of the users sharing the file. Discuss the relative merits of each approach.
-
Discuss the advantages and disadvantages of associating with remote file systems (stored on file servers) a different set of failure semantics from that associated with local file systems.
-
What are the advantages of the variation of linked allocation that uses a FAT to chain together the blocks of a file?
-
Discuss how performance optimizations for file systems might result in difficulties in maintaining the consistency of the systems in the event of computer crashes.
-
Assume that in a particular augmentation of a remote-file-access protocol, each client maintains a name cache that caches translations from file names to corresponding file handles. What issues should we take into account in implementing the name cache?
Then spend the remaining time discussing your list of keywords, and the excercises prepared at home and in class.
Recommended Reading
-
Chapter 13, 14 and 15 in Operating System Concepts, Enhanced eText, 10th Edition
Material (Slides, etc.)
-
Slides for lecture 9 and as HTML