4.7k views
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 _________.
edited | 4.7k views
0

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.

https://gateoverflow.in/2775/gate1996_23

Refer ->

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

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

https://pclt.sites.yale.edu/disk-block-size

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

https://docs.oracle.com/cd/B19306_01/server.102/b14220/logical.htm

0

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$
edited
+4
100-.4 = 99.6 rt?
0
Yes @Arjun sir :)
0

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

0
So here we're assuming there will be no indirect addressing/double mapping of these entries?
0
how total file size will be 100MB?
0
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.
0
please suggest a tutorial to understand this concept
0

@Arjun Sir

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

+1
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.
0
Just one small thing in data transfer $10^{6} B$  ==  1 MB. But in Storage $2^{20} B$ == 1 MB.
+1
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.
0

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?

0
Can anyone provide resource to study this.
+4

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. :)

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
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.
0
Elaborate plz ...

1
2