in Operating System
9,931 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?

in Operating System
9.9k views

3 Comments

max file size=2^34

max disk drive  size=2^42
2
2
pooja please give explanation.
1
1
How to calculate max disk drive size???
0
0

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.

2 Comments

For total file size why you have not used: -

[no of direct disk block pointer + (DBS/DBA) + (DBS/DBA)^2 + (DBS/DBA)^3)*DBS

where DBS = Disk Block size.

DBA = Disk Block address size?
0
0
I do agree it would be more standard to use the formula , for people who are new to this and are wondering how to utilize the formula to calculate the max file size.  

*********Calculation for 32 bit address size , 10 direct block & 1 indirect ***********

no of direct disk block pointer + (DBS/DBA) + (DBS/DBA)^2 + (DBS/DBA)^3)*DBS

DBS = Disk Block size= 4,096 bytes = 4KB

DBA = Disk Block address size = 32 bits = 4 byte

DBS/DBA = 4,096/4 = 1024

10 direct address entries= 10

one primary indirect block= 1024

max file size = (1024+10)*4KB= 4136 KB

##############################################################

*********Calculation for 24 bit address size, 10 direct block & 1 indirect ***********

(This is an unstandard address size, but some professors use it to test their students )  

Max file size = no of direct disk block pointer + (DBS/DBA) + (DBS/DBA)^2 + (DBS/DBA)^3)*DBS

DBS = Disk Block size= 1024 bytes = 1KB

DBA = Disk Block address size = 24 bits = 3 byte

DBS/DBA = 1024/3 = 341.3333 = 341

10 direct address entries= 10

one primary indirect block= 341

max file size = (341+10)*1KB= 352 KB = 360448 bytes
0
0

Related questions

3 votes
3 votes
1 answer
1