Assume an FFS-style file system with an 8 KB block size, 4 byte block numbers, and an inode that contains pointers to the first 10 block numbers, one indirect block, and one double indirect block. Remember that 1 KB = 1024 B, 1 MB = 1024 KB, and 1 GB = 1024 MB.
How large in KB can a file be without needing to use the indirect block?
How many block numbers can be stored in a single indirect block?
How many MB of data does an indirect block point to?
How large in KB can a file be without needing to use the double indirect block?
How many GB of data does a double indirect block point to?
What is the maximum size of a file in KB?
Given the assumptions in the previous problem, give the logical block number and offset within the block for the following file offsets:
0
8188
8192
10000
20000
A file system has a root directory containing two entries: homestar and strong, both directories. The homestar directory contains an entry for a regular file named runner.txt. We can represent the current state of the system as follows:
file # type contents
------ ---- --------
1. directory . -> 1 .. -> 1homestar -> 2 strong -> 3
2. directory . -> 2 .. -> 1 runner.txt -> 4
3. directory . -> 3 .. -> 1
4. regular file (contents of file)
The symlink system call creates a directory entry that contains the path name of the file being linked to, rather than a file number. For example, after executing symlink(/homestar, /strong/mad), The contents of directory 3 would look like this:
3. directory . -> 3 .. -> 1 mad -> /homestar
Show the changes to the state of the file system after each of the following operations is executed in succession.
link(/homestar/runner.txt, /strong/bad.txt)
symlink(/homestar/runner.txt, /strong/sad.txt)
unlink(/homestar/runner.txt)
mkdir(/trogdor)
create(/trogdor/burninator.txt)