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

1. Suppose you have a hard drive with 20 blocks of storage. This particular driv

ID: 3780289 • Letter: 1

Question

1. Suppose you have a hard drive with 20 blocks of storage. This particular drive uses contiguous allocation with a first-fit method of allocating files. Compute the hard drive layout after the following operations take place:

2. Suppose you want to measure the disk fragmentation that has occurred. Looking at the above trace you realize that most files on this system occupy 3 blocks or more. How many free chunks are there of size 2 or less?

3. What percentage of total disk space are these fragmentary chunks?

4. Suppose you have the same hard drive as above, but you've upgraded to a linked-list allocation method. Compute the hard drive layout after the following operations take place:

5. How many chunks are there of size 2 or less?

6. Does it still make sense to measure disk fragmentation in this way?

7. Recall that in a linked-list allocation method each individual block of a file keeps track of the successor block. How many blocks must be read to locate the 3500th byte of file A? Suppose that each block is 1024 bytes.

8. Construct the File Allocation Table (FAT) corresponding to the linked-list allocation above.

9. Suppose you have a 10GB drive (2^30 * 10 bytes). How many entries would a FAT need if the block size is 1KB (2^10), 4KB, and 8KB??

10. How large would the FAT be (in bytes) for each size above if each entry were 3 bytes?

11. On a traditional hard drive with spinning magnetic platters, the time it takes to execute a read is the sum of the seek time and the block read time. The seek time is the amount of time it takes the hard drive to physically locate the requested data, and the block read time is the amount of time it takes the data to be read off the disk. If a file is split across multiple blocks, then the drive must seek to each individual block and read it.

One study found that the average file size on a Linux system is 2475 bytes long. How long does it take to read the average file on a system with 1024-byte (1KB) block sizes? What about 2048 bytes (2KB) and 4096 bytes (4KB)? Suppose a seek time of 10 microseconds and a block read time of 3 microseconds.

Explanation / Answer

Solution:

1.

Q2. From the above allocation it is clear that there are 2 chunks of size 2 that are free.

Q3. To find the percentage of the fragmented chunks with respect to total disk space, we will do following calculation:

There are 2 chunks of size 2 which comes total to 4 blocks

now,

(4/20) *100= 20%

Create A2 2 18 Create B3 2 3 15 Create C3 2 3 3 12 Create D5 2 3 3 5 7 Delete B 2 3 (free) 3 5 7 Delete C 2 3 (free) 3 (free) 5 7 Create E4 2 4 2 (free) 5 7 Delete A 2 (free) 4 2 (free) 5 7 Create F3 2 (free) 4 2 (free) 5 3 4