• Home
  • Textbooks
  • Operating System Concepts Essentials
  • File-System Implementation

Operating System Concepts Essentials

Abraham Silberschatz, Peter B. Galvin, Greg Gagne

Chapter 10

File-System Implementation - all with Video Answers

Educators


Chapter Questions

Problem 1

Consider a file currently consisting of 100 blocks. Assume that the filecontrol block (and the index block, in the case of indexed allocation) is already in memory. Calculate how many disk I/O operations are required for contiguous, linked, and indexed (single-level) allocation strategies, if, for one block, the following conditions hold. In the contiguous-allocation case, assume that there is no room to grow at the beginning but there is room to grow at the end. Also assume that the block information to be added is stored in memory.
a. The block is added at the beginning.
b. The block is added in the middle.
c. The block is added at the end.
d. The block is removed from the beginning.
e. The block is removed from the middle.
f. The block is removed from the end.

Check back soon!
02:06

Problem 2

What problems could occur if a system allowed a file system to be mounted simultaneously at more than one location?

Adam Conner
Adam Conner
Numerade Educator
01:22

Problem 3

Why must the bit map for file allocation be kept on mass storage, rather than in main memory?

Adam Conner
Adam Conner
Numerade Educator
View

Problem 4

Consider a system that supports the strategies of contiguous, linked, and indexed allocation. What criteria should be used in deciding which strategy is best utilized for a particular file?

James Kiss
James Kiss
Numerade Educator

Problem 5

One problem with contiguous allocation is that the user must preallocate enough space for each file. If a file grows to be larger than the space allocated for it, special actions must be taken. One solution to this problem is to define a file structure consisting of an initial contiguous area (of a specified size). If this area is filled, the operating system automatically defines an overflow area that is linked to the initial contiguous area. If the overflow area is filled, another overflow area is allocated. Compare this implementation of a file with the standard contiguous and linked implementations.

Check back soon!

Problem 6

How do caches help improve performance? Why do systems not use more or larger caches if they are so useful?

Check back soon!
02:17

Problem 7

Why is it advantageous to the user for an operating system to dynamically allocate its internal tables? What are the penalties to the operating system for doing so?

Adam Conner
Adam Conner
Numerade Educator

Problem 8

Explain how the VFS layer allows an operating system to support multiple types of file systems easily.

Check back soon!

Problem 9

Consider a file system that uses a modifed contiguous-allocation scheme with support for extents. A file is a collection of extents, with each extent corresponding to a contiguous set of blocks. A key issue in such systems is the degree of variability in the size of the extents. What are the advantages and disadvantages of the following schemes?
a. All extents are of the same size, and the size is predetermined.
b. Extents can be of any size and are allocated dynamically.
c. Extents can be of a few fixed sizes, and these sizes are predetermined.

Check back soon!
02:49

Problem 10

What are the advantages of the variant of linked allocation that uses a FAT to chain together the blocks of a file?

Joe Mallonee
Joe Mallonee
Numerade Educator

Problem 11

Consider a system where free space is kept in a free-space list.
a. Suppose that the pointer to the free-space list is lost. Can the system reconstruct the free-space list? Explain your answer.
b. Consider a file system similar to the one used by UNIX with indexed allocation. How many disk $\mathrm{I} / \mathrm{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.
c. Suggest a scheme to ensure that the pointer is never lost as a result of memory failure.

Check back soon!

Problem 12

Some file systems allow disk storage to be allocated at different levels of granularity. For instance, a file system could allocate $4 \mathrm{~KB}$ of disk space as a single 4-KB block or as eight 512-byte blocks. How could we take advantage of this flexibility to improve performance? What modifications would have to be made to the free-space management scheme in order to support this feature?

Check back soon!

Problem 13

Discuss how performance optimizations for file systems might result in difficulties in maintaining the consistency of the systems in the event of computer crashes.

Check back soon!
00:55

Problem 14

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:
a. 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.)
b. 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?

Vysakh M
Vysakh M
Numerade Educator

Problem 15

Consider a file system that uses inodes to represent files. Disk blocks are $8 \mathrm{~KB}$ in size, and a pointer to a disk block requires 4 bytes. This file system has 12 direct disk blocks, as well as single, double, and triple indirect disk blocks. What is the maximum size of a file that can be stored in this file system?

Check back soon!

Problem 16

Fragmentation on a storage device can be eliminated by recompaction of the information. Typical disk devices do not have relocation or base registers (such as those used when memory is to be compacted), so how can we relocate files? Give three reasons why recompacting and relocation of files are often avoided.

Check back soon!

Problem 17

In what situations would using memory as a RAM disk be more useful than using it as a disk cache?

Check back soon!

Problem 18

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?

Check back soon!

Problem 19

Explain why logging metadata updates ensures recovery of a file system after a file-system crash.

Check back soon!

Problem 20

Consider the following backup scheme:
$\bullet$ Day 1. Copy to a backup medium all files from the disk.
$\bullet$ Day 2. Copy to another medium all files changed since day 1.
$\bullet$ Day 3. Copy to another medium all files changed since day 1.
This differs from the schedule given in Section 10.7.4 by having all subsequent backups copy all files modified since the first full backup. What are the benefits of this system over the one in Section 10.7.4? What are the drawbacks? Are restore operations made easier or more difficult? Explain your answer.

Check back soon!