1. Is the open system call in UNIX absolutely essential? What would the conseque
ID: 3832696 • Letter: 1
Question
1. Is the open system call in UNIX absolutely essential? What would the consequences be of not having it?
2. A simple operating system supports only a single directory but allows it to have arbitrarily many files with arbitrarily long file names. Can something approximating a hierarchical file system be simulated? How?
3. Describe the effects of a corrupted data block for a given file for:
(a) contiguous
(b) linked
(c) indexed (or table based)
4. Consider a file whose size varies between 4 KB and 4 MB during its lifetime. Which of the three allocation schemes (contiguous, linked and table/indexed) will be most appropriate?
5. Name one advantage of hard links over symbolic links and one advantage of symbolic links over hard links. Explain your answer.
6. Consider a 4-TB disk that uses 4-KB blocks and the free-list method. How many block addresses can be stored in one block?
7. The beginning of a free-space bitmap looks like this after the disk partition is first formatted: 1000 0000 0000 0000 (the first block is used by the root directory). The system always searches for free blocks starting at the lowest-numbered block, so after writing file A, which uses six blocks, the bitmap looks like this: 1111 1110 0000 0000. Show the bitmap after each of the following additional actions:
(a) File B is written, using five blocks.
(b) File A is deleted.
(c) File C is written, using eight blocks.
(d) File B is deleted.
8. Oliver Owl’s night job at the university computing center is to change the tapes used for overnight data backups. While waiting for each tape to complete, he works on writing his thesis that proves Shakespeare’s plays were written by extraterrestrial visitors. His text processor runs on the system being backed up since that is the only one they have. Is there a problem with this arrangement?
9. For an external USB hard drive attached to a computer, which is more suitable: a write- through cache or a block cache? Explain.
10. Consider an application where students’ records are stored in a file. The application takes a student ID as input and subsequently reads, updates, and writes the corresponding student record; this is repeated till the application quits. Would the "block read- ahead" technique be useful here? Why or why not?
Explanation / Answer
1)Answer:
Yes, because without it it would be necessary specify the name of the file to beaccessed on every read operation, creating overhead and decreasing performancein a already well known slow device (the disk, compared to memory, for example).
->: If there were no “open” system call, it would be necessary to specify the name of the file to be accessed for every read operation. The system would then have to fetch the i-node for it, although it could be cached. One issue that quickly arises is when to flush the inode back to disk. It could be based on a timeout, however it would be clumsy. Overall, it may work, but with much more overhead involved.
2)Answer:
One way to simulate that is to append to each file name the name of directory that contains it.
For example: UsrStudentsZivaPrivateFileX.
5)Answer:
->Hard links will point to the original i-node and make use of a counter to count thenumber of references to it. But a Symbolic link will point to a new i-node, whichcontains the path of the original file path and hence require additional disk space. Sohard links require lesser storage compared to symbolic links.
->Since symbolic link makes use of the path to the file, it can point to files on othermachines/file systems. But hard links are restricted only to access files within its ownpartition because it points to the original i-node of that file.
7)Answer:
(a) 1111 1111 1111 0000
(b) 1000 0001 1111 0000
(c) 1111 1111 1111 1100
(d) 1111 1110 0000 1100
8)Answer:
Ollie’s thesis may not be backed up as reliably as he might wish. A backup program may passover a file that is currently open for writing, as the state of the data in such a file may be indeterminate.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.