edited by
10,132 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
23 votes
23 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

9.5k
views
3 answers
22 votes
Kathleen asked Oct 9, 2014
9,461 views
A computer system uses the Banker’s Algorithm to deal with deadlocks. Its current state is shown in the table below, where $P0$, $P1$, $P2$ are processes, and $R0$, $R1...
6.4k
views
1 answers
35 votes
Kathleen asked Oct 9, 2014
6,440 views
The concurrent programming constructs fork and join are as below:Fork <label which creates a new process executing from the specified labelJoin <variable which decrements...
8.1k
views
2 answers
34 votes
Kathleen asked Oct 9, 2014
8,123 views
A demand paged virtual memory system uses $16$ bit virtual address, page size of $256$ bytes, and has $1$ Kbyte of main memory. $\text{LRU}$ page replacement is implement...
21.3k
views
6 answers
57 votes
go_editor asked Sep 28, 2014
21,320 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 o...