Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Question 1: One way to use contiguous allocation of the disk and not suffer from

ID: 3777607 • Letter: Q

Question

Question 1: One way to use contiguous allocation of the disk and not suffer from holes is to compact the disk every time a file is removed. Since all files are contiguous, coping a file requires a seek and rotational delay to read the file, followed by the transfer at full speed. Writing the file back requires the same work. Assuming a seek time of 5 msec, a rotational delay of 4 msec, a transfer rate of 8 MB/sec, and an average file size of 8 KB, how long does it take to read a file into main memory then write it back to the disk at a new location? Using these numbers, how long would it take to compact half of a 16 GB disk? (5 pts)

Question 2: In light of the answer to the previous question, does compacting the disk ever make any sense? (2 pts)

Question 3: The performance of a file system depends upon the cache hit rate (fraction of blocks found in the cache). If it takes 1 msec to satisfy a request from the cache, but 40 msec to satisfy a request if a disk read is needed, give a formula for the mean time required to satisfy a request if the hit rate is h. (3 pts)

Question 4: A certain file system uses 4-KB disk blocks. The median file size is 1 KB. If all files were exactly 1 KB, what fraction of the disk space would be wasted? Do you think the wastage for a real file system will be higher than this number or lower than it? Explain briefly your answer. (5 pts)

Explanation / Answer

model the physical disk addresses with block addresses
a block address is just AN number telling that one among the blocks it's
a block address is additionally referred to as a block variety
usually every block address corresponds to precisely one sector id, however generally a block address corresponds to multiple sectors ids.
I/O layer of the OS interprets disk addresses, expressed as a mixture of a drive #, a cyclinder #, a track #, and a sector #, into sector ids (and if necessary block numbers).
use disk for:
file system
swap space (managed as a part of the classification system on UNIX)
general problem: however can we organize the house on disk?
contiguous allocation
each file occupies a collection of consecutive addresses on disk
each directory entry contains:
file name
starting address of the primary block
block address = sector id (e.g., block = 4K)
length in blocks
usual dynamic storage allocation downside
use initial work, best fit, or worst work algorithms to manage storage
if the file will increase in size, either
leave no further house, and replica the file elsewhere if it expands
leave further house
better than joined allocation if we would like to hunt a selected offset of a file as a result of several links square measure keep along rather than each in an exceedingly separate block
SGG decision this organization a ``linked'' theme, however I decision it AN ``indexed'' theme as a result of AN index is unbroken in main memory.
problem: index is just too massive to suit in main memory for giant disks
FAT could get extremely massive and that we might have to store FAT on disk, which is able to increase interval
e.g., five hundred Mb disk with one K blocks = four bytes * five hundred K = 2Mb entries
ii)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote