Inodes you’re busy
Lab exercises for April 3rd
The goals for this assignment are:
-
Work with inodes and disks
We will use the same repository as this week’s assignment: Defragmentor Repo.
1. Print disk
In the file, printdisk.c
, implement a program that reads a disk and prints its underlying data structure
in terms of the superblock and its inodes.
Information about how to parse disks are in the writeup for Assignment 07.
$ ./printdisk datafile-frag
size 512
inode offset 0
data offset 4
swap offset 10239
free inode 14
free block 10133
0
next inode 0
protect 0
nlink 1
size 93821
uid 18390
gid 9921
ctime 536561894
mtime 609329799
atime 502539239
direct datablocks
0: 1120
1: 8393
2: 1579
3: 9539
4: 7108
5: 7883
6: 4762
7: 1980
8: 1030
9: 8610
single indirect
0: 4500
1: 3711
2: 0
3: 0
double indirect
0
triple indirect
0
//etc