A file system with 300 GByte disk uses a file descriptor with 8 direct...
Each block size = 128 Bytes
Disk block address = 8 Bytes
Each disk can contain =
128
16
8
= addresses
Size due to 8 direct block addresses: 8 x 128
Size due to 1 indirect block address: 16 x 128
Size due to 1 doubly indirect block address: 16 x 16 x 128
Size due to 1 doubly indirect block address: 16 x 16 x 128
View all questions of this test
A file system with 300 GByte disk uses a file descriptor with 8 direct...
Understanding the Problem:
We are given a file system with a 300 GByte disk. The file system uses a file descriptor with 8 direct block addresses, 1 indirect block address, and 1 doubly indirect block address. The size of each disk block is 128 Bytes, and the size of each disk block address is 8 Bytes. We need to determine the maximum possible file size in this file system.
Key Information:
- Disk size: 300 GByte
- Disk block size: 128 Bytes
- Size of each disk block address: 8 Bytes
- File descriptor:
- 8 direct block addresses
- 1 indirect block address
- 1 doubly indirect block address
Solution:
To calculate the maximum file size, we need to consider the number of disk blocks that can be addressed using the given file descriptor.
Direct Blocks:
The file descriptor has 8 direct block addresses. Each direct block address can address one disk block. Therefore, the total number of disk blocks that can be addressed directly is:
8 direct block addresses * 1 disk block per address = 8 disk blocks
Indirect Blocks:
The file descriptor has 1 indirect block address. Each indirect block address can address a block that contains disk block addresses. Since the size of each disk block address is 8 Bytes, each indirect block can address:
Disk block size / Size of each disk block address = 128 Bytes / 8 Bytes = 16 disk block addresses
Doubly Indirect Blocks:
The file descriptor has 1 doubly indirect block address. Each doubly indirect block address can address a block that contains indirect block addresses. Since each indirect block can address 16 disk block addresses, each doubly indirect block can address:
16 indirect block addresses * 16 disk block addresses = 256 disk block addresses
Calculating Maximum File Size:
To calculate the maximum file size, we need to sum the number of disk blocks that can be addressed using direct blocks, indirect blocks, and doubly indirect blocks.
Maximum file size = (Number of direct block addresses * Disk block size) + (Number of indirect block addresses * Disk block size) + (Number of doubly indirect block addresses * Disk block size)
= (8 * 128) + (1 * 128 * 16) + (1 * 128 * 16 * 16)
= 1024 + 2048 + 32768
= 35840 Bytes
Since 1 KByte = 1024 Bytes, the maximum file size is:
35840 Bytes / 1024 Bytes per KByte = 35 KBytes
Therefore, the correct answer is option 'B', 35 KBytes.