Lab: Very Simple FS
CSC 213 - Operating Systems and Parallel Algorithms - Weinman
- Summary:
- You will read and decode a file system state.
- Objectives:
- Understand the effects of various file system operations
on the disk state.
Preliminaries
In class, we will talk about how to understand the following disk
file system state.
-
inode bitmap 11110000
inodes [d a:0 r:6] [f a:1 r:1] [f a:-1 r:1] [d a:2 r:2] [] [] [] []
data bitmap 11100000
data [(.,0) (..,0) (y,1) (z,2) (f,3)] [u] [(.,3) (..,0)] [] [] [] [] []
Our valid operations include
- mkdir(), creates a new directory
- creat(), creates a new (empty) file
- open(), opens a file
- write(), appends a block to a file
- close(), closes a file
- link(), creates a hard link to a file
- unlink(), unlinks a file (removing it if the link count becomes
zero)
Exercises
Begin by relocating to the directory containing the program for this
lab.
-
$ cd ~weinman/public_html/courses/CSC213/2014F/labs/code/vsfs
Part A: Reverse Engineering
Part of demonstrating understanding the file system is to infer operations
that changed disk from one state to another.
- From the list of operations above, give the sequence of specific operations
(with appropriate arguments) that would cause the following sequence
of file system states.
-
$ ./vsfs.py -n 6 -s 17
- Verify your answers:
-
$ ./vsfs.py -n 6 -s 17 -c
- Repeat the task with another stream of requests, giving the sequence
of operations for the following states.
-
$ ./vsfs.py -n 6 -s 18
- Verify your answers:
-
$ ./vsfs.py -n 6 -s 18 -c
Part B: Looking Forward
- Record the initial state from the terminal into your favorite text
editor, and paste a copy, recording the changes the first operation
would have on the file system state. Repeat the copy and update steps
for the subsequent commands given.
-
$ ./vsfs.py -r -n 6 -s 19
- Verify your answers carefully:
-
$ ./vsfs.py -r -n 6 -s 19 -c
- Repeat the task with another stream of commands.
-
$ ./vsfs.py -r -n 6 -s 20
- Verify your answers carefully:
-
$ ./vsfs.py -r -n 6 -s 20 -c
- Acknowledgment:
- Exercises and vsfs.py from Operating
Systems: Three Easy Pieces ("File System Implementation") (v0.50)
by Remzi H. and Andrea C. Arpaci-Dusseau.