Creating the undelete directory
The undelete inode in the ext2 filesystem is inode 6. It was reserved in the design of the ext2 filesystem but not implemented. Taking a hint from Linus Tauro's project we used the ext2fsprogs to create the undelete inode. We modified function create_root_dir() in mke2fs.c to make our create_undel_dir(). This function calls the ext2fs_mkdir() to create the undelete directory in inode 6. This function takes the file system pointer, the parent inode, the directory inode and the name of the new directory. We send the EXT2_UNDEL_DIR_INO as the parent and as the directory and no name so that the directory is not linked into the root filesystem hierarchy. This way the directory will be "hidden" from the rest of the file system.