What is stored in a directory entry and what is stored in a file entry? [2 marks]
Question:
What is stored in a directory entry and what is stored in a file entry? [2 marks]
(b) Consider a file system that uses a fixed size 128 byte directory entry structure, a fixed size 32 byte file entry structure, and manages storage via the “chaining in a map” technique, on a disk that uses 4 kByte blocks. Assume that the map of blocks is permanently in memory and need not be read from disk. Assume further that the file system contains 220 files.
(i) Assume this file system is structured as a file system with a single level directory. Explain how many blocks must be read in order to open and read a 16 byte file named /a/b/c/d/e. [3 marks]
(ii) Instead, assume this file system is structured as a simple hierarchical file system with directories that can contain up to 256 sub-directories and 1024 files. Give upper and lower bounds on how many blocks must be read in order to open and read a 16 byte file named /a/b/c/d/e where / denotes the path separator. State any assumptions you make in computing your bounds. [10 marks]
(c) Unix uses a more complex file entry structure than assumed above, known as an i-node. In addition to file metadata, the i-node stores 12 direct blocks, plus single, double and triple indirect blocks (each of which has 512 entries). Explain what purpose is served by each of these four types of block. [3 marks]
(d) Using Unix i-nodes as above, compute the maximum size file that can be stored. Assume a block is 4 kBytes in size. [2 marks]