2 .\" Copyright 1993, 1994, 1995 by Theodore Ts'o. All Rights Reserved.
3 .\" This file may be copied under the terms of the GNU Public License.
5 .TH DEBUGFS 8 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@"
7 debugfs \- ext2 file system debugger
28 is a file system debugger. It can be used to examine and change the
29 state of an ext2 file system.
32 is the special file corresponding to the device containing the ext2
33 file system (e.g /dev/hdXX).
37 Specify that the file system should be open in read-write mode. Without this
38 option, the file system is open in read-only mode.
43 to read in commands from
45 and execute them. When
47 is finsihed executing those commands, it will exit.
52 to execute the single command
57 is an interactive debugger. It understands a number of commands.
60 Dump the contents of the inode
65 Change the current working directory to
69 Change the root directory to be the directory
73 Close the currently open file system.
76 Clear the contents of the inode
79 .I dump [-p] filspec out_file
80 Dump the contents of the inode
86 option is given set the owner, group and permissions information on
91 .I expand_dir filespec
95 .I find_free_block [goal]
96 Find the first free block, starting from
100 .I find_free_inode [dir [mode]]
101 Find a free inode and allocates it. If present,
103 specifies the inode number of the directory
104 which the inode is to be located. The second
107 specifies the permissions of the new inode. (If the directory bit is set
108 on the mode, the allocation routine will function differently.)
111 Mark the block number
116 Free the inode specified by
120 Print a list of commands understood by
124 Print a listing of the inodes which use the one or more block specified
127 .I initialize device blocksize
128 Create an ext2 file system on
132 Note that this does not fully initialize all of the data structures;
135 program. This is just a call to the low-level library, which sets up
136 the superblock and block descriptors.
138 .I kill_file filespec
141 and its blocks. Note that this does not remove any directory
142 entries (if any) to this inode. See the
144 command if you wish to unlink a file.
146 .I ln filespec dest_file
151 Note this does not adjust the inode reference counts.
154 Print a listing of the files in the directory
157 .I modify_inode filespec
158 Modify the contents of the inode structure in the inode
164 .I mknod filespec [p|[[c|b] major minor]]
165 Create a special device file (a named pipe, character or block device).
166 If a character or block device is to be made, the
170 device numbers must be specified.
172 .I ncheck inode_num ...
173 Take the requested list of inode numbers, and print a listing of pathnams
177 Open a file system for editing.
180 Print the current working directory.
189 If this cuases the inode pointed to by
191 to have no other references, deallocate the file. This command functions
192 as the unlink() system call.
198 This function is currently not implemented.
201 Mark the block number
208 as in use in the inode bitmap.
211 List the contents of the super block.
214 Display the contents of the inode structure of the inode
218 Test if the block number
220 is marked as allocated in the block bitmap.
225 is marked as allocated in the inode bitmap.
228 Remove the link specified by
230 to an inode. Note this does not adjust the inode reference counts.
232 .I write source_file out_file
233 Create a file in the filesystem named
235 and copy the contents of
237 into the destination file.
243 as an argument to specify an inode (as opposed to a pathname)
244 in the filesystem which is currently opened by debugfs. The
246 argument may be specified in two forms. The first form is an inode
247 number surrounded by angle brackets, e.g.,
249 The second form is a pathname; if the pathname is prefixed by a forward slash
250 ('/'), then it is interpreted relative to the root of the filesystem
251 which is currently opened by debugfs. If not, the pathname is
252 interpreted relative to the current working directory as maintained
253 by debugfs. This may be modified by using the debugfs command
257 was written by Theodore Ts'o <tytso@mit.edu>.