3.1k 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

edited | 3.1k 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)

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 !

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
0

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
0
All those stuck in the calculation part convert 48 KB and  4 MB to GB then add with 4 GB you'll be getting the answer as 4.003951 GB ≃4 GB
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.8k points)
edited
0
Can anyone elaborate how the calculation is done at the end ?

1
2
3