110 views
0 0 votes

A disk file system uses linked allocation through a FAT.

Cluster size $:4$ KB

The relevant directory information is:


The cluster chain of $\texttt{file1}$ is:

$100 \rightarrow 106 \rightarrow 108$

Assume:

  • the entire FAT is already in main memory
     
  • directory $\texttt{dir}$ is already in main memory
     
  • directory $\texttt{dir1}$ is not in memory
     
  • no data cluster of $\texttt{file1}$ is currently in memory

The system wants to read the $5000$th byte of:

$\texttt{dir/dir1/file1}$

Which disk clusters must actually be read?

  1. $48,\ 100,\ 106$
     
  2. $48,\ 106$
     
  3. $100,\ 106$
     
  4. $48,\ 100,\ 106,\ 108$

1 Answer

0 0 votes

The $\texttt{dir}$ directory is already in memory.

From it, the system learns:

$\texttt{dir1}$ starts at cluster $48$.

So cluster $\boxed{48}$ must be read to obtain the contents of directory $\texttt{dir1}$.

From that directory, the system learns:

$\texttt{file1}$ starts at cluster $100$.

Now locate byte $5000$.

One cluster contains:

$4\text{ KB}=4096$ bytes.

Therefore:

  • bytes $1$ through $4096$ are in the first cluster
     
  • byte $5000$ is in the second cluster

The first cluster of $\texttt{file1}$ is $100$.

Normally, with ordinary linked allocation, block $100$ would have to be read to discover the next block.

But this system uses FAT, and the FAT is already in memory.

The system simply looks up:

$FAT[100]=106$

without performing a disk read.

Therefore it directly reads cluster $: \boxed{106}$

which contains byte $5000$.

So the only disk clusters actually accessed are: $\boxed{48,\ 106}$


Answer : B

Answer:
Position:
Show:

Related questions

1 1 vote
1 1 answer
93
93 views
GO Classes asked Aug 24
93 views
A FAT-like file system uses a $\textbf{24}$-bit FAT entry for every allocation unit.The disk capacity is: $32$ GBAssume: $1\text{ GB}=2^{30}\text{ bytes}$What is the mini...
3 3 votes
1 1 answer
131
131 views
GO Classes asked Aug 24
131 views
A file system supports three allocation strategies:Contiguous allocation Linked allocation Single-level indexed allocationThe information about a file has already been ob...
2 2 votes
1 1 answer
97
97 views
GO Classes asked Aug 24
97 views
A file currently consists of $100$ data blocks.Assume:the file-control block is already in memory for indexed allocation, the index block is also already in memory the ne...
3 3 votes
1 1 answer
91
91 views
GO Classes asked Aug 24
91 views
Consider the following statements about contiguous file allocation.It requires storing the number of the first block of the file. It provides excellent performance for re...