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

Assume that the directory of your target file (the one you are about to access)

ID: 3830197 • Letter: A

Question

Assume that the directory of your target file (the one you are about to access) has been loaded to the memory (from the hard disk), but none of the file’s i-nodes. How many disk accesses are needed in the worst case when you try to read one byte in the file using the following assumptions?

The location of the one byte you try to read is 1,049,188 bytes from the beginning of the file. (b) The disk block size in the i-node file system is 256 bytes. (c Each "pointer (to a disk block in the i-node file system is 4 bytes. (d) Your hard drive can access a disk block (i.e., one disk block is one disk sector). Show your work.

Explanation / Answer

An inode has 12 direct pointers,one indirect block pointer and one double indirect block pointer.Total inode size is 256 bytes.

In the worst case there is no buffer cache,or inode is not stored in the memory.To read the last byte of the file,

The following reads are needed,

1 read for the required inode

1 to read the double indirect block

1 to read indirect block.

1 to read the data.

so,totally 4 disk accesses are needed.

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