📜  门| GATE-IT-2004 |第 67 题

📅  最后修改于: 2021-09-27 05:48:29             🧑  作者: Mango

在特定的 Unix OS 中,每个数据块的大小为 1024 字节,每个节点有 10 个直接数据块地址和三个附加地址:一个用于单个间接块,一个用于双间接块,一个用于三重间接块。此外,每个块可以包含 128 个块的地址。以下哪一项大约是文件系统中文件的最大大小?

(A) 512 MB
(B) 2GB
(C) 8GB
(D) 16GB答案:(乙)
解释:
该图取自操作系统概念书。

Maximum size of the File System = Summation of size of all the data blocks
                                  whose addresses belongs to the file.

Given:
Size of 1 data block = 1024 Bytes
No. of addresses which 1 data block can contain = 128

Now, Maximum File Size can be calculated as:
10 direct addresses of data blocks = 10*1024
1 single indirect data block = 128*1024
1 doubly indirect data block = 128*128*1024
1 triple indirect data block = 128*128*128*1024

Hence,
Max File Size = 10*1024 + 128*1024 + 128*128*1024 + 
                128*128*128*1024 Bytes
              = 2113674*1024 Bytes
              = 2.0157 GB ~ 2GB

这个问题的测验