Simulator

This lesson explains how to interact with the simulator for the exercise presented in the next lesson.

We'll cover the following...

This exercise introduces fsck.py, a simple file system simulator. Some familiarity with the vsfs.py simulator (described in an earlier chapter on file system implementation would be useful, but is not necessary.

Terminal 1
Terminal
Loading...

The file system tool changes the on-disk state of the file system, and then leaves it to you, the user, to detect the problem, much like a file system consistency checker would do (e.g., fsck). The file system itself is based on a simplified VSFS, the very simple file system described in an earlier chapter. The tool first generates an on-disk file system; then, either randomly or through more specific controls, the tool changes the on-disk state of one aspect of the file system.

The challenge for you, the user, is to figure out which part of the file system’s on-disk state was changed and hence has become inconsistent. In many cases, the problem should be readily detected; in others, perhaps less so.

Let’s get into the details. Here is an example run of the tool:

prompt> ./fsck.py -S 1
...
Final state of file system:

inode bitmap 1100100010000010
inodes       [d a:0 r:4] [f a:-1 r:1] [] [] [d a:8 r:2] [] [] [] 
    
...