操作系统练习-第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

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值