.\" -*- nroff -*- .\" Copyright 1993, 1994, 1995 by Theodore Ts'o. All Rights Reserved. .\" This file may be copied under the terms of the GNU Public License. .\" .TH DEBUGFS 8 "October 1995" "Version 0.5c" .SH NAME debugfs \- ext2 file system debugger .SH SYNOPSIS .B debugfs [ [ .B \-w ] device ] .SH DESCRIPTION .B debugfs is a file system debugger. It can be used to examine and change the state of an ext2 file system. .br .I device is the special file corresponding to the device containing the ext2 file system (e.g /dev/hdXX). .SH OPTIONS .TP .I -w Specify that the file system should be open in read-write mode. Without this option, the file system is open in read-only mode. .SH COMMANDS .B debugfs is an interactive debugger. It understands a number of commands. .TP .I cat Dump the contents of an inode to stdout. .TP .I cd Change the current working directory to specified directory .TP .I chroot Change the root directory to be the specified inode. .TP .I close Close the currently open file system. .TP .I clri Clear the contents of the inode corresponding to .I file .TP .I dump Dump the contents of an inode to a file. .TP .I expand_dir Expand a directory. .TP .I find_free_block [goal] Find the first free block, starting from .I goal and allocates it. .TP .I find_free_inode [dir [mode]] Find a free inode and allocates it. .TP .I freeb Mark the block as not allocated. .TP .I freei Free the inode corresponding to .I file .TP .I help Print a list of commands understood by .BR debugfs (8). .TP .I icheck Do block->inode translation. .TP .I iname Print the file name corresponding to .I inode (currently not implemented - see ncheck). .TP .I initialize Create an ext2 file system on .I device .TP .I kill_file Remove a file and deallocates its blocks. .TP .I ln Create a link. .TP .I ls [pathname] Emulate the .BR ls (1) command. .TP .I modify_inode Modify the contents of the inode corresponding to .I file .TP .I mkdir Make a directory. .TP .I mknod [p|[[c|b] ]] Create a special device file .TP .I ncheck Do inode->name translation. .TP .I open [-w] Open a file system. .TP .I pwd Print the current working directory. .TP .I quit Quit .B debugfs .TP .I rm Remove a file. .TP .I rmdir Remove a directory. .TP .I setb Mark the block as allocated. .TP .I seti Mark in use the inode corresponding to .I file .TP .I show_super_stats List the contents of the super block. .TP .I stat Dump the contents of the inode corresponding to .I file .TP .I testb Test if the block is marked as allocated. .TP .I testi Test if the inode correponding to .I file is marked as allocated. .TP .I unlink Remove a link. .TP .I write source_file Create a file in the filesystem named .IR file , and copy the contents of .I source_file into the destination file. .SH AUTHOR .B debugfs was written by Theodore Ts'o . .SH SEE ALSO .BR dumpe2fs (8), .BR e2fsck (8), .BR mke2fs (8)