IT代考 CSC369 – Lab 9

CSC369 – Lab 9

Learning objectives
 By the end of this lab you should be able to:

Copyright By PowCoder代写 加微信 powcoder

 Explain inode and directory structures (may revisit information from last lab)  Access inode and directory structures in a basic ext2 file system
 Operate with further intricacies of file system operations

Sample directory: pay attention to the offsets
inode = 10
rec_len = 12
name_len = 1
file_type name = “.” padding
inode = 11
rec_len = 12
name_len = 2
7 8 9 11 file_type name = “..” padding
inode = 12
rec_len = 16
name_len = 6
19 20 22 23 file_type name = 123456 padding
inode = 13
rec_len = 16
name_len = 8
31 32 38 39 file_type name = 12345678
inode = 14
rec_len = 968
name_len = 8
file_type name = 87654321 very long padding
63 64 72 1023

Deleting an entry:
inode = 10
rec_len = 12
name_len = 1
file_type name = “.” padding
inode = 11
rec_len = 12
name_len = 2
7 8 9 11 file_type name = “..” padding
inode = 12
rec_len = 16
name_len = 6
19 20 22 23 file_type name = 123456 padding
inode = 13
rec_len = 16
name_len = 8
31 32 38 39 file_type name = 12345678
inode = 14
rec_len = 968
name_len = 8
file_type name = 87654321 very long padding
63 64 72 1023

Deleting an entry:
inode = 10
rec_len = 12
name_len = 1
file_type name = “.” padding
inode = 11
rec_len = 12
name_len = 2
7 8 9 11 file_type name = “..” padding
inode = 12
rec_len = 16
name_len = 6
19 20 22 23 file_type name = 123456 padding
inode = 13
rec_len = 16
name_len = 8
31 32 38 39 file_type name = 12345678
inode = 14
rec_len = 968
name_len = 8
file_type name = 87654321 very long padding
63 64 72 1023

Deleting an entry:
inode = 10
rec_len = 12 4
name_len = 1
file_type name = “.” padding
inode = 11
rec_len = 28
name_len = 2
7 8 9 11 file_type name = “..” padding
inode = 12
rec_len = 16
name_len = 6
19 20 22 23 file_type name = 123456 padding
inode = 13
rec_len = 16
name_len = 8
31 32 38 39 file_type name = 12345678
inode = 14
rec_len = 968
name_len = 8
file_type name = 87654321 very long padding
63 64 72 1023

Deleting the first entry:
In this example, the first entry is “.”, so it can’t technically be removed, but for simplicity pretend it is something else.
inode = 10
rec_len = 12
name_len =
file_type name = “.” padding
inode = 11
rec_len = 28
name_len =
7 8 9 11 file_type name = “..” padding
inode = 12
rec_len = 16
18 name_len =
19 20 22 23 file_type name = 123456 padding
inode = 13
rec_len = 16
30 name_len =
31 32 38 39 file_type name = 12345678
inode = 14
rec_len = 968
46 name_len =
file_type name = 87654321 very long padding
63 64 72 1023

Deleting the first entry:
rec_len = 12
name_len =
file_type name = “.” padding
inode = 11
rec_len = 28
name_len =
7 8 9 11 file_type name = “..” padding
inode = 12
rec_len = 16
18 name_len =
19 20 22 23 file_type name = 123456 padding
inode = 13
rec_len = 16
30 name_len =
31 32 38 39 file_type name = 12345678
inode = 14
rec_len = 968
46 name_len =
file_type name = 87654321 very long padding
63 64 72 1023

Restoring an entry? Search the gaps!
rec_len = 12
name_len = 1
file_type name = “.” padding
inode = 11
rec_len = 28
name_len = 2
7 8 9 11 file_type name = “..” padding
inode = 12
rec_len = 16
name_len = 6
19 20 22 23 file_type name = 123456 padding
inode = 13
rec_len = 16
name_len = 8
31 32 38 39 file_type name = 12345678
inode = 14
rec_len = 968
name_len = 8
file_type name = 87654321 very long padding
63 64 72 1023

Restoring an entry? Search the gaps!
Possibility 1: inode = 0
Is it possible to restore this?
rec_len = 12
name_len = 1
file_type name = “.”
inode = 11
rec_len = 28
name_len = 2
7 8 9 11 file_type name = “..” padding
inode = 12
rec_len = 16
name_len = 6
19 20 22 23 file_type name = 123456 padding
inode = 13
rec_len = 16
name_len = 8
31 32 38 39 file_type name = 12345678
inode = 14
rec_len = 968
name_len = 8
file_type name = 87654321 very long padding
63 64 72 1023

Restoring an entry? Search the gaps! Where padding is how much you need to add to name_len so that it
rec_len = 12
name_len = 1
becomes a multiple of 4. file_type name = “.” padding
inode = 11
rec_len = 28
name_len = 2
7 8 9 11 file_type name = “..” padding
inode = 12
rec_len = 16
name_len = 6
19 20 22 23 file_type name = 123456 padding
inode = 13
rec_len = 16
name_len = 8
31 32 38 39 file_type name = 12345678
inode = 14
rec_len = 968
name_len = 8
file_type name = 87654321 very long padding
63 64 72 1023
Possibility 2:
rec_len != 8 + name_len + padding

程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com