The Gateway to Computer Science Excellence
+1 vote
3k views
The index node (inode) of a Unix -like file system has $12$ direct, one single-indirect and one double-indirect pointers. The disk block size is $4$ kB, and the disk block address is $32$-bits long. The maximum possible file size is (rounded off to $1$ decimal place) ____ GB
in Operating System by Veteran (423k points)
edited by | 3k views
0
4GB
0
4.0
0

I've got a doubt, please everyone take a look and tell me if I'm wrong:

In the question the disk block size is explicitly mentioned as 4 kB, not 4KB, and 

kB means 1000 Bytes whereas KB means 1024 Bytes 

(Now I know in these confusions in CN, we always take 1024 for data and 1000 for BW, but that's just a convention, right?) whereas the notations are defined in standards, I'm attaching the wiki page link for proof :

 

https://en.wikipedia.org/wiki/Kilobyte

(In this wiki page please read definitions and usage for examples first before answering)

@Shaik Masthan @Arjun @Ashwani Kumar 2

0

In the question the disk block size is explicitly mentioned as 4 kB, not 4KB, and 

kB means 1000 Bytes whereas KB means 1024 Bytes 

it's depend upon what is the base you are taking is it 2 or 10, but as per me, we have to take 1024 but not 1000.

but hope GATE key have range of values ! 

3 Answers

+5 votes
Best answer
Given $12$ direct, $1$ single indirect, $1$ double indirect pointers

Size of Disk block $= 4kB$

Disk Block Address $= 32 \text{ bit } = 4B$

Number of addresses/disk block $= \frac{4kB}{4B} = 2^{10}$

Maximum possible file size$ = 12*4kB\  + \ 2^{10} * 4kB \ + \ 2^{10} * 2^{10} * 4kB$

$= 4.00395 \  GB \simeq 4 \ GB$

Hence $4GB$ is the correct answer
by Boss (15.6k points)
edited by
0

I have put 4.0 @Shaik Masthan

+1
no problem ! @jatin
0

@Shaik Masthan I entered value as 4.0039 will that be considered as correct ?

+1
after one decimal point everything is invalid !

So, your answer look like as 4.0 only !
+1
i don't know, but i hope 4.0=4 only !
0
i've answered 4.1 is it right??
0
Please tell any book or online resource to learn about this topic
0
i've answered 4.1

is that correct??
0

@Ashwani Kumar 2 Can you please elaborate the calculation. Actually, left this question in exam because I was stuck in the calculation part. I had solved the question in same manner but after (12∗4KB + 2^10∗4KB + 2^10∗2^10∗4KB) I was not sure how to calculate the answer. 

0
From where can I read more about this concept and practice more problems
+9 votes
Disk block size = 4 KB = 2^12 Bytes

Disk block address = 32 bits = 4 Bytes = 2^2 Bytes

No of addresses in a block = 2^12/ 2^2 = 2^10

Maximum file size = (20 + 2^10 + (2^10)^2)* 2^12 = X

= X / 2^30 GB

= 4.0 GB
by Active (2k points)
+1 vote
1GB = $2^{30}B$

DB = Disk Block

DBA length or size = 32 bits

= 4 B

#DBAs that can be stored per DB = DB size/ DBA size

= $\frac{2^{12}}{2^2}$

= $2^{10}$

TOTAL file size

= $(\#DirectPtr + \sum_i(\#Ptr_i * \#DBAs)^{i} )  * DB size$

Where i = indirectionLevel (single = 1, double = 2, etc)

Each direct pointer points to a single DB and for indirect pointer it depends on the indirectionLevel (single, double, triple or etc) to point to that many DBs. Thus we get max file size by multiplying total DB pointers with DBsize.

= $(12 + \sum (1*2^{10})^1 \ + (1*2^{10})^2 )*2^{12}\ B$

=$4. 004\ GB$ or

= 4.0(ANS)
by Loyal (9.6k points)
edited by
0
Can anyone elaborate how the calculation is done at the end ?
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,650 questions
56,208 answers
194,073 comments
95,108 users