操作系统练习-第6章文件管理

一. 多选题(共2题,50分)

1. (多选题, 25分)What would happen if the bitmap or free list containing the information about free disk blocks was completely lost due to a crash? Is there any way to recover from this disaster, or is it bye-bye disk? Discuss your answers for UNIX and the FAT-16 file system separately.

  • A. In the FAT file system, the problem cannot occur because there is no free list.
  • B. It is not a serious problem at all.
  • C. But even if there were, all that would have to be done to recover it is to scan the FAT looking for free entries.
  • D. In UNIX this can be done by scanning all the i-nodes.
  • E. Repair is straightforward; it just takes time. The recovery algorithm is to make a list of all the blocks in all the files and take the complement as the new free list.

我的答案: ABCDE

2. (多选题, 25分)Name one advantage of hard links over symbolic links and one advantage of symbolic links over hard links.

  • A. Hard links do not require any extra disk space, just a counter in the i-node to keep track of how many there are. Symbolic links need space to store the name of the file pointed to.
  • B. Symbolic links can point to files on other machines, even over the Internet. Hard links are restricted to pointing to files within their own partition.
  • C. None of the above answers are correct.
  • D. Symbolic links do not require any extra disk space, just a counter in the i-node to keep track of how many there are. Hard links need space to store the name of the file pointed to.
  • E. Hard links can point to files on other machines, even over the Internet. Symbolic links are restricted to pointing to files within their own partition.

我的答案: AB

二. 填空题(共2题,50分)

3. (填空题, 15分)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 memory. Also assume that all directories fit in one disk block.

我的答案:10

4. (填空题, 35分)A UNIX file system has 4-KB blocks and 4-byte disk addresses. If i-nodes contain 10 direct entries, and one single, double, and triple indirect entry each, the maximum file size is (      )TB(      )GB(      )MB(      )KB(      )B.

我的答案:(1) 4             (2) 4                    (3) 4                   (4) 40                   (5) 0

你可能感兴趣的:(编程语言,后端)