In: Computer Science
Given a 2.5 GB FAT hard disk (128 Sectors per Cluster) and assuming a pure ASCII text file of 10,000 characters [Hint: 1 character is stored in one byte, one sector=512 byte]
What is the cluster size in bytes? [4 points]
How many clusters are assigned for this file? [4 points]
How many sectors are actually needed to store the file? [5 points]
How much is the RAM slack? [5 points]
How much is the drive slack? [5 points]
Show all calculations and explain/justify your answer.
Given that, 1 sector = 512 byte and 1 cluster = 128 sectors.
So, size of a cluster in bytes = 128*512 = 65536 bytes
Total bytes requried to store this file = 10000*1 = 10000 bytes (since 1 character takes 1 byte)
Sectors needed to store 10000 bytes = 10000/512 ≈ 20 (Since no. of sectors can't be in fraction)
So, number of clusters assigned = 20/128 ≈ 1 (Since no. clusters can't be in fraction)
As, we saw that 20th sector is not fully taken, it has x amt of space free.
x = 512*20 - 10000 = 240 byte
RAM slack is the amt of space left on the last logical sector of a file.
So, RAM slack = 240 byte
Drive slack consist of the remaining sectors after the logical sector in the last cluster assigned to the file.
Since, only one cluster is assigned to the file and there are 128 sectors per sector, remaining sectors of the cluster can be obtained by 128-20 = 108.
So, Drive slack = 108*512 = 55296 byte