The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
x
+19 votes
3.8k 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
asked in Operating System by Veteran (59.4k points)
retagged by | 3.8k views

3 Answers

+21 votes
Best answer
Size of Disk Block = 1024Byte

Disk Blocks address = 4B

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

we Have

10 Direct

1 SI = 2^8 Indirect* 2^10  = 2^18 Byte

1 DI = 2^8 SI = (2^8)^2 Direct = 2^16 Direct ** 2^10 = 2^26 Byte

1 TI = 2^8 DI = (2^8)^2 SI = (2^8)^3 = 2^24 Direct =2^24 * 2^10 = 2^34 Byte.

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

Answer -> C
answered by Boss (42.4k points)
selected by
+3

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

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 .

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

answered by Boss (31.4k points)
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 ??

+3

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
Please share any good link for this topic
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?

+8 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
answered by Loyal (8.6k points)
+1
You have used way too much approximation.
Answer:

Related questions



Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

35,481 questions
42,729 answers
121,424 comments
42,123 users