The Gateway to Computer Science Excellence
+27 votes
7.1k 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
in Operating System by Veteran (52.2k points)
edited by | 7.1k views
+1

5 Answers

+35 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)

by Boss (41.9k points)
edited by
+11

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

+4
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
+8

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
Can you please tell the way that how it'll look like?
0
You are considering 32 bit address and not 48 bit because we want max file size which can be achieved only when a block holds max pointers/addresses which will be when pointer/address size is 32 bits ? Please clarify.
0
what is meaning of 48 bit integer here
+25 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

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

+5

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?

+12 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
by Boss (10.2k points)
+3
You have used way too much approximation.
+1
If 170 addresses can be stored of 6 Bytes then how can you store 256 addresses of 6 Bytes in that space??
+8 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

by Active (2.1k points)
0 votes

I-nodes are structured like this:-

Image source: https://www.chegg.com/homework-help/questions-and-answers/shown-figure-4-33-unix-node-10-direct-address-entries-one-single-double-triple-indirect-ad-q20611721


Each block can have addresses = $2^8$

Maximum level of indirect pointers is 3. So, each such $2^8$ addresses will point to $2^8$ addresses again, which will point to $2^8$ more addresses.

It is equal to $(2^8)^3$ addresses.

=> $2^{24}$ addresses.

Each address points to a block. Block Size is $2^{10}$ Bytes.

So, File Size = $2^{34}$

 

Now we have to do the same for 2 level of indirect pointers, and again for 1 level. But they'll be negligible compared to Triple Indirect Level as $2^8 << 2^{16} << 2^{24}$. We can approximate it as $2^{24}$ addresses, and then multiply by the block size.

Option C


This is sort of like a quick answer. The best answer here describles the actual, proper procedure.

by Loyal (6.7k points)
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
50,737 questions
57,341 answers
198,451 comments
105,211 users