The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
+30 votes
A FAT (file allocation table) based file system is being used and the total overhead of each entry in the FAT is $4$ bytes in size. Given a $100 \times 10^6$ bytes disk on which the file system is stored and data block size is $10^3$ bytes, the maximum size of a file that can be stored on this disk in units of $10^6$ bytes is _________.
asked in Operating System by Veteran (96.1k points)
edited by | 4.9k views

Hi Guys,

Many people have provided similar kind of answer.  FAT volume is organized as shown in the following figure ->

Now i have one doubt in FAT 4 bocks are reserved for keeping file system related information. So i think from 100 K (total number of blocks) we should subtract 4. Although answer will not change much but i think this is the correct way. Please correct me if i am wrong. 

Refer -

Refer ->  

yes, chhotu your concern is correct.So, we can also do like this.

there are total $\frac{100*10^{6}}{1000}=10^{5}$ blocks.

and each FAT block contain at max $\frac{1000}{4}=250$ entries, then

suppose our file system takes total $x$ number of blocks.

so, number of block taken by FAT+number of blocks taken by total file=$100000$

$\frac{x}{250}+x$ = 100000

solving this we get $x$=$99601$ number of block

so total file size =$99601*1000$=$99.6MB$

FAT:  File Allocation TableFAT is a method of keeping track of the contents of a hard drive used by early Microsoft operating systems that was first introduced in 1977. The table is a chart of numbers that correspond to cluster addresses on the hard drive. 

Disk Drive/ Disk Block : It is hard disk system . Disk Block Size. New hard drives are increasing their sector size (the smallest unit of data that you can physically read or write to the disk) from 512 bytes to 4096 bytes

Data block :Oracle stores data in data blocks (also called logical blocks, Oracle blocks, or pages).

4 Answers

+55 votes
Best answer
Each datablock will have its entry.
So, Total Number of entries in the FAT $= \large \frac{\text{Disk Capacity}} {\text{Block size}} = \frac{100MB}{1KB} = 100K$

Each entry takes up $4B$ as overhead

So, space occupied by overhead = $100K \times 4B = 400KB = 0.4MB$

We have to give space to Overheads on the same file system and at the rest available space we can store data.

So, assuming that we use all available storage space to store a single file = Maximum file size = $\text{Total File System size} -\text{Overhead} = 100MB - 0.4MB = 99.6 MB$
answered by Active (2k points)
edited by
100-.4 = 99.6 rt?
Yes @Arjun sir :)

We cant do "100K×4B=400KB=0.4MB" becuase here 1K means 103 but 1KB=210B

100*106 - 400*103=100*106 - .4*106=99.6*106

So here we're assuming there will be no indirect addressing/double mapping of these entries?
how total file size will be 100MB?
because disk size is 100x$10^{6}$B and we can use that much space to store a file. So total file system size can be as big as 100MB.
please suggest a tutorial to understand this concept

@Arjun Sir

Finally they asking for

" the maximum size of a file that can be stored on this disk in units of 106 bytes is "

How it can be answer 99.6MB?

I mean how 1MB disk can store 99.6 MB?

Disk size is not 1MB, it's 100x$10^{6}$ bytes, i.e, 100MB. So we can store a file of size 99.6MB w/o any problem.
Just one small thing in data transfer $10^{6} B$  ==  1 MB. But in Storage $2^{20} B$ == 1 MB.
Total blocks will be 99601.5.

$10^8/1004$=99601.5 // max block that can be formed

And we will be able to store entry for these much block and not 100k.From answer it looks like 100k block entries are getting store.

rahul sharma 5  shouldn't we remove the FAT TABLE size to calculate no of blocks else it will calculate its own block in which it exists right?

Can anyone provide resource to study this.

That's simple concept here, just one line in Galvin :

The table has one entry for each disk block and is indexed by block number.

now go step by step:

Step-1: Find no. of disk blocks as total size by disk size block

Step-2: Answer in step1 is nothing but no. of entries in FAT. And as you can see each entry is of 4 bytes so we can easily calculate size of FAT.

Step-3: Now, FAT is also stored on disk as line by Galvin :

A section of disk at the beginning of each volume is set aside to contain the table.

  so simply subtract this with total size of disk.

Now, the answer you get in step-3 is amount left after storing FAT, that we can use to store file. :)

+10 votes
no of entries that can be stored=100*10^6/(1000+4)  =0.09960*10^6

maximum file size=0.09960*10^6   * 10^3=99.6 *10^6

ans is 99.6
answered by Loyal (8.1k points)
+4 votes
Here block size is 10^3 B.
No. of entries in the FAT = Disk capacity/ Block size 
                          = 10^8/10^3 
                          = 10^5
Total space consumed by FAT = 10^5 *4B 
                            = 0.4*10^6B
Max. size of file that can be stored = 100*10^6-0.4*10^6
                                     = 99.6*10^6B.
So answer 99.6.
answered by Loyal (9.3k points)
Elaborate plz ...
0 votes

page table size + process page size <= Disk size  

(assume no of pages in process is x)
x*4 + x* 10^3  <= 100*10^6
x   <=  100*10^6 / 1004
x  <=0.0996 * 10^6
process size in 10^6  =  no of pages * one page size
              = 0.0996 * 10^6  * 10^3
              = 99.6 * 10^6 Byte

answered by Active (1.8k points)

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
49,540 questions
54,099 answers
71,007 users