在特定的Unix OS中,每个数据块的大小为1024字节,每个节点具有10个直接数据块地址和三个其他地址:一个用于单个间接块,一个用于双间接块,以及一个用于三间接块。同样,每个块可以包含128个块的地址。以下哪一项大约是文件系统中文件的最大大小?
(A) 512 MB
(B) 2GB
(C) 8GB
(D) 16GB答案: (B)
解释:
该图取自《操作系统概念》书。
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
这个问题的测验