Nt1310 Unit 2 File Analysis

707 Words3 Pages
Introduction: In this assignment, you will explore the implementation of a particular file system, ext2, and will write tools to modify ext2-format virtual disks. To do this work, you will need to be comfortable working with binary data and will need to learn about the ext2 filesystem. Requirement: Your task is to write four programs (in C) that add or remove files from an ext2 formatted virtual disk. The executables must be named ext2_cp, ext2_mkdir, ext2_ln, and ext2_rm and must take the specified arguments. ext2_cp: This program takes three command line arguments. The first is the name of an ext2 formatted virtual disk. The second is the path to a file on your native operating system, and the third is an absolute path on your…show more content…
normal linux commands to add/remove files/directories/links ..... % cd ~ % umount /home/user/mntpoint Since we are creating images with mke2fs, the disks are formatted with the ext2 file system. You may wish to read about this system before doing some exploration. The wikipedia page for ext2 provides a good overview, but Dave Poirer's Second Extended File System article provides more detail on how the system places data onto a disk. It's a good reference to keep on hand as you explore. However, you will probably also want to explore the disk images to get an intuitive sense of how they are structured. There are two good ways to interface with these images. The first way is to interact with it like a user by mounting the file system so that you can use standard commands (mkdir, cp, rm, ln) to interact with it. Details of how to do this are below. The second way is to interact with the disk as if it is a flat binary file. Use xxd to create hex dumps, diff to look for differences between the dumps, and your favorite text editor to view the diffs. For example (YMMV): %
Open Document