9,922 views
3 votes
3 votes

Consider a file system that uses UNIX like inodes to keep track of the sectors allocated to files. Assume that disk blocks are 1 KB in size, disk block addresses are 32 bits and the inode has space for 8 direct blocks, 1 singly indirect blocks, 1 doubly indirect block and 1 triply indirect block. What is the largest disk drive that could be fully utilized by this system?

(A) 232 bytes
(B) 234 bytes
(C) 210 bytes
(D) 242 byte
Is there asked about total size of file system?
whats difference between them?

2 Answers

3 votes
3 votes

The direct blocks store addresses of disk blocks. The size of each disk block is 1 KB = 210 bytes.
There are 8 direct blocks, which can address: 8 × 1 KB = 23 × 210 bytes = 213 bytes.
Size of each disk block is 1 KB and size of each disk block address is 32 bit. So, each indirect block can addresses: 210 bytes / 4 bytes = 28 blocks.
Thus,
1 single indirect block addresses 28 × 1 KB = 28 × 210 bytes = 218 bytes
1 double indirect block addresses 28 × 28 × 210 bytes = 226 bytes
1 triple indirect block addresses 28 × 28 × 28 × 210 bytes = 234 bytes
Thus, the maximum file size is: 213 + 218 + 226 + 234 bytes ≈ 234 bytes ≈ 16 GB.

AND

Each block must be addressable in order to be used. The block addresses are 32 bits long. Thus, we can address 232 blocks. Each block is 1 KB = 210 bytes.
Thus, we can address 232 × 210 bytes = 242 bytes.

2 votes
2 votes

Disk Block Address = 32-bit = 4B

Disk Block Size = 1KB 

#of Disk Block Pointer that can fit in one block pointer = 1024/4 = 256

Direct pointer maximum file size = 8 * 1KB = 8KB

Due to Single Indirect Pointer maximum file size = 256 * 1KB = 256KB

Due to Double Indirect Pointer maximum file size = 256 * 256 * 1KB

Due to Triple Indirect Pointer maximum file size = 256 * 256 * 256 * 1KB

so, total file size (approx) = 2^34 Bytes.

Related questions

3 votes
3 votes
1 answer
1
Anup patel asked Oct 13, 2017
816 views