560 likes | 660 Views
Chapter VIIII File Systems Review Questions and Problems. Jehan-François Pâris jfparis@uh.edu. Mount. What is the purpose of the UNIX mount operation? To install a new device driver in the kernel To construct a single directory tree crossing disk partition boundaries
E N D
Chapter VIIII File Systems Review Questions and Problems Jehan-François Pâris jfparis@uh.edu
Mount • What is the purpose of the UNIX mount operation? • To install a new device driver in the kernel • To construct a single directory tree crossing disk partition boundaries • To install a shared library
Mount • What is the purpose of the UNIX mount operation? • To install a new device driver in the kernel • To construct a single directory tree crossing disk partition boundaries • To install a shared library
Mount • What is the main advantage of that mount operation? • It speeds up file accesses • It hides from the user actual file locations on disk
Mount • What is the main advantage of that mount operation? • It speeds up file accesses • It hides from the user actual file locations on disk
File Organization • Savvy UNIX users try to pick the best block size for each of their files • TRUE • FALSE
File Organization • Savvy UNIX users try to pick the best block size for each of their files • TRUE • FALSE:All files in the same disk partition have the same block size
Protection • What is the main advantage of access control lists over tickets? • They are more flexible • They are faster • They are always encrypted
Protection • What is the main advantage of access control lists over tickets? • They are more flexible • They are faster • They are always encrypted
Protection • What is the main advantage of tickets over access control lists? • They are more flexible • They are faster • They are always encrypted
Protection • What is the main advantage of tickets over access control lists? • They are more flexible • They are faster • They are always encrypted
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
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
Protection • Why?
Protection • Why? To take advantage of • the higher flexibility of access control lists and • the lower cost of tickets
Protection • Give examples of • access control lists and • tickets in the UNIX file system
Protection • Give examples of • access control lists and • tickets in the UNIX file system • nine-bit file modes • file descriptors
Protection • Which are the major advantage and the major disadvantage of the UNIX implementation of access control lists?
Protection • Which are the major advantage and the major disadvantage of the UNIX implementation of access control lists? • Major advantage: They occupy very little space • Major disadvantage: They are much less flexible than full ACLs because only system administrators can create or modify user groups
Protection • Which users can do what with a file having these protection bits?-rw-rw-r--
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
Block sizes • Which issues should we consider when selecting the block size of a disk partition?
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
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
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
File sizes • What is the maximum file size in a 32-bit system?
File sizes • What is the maximum file size in a 32-bit system? Four megabytes because a 32-bit unsigned integer can address 232 bytes
Addressing file contents • A BSD file system has 12 direct block addresses and 8 KB blocks? How many bytes can be addressed • Directly from the i-node? • With one level of indirection? • With two levels of indirection?
Addressing file contents 12 13 9 6 0 3 4 7 10 1 2 8 5 11 Twelvedirectblocks b/4 indirect block addresses b/4 blockaddresses b/4 blockaddresses b/4 blockaddresses b/4indirectblocks . . . b/4b/4 double indirect blocks Block size b 4KB
Addressing file contents 12 13 9 6 0 3 4 7 10 1 2 8 5 11 Twelvedirectblocks b/4 indirect block addresses b/4 blockaddresses b/4 blockaddresses b/4 blockaddresses b/4indirectblocks . . . b/4b/4 double indirect blocks Block size b = 8KB
Addressing file contents 12 13 9 6 0 3 4 7 10 1 5 2 11 8 Twelvedirectblocks 2K blockaddresses 2K indirect block addresses 2K blockaddresses 2K blockaddresses . . . b/4b/4 double indirect blocks Block size b = 8KB 96 KB b/4indirectblocks
Addressing file contents 12 13 9 6 0 3 4 7 10 1 5 2 11 8 Twelvedirectblocks 2K blockaddresses 2K indirect block addresses 2K blockaddresses 2K blockaddresses . . . b/4b/4 double indirect blocks Block size b = 8KB 96 KB 2K blocks = 16MB
Addressing file contents 12 13 9 6 0 3 4 7 10 1 5 2 11 8 Twelvedirectblocks 2K blockaddresses 2K indirect block addresses 2K blockaddresses 2K blockaddresses . . . b/4b/4 double indirect blocks Block size b = 8KB 96 KB 2K blocks = 16MB 4GB - 16MB – 98 KB
Addressing file contents • Directly from the i-node, we can access the first 12 blocks of the file, that is,12x8 KB =96 KB • As one block can contain8K/4 = 213/4 = 211 block addresses,we can access 211 blocks, that is,211x8 KB = 211x213 B = 224 B = 16MB of data with one level of indirection
Addressing file contents • With two levels of indirection,we should be able to access8K/4 = 213/4 = 211x211 = 222 block addresses, that is,222x8 KB = 222x213 B = 235 B = 32 Since file sizes cannot exceed 4GB,we can only access4 GB – 16MB -96 KB
Block sizes again • Why did the designers of BSD FFS picked a minimum block size of 4 KB?
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
Block sizes again • Why did the designers of BSD FFS introduced block fragments?
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
Cylinder groups • What is the main advantage of introducing cylinder groups in FFS?
Cylinder groups • What is the main advantage of introducing cylinder groups in FFS? It reduces seek times:since each cylinder group contains bothi-nodes and data blocks, we can store the first few blocks of large files and all the blocks of regular files closer to theiri-nodes
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?
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
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?
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
Metadata updates • How does FFS ensure that all metadata updates are written to disk in the right order?
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
Metadata updates • What is the main drawback of this solution?
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
Journaling file systems • Which are the respective advantages and disadvantages of • Journaling file systems doing synchronous log updates? • Journaling file systems doing asynchronous log updates? Justify your answers