Professional Documents
Culture Documents
1. Filesystems can support sparse files, what does this mean? Give an example of an
application's file organisation that might benefit from a file system's sparse file
support
2. Give an example of a scenario that might benefit from a file system supporting an
append-only access write
3. Give a scenario where choosing a large filesystem block size might be a benefit;
give an example where it might be a hinderance.
4. Give an example where contiguous allocation of file blocks on disks can be used in
practice.
5. What file access pattern is particularly suited to chained file allocation on disk?
6. What file allocation strategy is most appropriate for random access files?
7. Compare bitmap-based allocation of blocks on disk with a free block list.
8. How can the block count in an inode differ from the (file size / block size) rounded
up to the nearest integer. Can the block count be greater, smaller, or both.
9. Why might the direct blocks be stored in the inode itself?
10. Given that the maximum file size of combination of direct, single indirection,
double indirection, and triple indirection in an inode-based filesystem is
approximately the same as a filesystem soley using triple indirection, why not
simply use only triple indirection to locate all file blocks?
11. What is the maximum file size supported by a file system with 16 direct blocks,
single, double, and triple indirection? The block size is 512 bytes. Disk block
numbers can be stored in 4 bytes.
12. The berkely fast filesystem (and Linux Ext2fs) use the idea of block groups.
Describe what this idea is and what improvements block groups have over the
simple filesystem layout of the System V file system (s5fs).
13. What is the reference count field in the inode? You should consider its
relationship to directory entries in you answer.
14. The filesystem buffer cache does both buffering and caching. Describe why
buffering is needed. Describe how buffering can improve performance (potentially
to the detriment of file system robustness). Describe how the caching component
of the buffer cache improves performance.
15. What does flushd do on a UNIX system?
16. Why might filesystems managing external storage devices do write-through
caching (avoid buffering writes) even though there is a detrimental affect on
performance.
17. What permissions would you have on the following files:
om:[/tmp]% ls -ld t* .
drwxrwxrwt 6 root root 4096 May 21 12:19 .
-rw-rw---- 1 nash stud 216 May 18 18:59 t1
-rw--w---- 1 nash stud 260 May 18 18:59 t2
-rw------- 1 nash stud 458 May 18 18:59 t3
-rwsrwsr-x 1 nash stud 138 May 21 12:19 t4
-rwsrwxr-x 1 nash stud 285 May 21 12:19 t5
18. Consider a file currently consisting of 100 records of 400 bytes. The filesystem
uses fixed blocking, i.e. one 400 byte record is stored per 512 byte block. Assume that
the file control block (and the index block, in the case of indexed allocation) is already
in memory. Calculate how many disk I/O operations are required for contiguous,
linked, and indexed (single-level) allocation strategies, if, for one record, the following
conditions hold. In the contiguous-allocation case, assume that there is no room to
grow at the beginning, but there is room to grow at the end of the file. Assume that
the record information to be added is stored in memory.
a. Read 1 byte
b. Write 1 byte
27. Assume you have an inode-based filesystem. The filesystem has 512 byte blocks. Each
inode has 10 direct, 1 single indirect, 1 double indirect, and 1 triple indirect block
pointer. Block pointers are 4 bytes each. Assume the inode and any block free list is
always in memory. Blocks are not cached.
28. A typical UNIX inode stores both the file's size and the number of blocks currently
used to store the file. Why store both? Should not blocks = size / block size?
29. How can deleting a file leave a inode-based file system (like ext2fs in Linux)
inconsistent in the presence of a power failure.
30. How does adding journalling to a file system avoid corruption in the presence of
unexpected power failures.