edited by
9,809 views
38 votes
38 votes

A file system with a one-level directory structure is implemented on a disk with disk block size of $4K$ bytes. The disk is used as follows:
$$\begin{array}{|l|}\hline \text{Disk-block 0} & & \text{File Allocation Table, consisting of one 8-bit } \\ \text{} && \text{entry per data block, representing the data } \\ \text{}  && \text{block address of the next data block in the file} \\ \hline \text{Disk-block 1} & & \text{Directory, with one 32 bit entry per file:} \\\hline \text{Disk-block 2} & & \text{Data-block 1;} \\ \hline \text{Disk-block 3} & & \text{Data-block 2; etc.} \\ \hline\end{array}$$

  1. What is the maximum possible number of files?
  2. What is the maximum possible file size in blocks
edited by

2 Answers

Best answer
37 votes
37 votes
  1. Maximum possible number of files:
    As per question, $32$ bits (or $4$ Bytes) are required per file. And there is only one block to store this, ie the Disk block $1$, which is of size $4$KB.  So number of files possible is  $4$ KB$/4$ Bytes$=1$ K files possible.
  2. Max file size:
    As per question the Disk Block Address (FAT entry gives DBA) is of $8$ bits. So, ideally the max file size should be $2^8=256$ Block size.. But question makes it clear that two blocks, DB0 and DB1, stores control information. So. effectively we have $256-2 =254$ blocks with us and the max file size shoud be $=254 \times$ size of one block $= 254 \times 4$ KB $ = 1016$ KB.
selected by
22 votes
22 votes

Here 2 blocks are used for the directory.

First blocks store the FAT and second block Store the Directory.Each entry second block can contain file name, starting block and metadata.

so No of files=4KB/4B = 1024 maximum files are possible.

As shown in diagram each entry in FAT stores the next block address of the same file. so total 256 blocks per file are possible.

The FTA table is created for all files at one place. If disk having only 256 blocks then max file size =256-2=254. But here it can allocate 256 blocks.

so maximum file size should be 256 blocks.

edited by

Related questions