Download presentation
Presentation is loading. Please wait.
Published byShanon Hill Modified over 8 years ago
1
Chapter VIIII File Systems Review Questions and Problems Jehan-François Pâris paris@cs.uh.edu jfparis@sbcglobal.net
2
Mount What is the purpose of the UNIX mount operation? a)To install a new device driver in the kernel b)To construct a single directory tree crossing disk partition boundaries c)To install a shared library
3
Mount What is the purpose of the UNIX mount operation? a)To install a new device driver in the kernel b)To construct a single directory tree crossing disk partition boundaries c)To install a shared library
4
Mount What is the main advantage of that mount operation? a)It speeds up file accesses b)It hides from the user actual file locations on disk
5
Mount What is the main advantage of that mount operation? a)It speeds up file accesses b)It hides from the user actual file locations on disk
6
File Organization Savvy UNIX users try to pick the best block size for each of their files a)TRUE b)FALSE
7
File Organization Savvy UNIX users try to pick the best block size for each of their files a)TRUE b)FALSE: All files in the same disk partition have the same block size
8
Protection What is the main advantage of access control lists over tickets? a)They are more flexible b)They are faster c)They are always encrypted
9
Protection What is the main advantage of access control lists over tickets? a)They are more flexible b)They are faster c)They are always encrypted
10
Protection What is the main advantage of tickets over access control lists? a)They are more flexible b)They are faster c)They are always encrypted
11
Protection What is the main advantage of tickets over access control lists? a)They are more flexible b)They are faster c)They are always encrypted
12
Protection What is the best way to combine access control lists and tickets? Use ____________________ for long term access control and ____________________ for short term access control
13
Protection What is the best way to combine access control lists and tickets? Use access control lists for long term access control and tickets for short term access control
14
Protection Why?
15
Protection Why? To take advantage of 1. the higher flexibility of access control lists and 2. the lower cost of tickets
16
Protection Give examples of a)access control lists and b)tickets in the UNIX file system
17
Protection Give examples of a)access control lists and b)tickets in the UNIX file system a)nine-bit file modes b)file descriptors
18
Protection Which are the major advantage and the major disadvantage of the UNIX implementation of access control lists?
19
Protection Which are the major advantage and the major disadvantage of the UNIX implementation of access control lists? a)Major advantage: They occupy very little space b)Major disadvantage: They are much less flexible than full ACLs because only system administrators can create or modify user groups
20
Protection Which users can do what with a file having these protection bits? -rw-rw-r--
21
Protection Which users can do what with a file having these protection bits? -rw-rw-r– Owner of file and members of the group associated with the file can read and modify the file Everybody else can just read it
22
Block sizes Which issues should we consider when selecting the block size of a disk partition?
23
Block sizes Which issues should we consider when selecting the block size of a disk partition? –Larger block sizes speed up data transfers –Smaller block sizes minimize internal fragmentation
24
Block sizes Why is it so important to minimize internal fragmentation in a file system?
25
Block sizes Why is it so important to minimize internal fragmentation in a file system? Because most file systems have many very small files –Using 8 KB blocks to store a 4KB file wastes 50% of the disk space
26
Addressing file contents A BSD file system has 12 direct block addresses and 8 KB blocks? How many bytes can be addressed 1.Directly from the i-node? 2.With one level of indirection? 3.With two levels of indirection?
27
Addressing file contents 1.Directly from the i-node, we can access the first 12 blocks of the file, that is, 12x8 KB =96 KB 2.As one block can contain 8K/4 = 2 13 /4 = 2 11 block addresses, we can access 2 11 blocks, that is, 2 11 x8 KB = 2 11 x2 13 B = 2 24 B = 16MB of data with one level of indirection
28
Addressing file contents 3.With two levels of indirection we should be able to access 8K/4 = 2 13 /4 = 2 11 x2 11 = 2 22 block addresses, that is, 2 22 x8 KB = 2 22 x2 13 B = 2 35 B = 32 GB of data Since file sizes cannot exceed 4GB, we can only access 4 GB – 16MB -96 KB
29
Block sizes again Why did the designers of BSD FFS picked a minimum block size of 4 KB?
30
Block sizes again Why did the designers of BSD FFS picked a minimum block size of 4 KB? Because it is the smallest block size that eliminates the need for a third level of indirection
31
Block sizes again Why did the designers of BSD FFS introduced block fragments?
32
Block sizes again Why did the designers of BSD FFS introduced block fragments? To reduce internal fragmentation: fragments can be used to store small files (less than 4 KB) and the tail end of larger files
33
Cylinder groups What is the main advantage of introducing cylinder groups in FFS?
34
Cylinder groups What is the main advantage of introducing cylinder groups in FFS? It reduces seek times: since each cylinder group contains both i-nodes and data blocks, we can store the first few blocks of large files and all the blocks of regular files closer to their i-nodes
35
Metadata updates When you create a new file, in which order should the blocks containing (a) the new directory entry and (b) the new i-node be written to disk?
36
Metadata updates When you create a new file, in which order should the blocks containing (a) the new directory entry and (b) the new i-node be written to disk? We should write first the block containing the new i-node and then the block containing the new directory entry
37
Metadata updates When you delete an existing file, in which order should the blocks containing (a) the deleted directory entry and (b) the reclaimed i-node be written to disk?
38
Metadata updates When you delete an existing file, in which order should the blocks containing (a) the deleted directory entry and (b) the reclaimed i-node be written to disk? We should write first the block containing the deleted directory entry and then the block containing the reclaimed i-node
39
Metadata updates How does FFS ensure that all metadata updates are written to disk in the right order?
40
Metadata updates How does FFS ensure that all metadata updates are written to disk in the right order? It uses blocking writes: metadata ordering is enforced by ensuring that a metadata update cannot proceed until the previous one has completed
41
Metadata updates What is the main drawback of this solution?
42
Metadata updates What is the main drawback of this solution? They occasion too many seeks and, as a result, significantly degrade the performance of the file system
43
Journaling file systems Which are the respective advantages and disadvantage of a)Journaling file systems doing synchronous log updates? b)Journaling file systems doing asynchronous log updates? Justify your answers
44
Journaling file systems a)Journaling file systems doing synchronous log updates commit to the log each individual update This guarantees that no metadata updates will be lost when the system crashes, but makes them slower than journaling file systems doing asynchronous log updates
45
Journaling file systems b)Journaling file systems doing asynchronous log updates what until their update buffer is full before committing these updates to the log. This reduces the number of log writes and makes them faster than journaling file systems doing synchronous log updates. It also means that metadata updates will be lost if the system crashes before the update buffer is committed to the log
46
UNIX Directories Describe the contents of a UNIX directory entry?
47
UNIX Directories Describe the contents of a UNIX directory entry? A UNIX directory entry contains –a file name –the i-node number of the file associated with that file name
48
Mapped files Which are the main advantages and disadvantages of mapped files?
49
Mapped files Which are the main advantages and disadvantages of mapped files? a)Mapped files speed up file accesses by replacing all read and write system calls by mere function calls b)They make it very difficult to know the exact size of files (in bytes)
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.