Consider a UNIX-like file system implemented with i-nodes that resides...
Each i-node has a total 15 block addresses which means 15 bit block addresses.
So each i-node size = (2^15)B.
total no. of i-node = Total Size / I-node Size
= 512 GB/ (2^15)B
= (2^39)/(2^15)
= 2^24
i.e. 24’ bits are required to address the entire disk space -> 3 bytes
Block Entry Size = 3 Bytes
the number of i-node or blocks required for 1 GB file
= File Size/ I-node Size
= 1 GB/ (2^15)B
= (2^30)/(2^15)
=2^15
size required to address 2^15 blocks = No_of_blocks * Block_Entry_Size = (2^15)*3 Bytes
size required to address 1 block:
= (2^15)*3 / (2^15) = 3 block addresses
View all questions of this test
Consider a UNIX-like file system implemented with i-nodes that resides...
Given:
- Disk size: 512 GB
- Each i-node has 15 block addresses
- File size limit: 1 GB
- Direct block addresses: 12
- Single indirect block address: 1
To find:
- Minimum number of block addresses that should be used as single indirect block address
Solution:
To support a file size of up to 1 GB, we need to consider the block size of the file system.
- Block size: The minimum unit of storage allocation on a disk. It determines the maximum size of a file that can be stored on the file system.
Let's assume the block size is B bytes. Since the file size limit is 1 GB, and 1 GB is equal to 1024 MB, we can calculate the number of blocks required to store a 1 GB file as follows:
Number of blocks = (1 GB) / (B bytes/block)
We know that each i-node has 15 block addresses, out of which 12 are direct block addresses and 1 is a single indirect block address. To find the minimum number of block addresses that should be used as a single indirect block address, we need to determine the maximum file size that can be supported using only direct block addresses.
Direct block addresses:
The number of direct block addresses multiplied by the block size will give us the maximum file size that can be supported using only direct block addresses.
Maximum file size using direct block addresses = (12 direct block addresses) * (B bytes/block)
Single indirect block address:
To determine the maximum file size that can be supported using a single indirect block address, we need to consider the maximum number of blocks that can be addressed using a single indirect block address.
Since each i-node has 15 block addresses and 12 are direct block addresses, the remaining 3 block addresses can be used for indirect block addresses. Therefore, the maximum number of blocks that can be addressed using a single indirect block address is (3 block addresses) * (B bytes/block).
Maximum file size using a single indirect block address = (3 block addresses) * (B bytes/block)
Condition:
The maximum file size using only direct block addresses should be less than or equal to 1 GB, and the maximum file size using a single indirect block address should be greater than 1 GB.
Therefore, the condition can be written as:
(12 direct block addresses) * (B bytes/block) ≤ (1 GB) ≤ (3 block addresses) * (B bytes/block)
Simplifying the condition:
12B ≤ 1 GB ≤ 3B
From this condition, we can conclude that the value of B should be greater than or equal to 256 MB (since 1 GB = 1024 MB). This means that the block size should be at least 256 MB.
Conclusion:
To support a file size of up to 1 GB using only direct block addresses and a single indirect block address, the minimum number of block addresses that should be used as a single indirect block address is 3 (option D).
To make sure you are not studying endlessly, EduRev has designed Computer Science Engineering (CSE) study material, with Structured Courses, Videos, & Test Series. Plus get personalized analysis, doubt solving and improvement plans to achieve a great score in Computer Science Engineering (CSE).