72.9k views
4 votes
How many disk operations are needed to fetch the i-node for a file with the path name /usr/ast/courses/os/handout.t? Assume that the i-node for the root directory is in memory, but nothing else along the path is in. Assume that all directories fit in one disk block.

a) 1 disk operation
b) 2 disk operations
c) 3 disk operations
d) 4 disk operations

1 Answer

5 votes

Final answer:

To fetch the i-node for the path /usr/ast/courses/os/handout.t, five disk operations are needed, with one operation for each directory level.

Step-by-step explanation:

To fetch the i-node for a file with the path name /usr/ast/courses/os/handout.t, assuming the i-node for the root directory is already in memory, we would perform the following operations:

  • Read the i-node for /usr from the disk.
  • Read the i-node for /usr/ast from the disk.
  • Read the i-node for /usr/ast/courses from the disk.
  • Read the i-node for /usr/ast/courses/os from the disk.
  • Finally, read the i-node for the file /usr/ast/courses/os/handout.t from the disk.

Total number of disk operations required are 5, one for each step listed above.

User Flokk
by
7.8k points