Presentation is loading. Please wait.

Presentation is loading. Please wait.

Chapter VIIII File Systems Review Questions and Problems

Similar presentations


Presentation on theme: "Chapter VIIII File Systems Review Questions and Problems"— Presentation transcript:

1 Chapter VIIII File Systems Review Questions and Problems
Jehan-François Pâris

2 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

3 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

4 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

5 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

6 File Organization Savvy UNIX users try to pick the best block size for each of their files TRUE FALSE

7 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

8 Protection What is the main advantage of access control lists over tickets? They are more flexible They are faster They are always encrypted

9 Protection What is the main advantage of access control lists over tickets? They are more flexible They are faster They are always encrypted

10 Protection What is the main advantage of tickets over access control lists? They are more flexible They are faster They are always encrypted

11 Protection What is the main advantage of tickets over access control lists? They are more flexible They are faster 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
the higher flexibility of access control lists and the lower cost of tickets

16 Protection Give examples of access control lists and tickets
in the UNIX file system

17 Protection Give examples of access control lists and tickets
in the UNIX file system nine-bit file modes 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? 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

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? Because most file systems have many very small files Using 8 KB blocks to store a 4KB file wastes 50% of the disk space

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 File sizes What is the maximum file size in a 32-bit system?

27 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

28 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?

29 Addressing file contents
1 2 3 4 5 6 7 8 9 10 11 12 13 b/4 block addresses b/4 indirect block addresses . . . Twelve direct blocks b/4 indirect blocks b/4b/4 double indirect blocks Block size b  4KB 29

30 Addressing file contents
1 2 3 4 5 6 7 8 9 10 11 12 13 b/4 block addresses b/4 indirect block addresses . . . Twelve direct blocks b/4 indirect blocks b/4b/4 double indirect blocks Block size b = 8KB 30

31 Addressing file contents
1 2 3 4 5 6 7 8 9 10 11 12 13 2K block addresses 2K indirect block addresses . . . Twelve direct blocks b/4b/4 double indirect blocks Block size b = 8KB 96 KB b/4 indirect blocks 31

32 Addressing file contents
1 2 3 4 5 6 7 8 9 10 11 12 13 2K block addresses 2K indirect block addresses . . . Twelve direct blocks b/4b/4 double indirect blocks Block size b = 8KB 96 KB 2K blocks = 16MB 32

33 Addressing file contents
1 2 3 4 5 6 7 8 9 10 11 12 13 2K block addresses 2K indirect block addresses . . . Twelve direct blocks b/4b/4 double indirect blocks Block size b = 8KB 96 KB 2K blocks = 16MB 4GB - 16MB – 98 KB 33

34 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 contain 8K/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

35 Addressing file contents
With two levels of indirection, we should be able to access 8K/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 access 4 GB – 16MB -96 KB

36 Block sizes again Why did the designers of BSD FFS picked a minimum block size of 4 KB?

37 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

38 Block sizes again Why did the designers of BSD FFS introduced block fragments?

39 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

40 Cylinder groups What is the main advantage of introducing cylinder groups in FFS?

41 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

42 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?

43 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

44 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?

45 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

46 Metadata updates How does FFS ensure that all metadata updates are written to disk in the right order?

47 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

48 Metadata updates What is the main drawback of this solution?

49 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

50 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

51 Journaling file systems
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

52 Journaling file systems
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

53 UNIX Directories Describe the contents of a UNIX directory entry.

54 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

55 Mapped files Which are the main advantages and disadvantages of mapped files?

56 Mapped files Which are the main advantages and disadvantages of mapped files? Mapped files speed up file accesses by replacing all read and write system calls by mere function calls They make it very difficult to know the exact size of files (in bytes)


Download ppt "Chapter VIIII File Systems Review Questions and Problems"

Similar presentations


Ads by Google