309 views
3 3 votes

A disk of size $\textbf{1024 M}$ bytes is divided into blocks of $\textbf{32 K}$ bytes. A file is stored in the disk using linked allocation. In linked allocation, each data block reserves $\textbf{8 bytes}$ to store the pointer to the next data block. The link part of the last data block contains a NULL pointer (also of $\text{8 bytes}$).

Suppose a file of $\mathbf{4 ~M}$ bytes needs to be stored in the disk. Assume, $1 \mathrm{~K}=2^{10}$ and $1 \mathrm{~M}=2^{20}$.

The total number of disk blocks that will be allocated to store this file is $\_\_\_\_$ . Answer in integer)

1 Answer

0 0 votes

The Block Size $(B)$ is $32 ~\text{K}$ bytes, and the Pointer Size $(P)$ is $8$ bytes.

  • Convert 32 K to bytes: $32 \mathrm{~K}=32 \times 2^{10}=32768$ bytes.
     
  • Usable Data Space ( $D$ ):

$$
D=B-P=32768 \text { bytes }-8 \text { bytes }=32760 \text { bytes }
$$


The File Size $(F)$ is 4 M bytes.

  • Convert 4 M to bytes: $4 \mathrm{M}=4 \times 2^{20}=4194304$ bytes.
     
  • The total number of blocks needed ( $N$ ) is the ceiling of (File Size / Usable Data Space):


$$
\begin{gathered}
N=\left\lceil\frac{F}{D}\right\rceil=\left\lceil\frac{4194304}{32760}\right\rceil \\\\
N \approx\lceil 128.0156\rceil \\\\
\mathbf{N}=\mathbf{1 2 9} \text { blocks }
\end{gathered}
$$

Answer:
Position:
Show:

Related questions

4 4 votes
2 2 answers
428
428 views
GO Classes asked Dec 5, 2025
428 views
Consider a distributed file system with $\mathbf{5}$ processes that share $\mathbf{11}$ File Handle (FH) instances. Each process can request a maximum of $\boldsymbol{K}$...
2 2 votes
3 3 answers
411
411 views
GO Classes asked Dec 5, 2025
411 views
Consider a system with $\mathbf{4 ~processes}$ ( $P_1, P_2, P_3, P_4$ ) that share a single pool of Memory Buffer instances. Each process requires a maximum of $\mathbf{6...
4 4 votes
2 2 answers
411
411 views
GO Classes asked Dec 5, 2025
411 views
A $\mathbf{2000 ~Kbyte}$ memory is managed using variable partitions but no compaction. It currently has three partitions of sizes $\mathbf{300 ~Kbyte}$, $\mathbf{450 ~Kb...
3 3 votes
2 2 answers
331
331 views
GO Classes asked Dec 5, 2025
331 views
A $\mathbf{1500 ~Kbyte}$ memory is managed using variable partitions but no compaction. It currently has three partitions of sizes $\mathbf{100 ~Kbyte, 200 ~Kbyte,}$ and ...