CSC369: Week 10 Practical

Week 10 Practical: Virtual File Systems

Introduction

Assignment 3 will ask you to build tools to analyze and modify virtual disks. This lab introduces virtual disk images and asks you to begin to infer how the file system places files and directories on disks.

Here are the virtual disk images we will be using today:

These disks were each created and formatted in the same way:

% dd if=/dev/zero of=~/DISKNAME.img bs=1024 count=128
% mke2fs mydisk.img
% sudo mount -o loop ~/DISKNAME.img /home/petersen/mntpoint
Then, normal linux commands (cp, mkdir, rm, etc.) were used to place items on the disk and to remove those items. The disks were safely unmounted, and the images are linked above.

Note: Since you do not have sudo on the lab machines, you will not be able to mount these disks. Instead, you will have to look at them using a hex editor and/or manipulate them with a program (Python, C, or some other favorite language).

Today's Task

The goal for today is to become comfortable viewing the contents of these images. You will need to use hex editors and, potentially, to write some code to "diff" two images. By the end of the hour, submit (alone or in a team of two) a piece of paper that briefly explains how a file is represented on a virtual disk. In particular, note where the name of the file is located and describe the structure that tracks where the file's data is stored on disk.