In: Computer Science
What are the steps required to be performed by the Ext2 file system subsystem to delete a file of size 72KiB? Assume you know and have in memory a copy of the inode of the directory the file is in and the inode of the file to be deleted. Also assume the block size is 1024 bytes. Either list the steps required or use a flowchart.
There are generally two stages to creating a file system on a disk. The first step is to form atit so that the disk driver can read and write block so nit. Modern hard disks come pre formatted from the factory and need not be reformatted, floppy disks may be formatted on Linux using a utility program such as super format or fd format. The second step involves creating a file system, which means setting up the structures described earlier. Ext 2 file systems are created by the mke2fs utility program, it assumes the following default options, which may be modified by the user with flags on the command line:
The program performs the following actions:
Let's us consider, for example, how an Ext 21.44 MB floppy disk is initialized by mke2 fs with the default options. Once mounted, it appears as a volume consisting of 1,412 blocks, each one is 1,024 bytes in length.
Block |
Content |
|
0 |
Boot block |
|
1 |
Super block |
|
2 |
Block containing a single block group descriptor |
|
3 |
Data block bit map |
|
4 |
i node bit map |
|
5-27 |
i node table : i nodes up to 10 : reserved (i node 2 is the root), i node 11 : lost + found; i nodes 12–184 : free |
|
28 |
Root directory (includes .,.. and lost + found) |
|
29 |
lost + found directory (includes . and ..) |
|
30-40 |
Reserved blocks pre allocated for lost + found directory |
|
41-1439 |
Free blocks |