5.5k views

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
edited | 5.5k views
0

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
+5

48-bit integers are used , here what is use of 48 bit integer ... ??

+3
I don't think I've used them in Ans. No idea to be honest :D It's given for no reason !
0
ohk... !
0
Maximum file size is asked.. not total file size.
So its exactly 2^34 byte.
0
@Nitesh: The meaning of total file size is maximum file size i.e. total maximum file size. It's not exactly 2^34 but is the best approximation.

Refer the following gate question for clarification:

https://gateoverflow.in/2149/gate2012_41
+6

its wrongly solved...why using 32 b!!...its given that though pointer size is 32 b they have used "48 b" integer...so pointer size should be 6B not 4B here..close aproximation would still be option c....but we have to take 6B here

0

@Arjun Sir ,

Shouldn't we also include the disk blocks in which these pointers themselves are stored

= 2^10 {block size} * ( 1 [single Indirect] + (1 + 2^8) [double Indirect] + (1+2^8+2^8*2^8) [Triple Indirect] ) {No of Disk Blocks}

Well yes their contribution is not dominant as compared to 2^34  , but they do increase the file size right :) .

0
@bikram sir

can u highlight why in pooja mam

answer we multiply with 2^10 ??

and in answer of akash kanase sir why we added 10240 ??
0

@hem chandra

In question maximum possible file size is asked .

The maximum possible file size is not exactly 234 but  it is the some approximation.Due to this approximation  10240 is added here .

0
Block address requires only 32 bits but the pointer which is used to store address uses 48 bit integer internally.

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

0
Are you sure that answer is b? what about the other pointers described in the problem?
+6
maximum file size is asked not total file system size. Only triple indirect pointer can point to largest possible file, coz it points to most disk blocks than any other file pointer. Hence, only that is taken.
0

Please explain, what does it mean by - 48 bits integer are used ?

@Kapilp

And A unix-style I-nodes has 10 direct pointers and one single, one double and one triple indirect pointers.

This pointer means Block pointer  right ??

+4

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 .

0
0

(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?

Size of Disk Block = 1Kbyte

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
+3
You have used way too much approximation.

Size of Disk Block =1024 Byte

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

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

1
2