This is a sample assignment about the concepts behind the inode data structure.
Solutions are available as a plain ASCII file.
Consider a disk that holds data as 1KiB blocks. Consider a file system that uses a UNIX-like inode data structure as follows:
The inode structure above is always stored in its own disk block
Assuming a block pointer is stored using 8 bytes, what is the maximum possible size of a file whose inode does not use the double- and triple-indirect pointers? Show your work, and give your answer as a sum of powers of 2.
Still assuming that a block pointer requires 8 bytes, what is the maximum possible size of a file on our file system? Show your work, and give your answer as a sum of powers of 2.
Still assuming that a block pointer requires 8 bytes, now consider a file that’s 32.3KiB. How many blocks are used on disk to store the file AND its inode? Show your work, and give your answer as an integer.
Your friend tells you that on this system a 1GiB file can be handled with an inode that only uses the direct, single, and double indirect pointers. You then reply: ``Oh.. then I know that the block pointers are at most X bits”. What is X? Show your work, and give your answer as an integer. (hint: this requires solving a quadratic equation)