in Operating System edited by
27,430 views
40 votes
40 votes

A unix-style I-nodes has $10$ direct pointers and one single, one double and one triple indirect pointers. Disk block size is $1$ Kbyte, disk block address is $32$ bits, and $48$-bit integers are used. What is the maximum possible file size?

  1. $2^{24}$ bytes
  2. $2^{32}$ bytes
  3. $2^{34}$ bytes
  4. $2^{48}$ bytes
in Operating System edited by
27.4k views

4 Comments

3
3
At that time, didn’t they used to take care while making questions? Btw ISRO still doing it ...
0
0
Similar question was asked in GATE 2019:

https://gateoverflow.in/302806/gate2019-42
0
0

after watching @Shamim Ahmed

4
4

6 Answers

53 votes
53 votes
Best answer

Size of Disk Block $= 1024 \text{ Byte}$

Disk Blocks address $= 4B$

No. of addresses per block $1024/4 = 256 = 2^8$ addresses

We have:

$10$ Direct

$1 \ SI = 2^8 \text{Indirect}\times 2^{10}  = 2^{18} \text{Byte}$

$1 \ DI = 2^8 \ SI = (2^8)^2 \text{Direct} = 2^{16} \text{Direct} ** 2^{10} = 2^{26} \text{Byte}$

$1 \ TI = 2^8 \ DI = (2^8)^2  \ SI = (2^8)^3 = 2^{24} \text{Direct} =2^{24} \times 2^{10} = 2^{34} \text{ Byte}.$

So, total size $= 2^{18} + 2^{26} + 2^{34} \text{ Byte} + 10240 \text{Byte}$. Which is nearly $2^{34} \ \text{Bytes}$. (We don't have exact option available. Choose approximate one)

Answer $\rightarrow$ (C)

edited by

4 Comments

I think 48 bit integers simply means that the size of integers is 48 bit or 6B. Now disk block address is given as 32 bit. However, pointers are actually stored as integers. So now, do we take block pointer size as 32 bits or 48 bits? That is confusing. Anyway I too ignored 48 bits as it is usually not given in the question and it has never been required during calculation in such numericals, but it is still a little unclear if 48 bits was mentioned just to create confusion or it actually has some significance.
0
0

48 bit "Integer" is just a range of binary number that can be used by a computer architecture.

In computer architecture, 48-bit integers can represent 281,474,976,710,656 (248 or 2.814749767×1014) discrete values. This allows an unsigned binary integer range of 0 through 281,474,976,710,655 (248 − 1) or a signed two's complement range of -140,737,488,355,328 (-247) through 140,737,488,355,327(247 −1).

And mentioning a 48 bit memory address gives an upper limit or a bound to amount of values that can be addressed directly. Hence it is just the upper limit and has no impact on the question.

A 48-bit memory address can directly address every byte of 256 terabytes of storage. 48-bit can refer to any other data unit that consumes 48 bits (6 octets) in width.

1
1
The question is completely correct. I was summing the powers of 2 during addition. I realised the mistake and calculated the sum and then did a log base 2 of the result. The answer was right in front of me then. Its 2 power 34 bytes for sure....
0
0
31 votes
31 votes

no of address in one block=$2^{10}/2^2=2^8$ as triple pointer used  max possible size$=2^8\times 2^8 \times 2^8\times 2^{10}=2^{34}$ Bytes 

ans is C

4 Comments

I think 48 bits integer is of no use. Don't no, why they have used here.

As they are giving DBA = 32 bits.

Even if, i use 48 bits , Then DBA = 6 bytes

So, total addresses in a block = 210/6 = approx 170

Then, max size = (10 + 170 + 170*170 + 170*170*170) * 210 = 233 bytes

still i woud tick C).

Yes, pointer is a block pointer .

6
6
Please share any good link for this topic
1
1

(10 + 170 + 170*170 + 170*170*170) = 4,942,080

log2 (4942080) ≈ 22

Therefore, Maximum File Size = 222 * 210   = 232

Wouldn't this be more accurate?

3
3
16 votes
16 votes
Size of Disk Block = 1Kbyte

Disk Blocks address = 32bits, 
but 48 bit integers are used for address
Therefore address size = 6 bytes
                    

No of addresses per block = 1024/6  = 170.66 
Therefore 170 ≈ 2^8 addresses per block can be stored

Maximum File Size = 10 Direct + 1 Single Indirect + 
                    1 Double Indirect + 1 Triple Indirect
                 = 10 + 2
8 + 28*28 + 28*28*28 ≈ 224 Blocks Since each block is of size 210 Maximum files size = 224 * 210 = 234

4 Comments

edited by
You have used way too much approximation.
3
3
If 170 addresses can be stored of 6 Bytes then how can you store 256 addresses of 6 Bytes in that space??
3
3
As per the calculation it is clear that we can store not more than 170 disk block addresses in one disk.How did you approximated it to the value 2^8 = 256 which is absolutely greater than 170?
1
1
correct answer
0
0
10 votes
10 votes

Size of Disk Block =1024 Byte 

Disk Blocks address = 32 bit, but 48 bit integers are used for address
Therefore address size = 6 bytes

No. of addresses per block 1024/6 = 170 addresses 

Maximum File Size = 10 Direct + 1 Single Indirect +  1 Double Indirect + 1 Triple Indirect
                 = 10 + 170 + 1702 + 1703
                 ≈ 222 Blocks

Since each block is of size 210  B            

Maximum files size = 222 * 210  = 232    B

Answer - B

Answer:

Related questions