• edited by
275 views
1 1 vote
A unix file system has $2$ KB blocks and $4$ byte disk addresses. Each i-node contains $10$ direct entries, one singly-indirect entry and one doubly-indirect entry. Suppose half of the files are exactly $1.5$ KB and the other half of all files are exactly $2\mathrm{KB}$, what percentage fraction of disk space would be wasted?

2 Answers

2 2 votes
A block is a minimum allocation unit of data. So, the Block can not be shared between the two files.

Half of the block takes $2$ KB space wasting $0$ disk storage.

Half of the block takes $1.5$ KB space wasting $0.5$ KB disk storage.

$\%$ waste of total $=(0.5 \mathrm{~KB} / 2 \mathrm{~KB}) 50 \%+(0 K B / 2 K B) * 50 \%=12.5 \%$
1 1 vote

@GO Classes Support @GO Classes Please, check this.

We know that every file is assoiated with it's own i-node. Then why don't you take the vacancy of i-node?

We have the i-node size=(10 direct address+ 1 singly-indirect + 1 double indirect) * 4B=48 B

We need two disk blocks to store the entire file, in which one disk block wastes 0.5 KB and another disk block wastes 0 KB.

So, there is two direct entries for those two disk blocks which are used for storing the actual file data and remainning address entries are wasted. So, wasted space in i-node=(10*4 B)=40 B.

So, percentage wasted space should be= (0.5 KB + 40 B)/( 2 * 2 KB + 48 B)=(512+40) B/(4096+ 48) B = 0.1332 = 13.32 %

 

Answer:
Position:
Show:

Related questions

2 2 votes
3 3 answers
403
403 views
GO Classes asked Sep 15, 2025
403 views
Consider a system that uses $2$-level page tables for the processes. Page tables for both levels are in the main-memory. The system has a TLB with $90 \%$ hit ratio. The ...
5 5 votes
1 1 answer
287
287 views
GO Classes asked Sep 15, 2025
287 views
Consider the following C program:Assume$\texttt{int}$ occupies $4$ bytes,page size $=1 \mathrm{~KB}$ (1024 bytes),TLB has $16$ entries, and the TLB uses LRU replacement p...
0 0 votes
1 1 answer
186
186 views
GO Classes asked Sep 15, 2025
186 views
Suppose that the following processes arrive for execution at the times indicated. Each process will run the listed amount of time.$$\begin{array}{|c|c|c|}\hline\text{Proc...
1 1 vote
2 2 answers
268
268 views
GO Classes asked Sep 15, 2025
268 views
A computer system provides each process a maximum of $256$ TeraBytes(1 TeraByte $=2^{ 40}$ bytes) of address space and a physical memory of $4$GB. The system uses paging ...