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
31 is a file system debugger. It can be used to examine and change the
32 state of an ext2 file system.
35 is the special file corresponding to the device containing the ext2
36 file system (e.g /dev/hdXX).
40 Specifies that the file system should be opened in read-write mode.
41 Without this option, the file system is opened in read-only mode.
46 to read in commands from
48 and execute them. When
50 is finished executing those commands, it will exit.
55 to execute the single command
60 print the version number of
65 is an interactive debugger. It understands a number of commands.
68 Dump the contents of the inode
73 Change the current working directory to
77 Change the root directory to be the directory
81 Close the currently open file system.
84 Clear the contents of the inode
87 .I dump [-p] filspec out_file
88 Dump the contents of the inode
94 option is given set the owner, group and permissions information on
99 .I expand_dir filespec
103 .I find_free_block [goal]
104 Find the first free block, starting from
108 .I find_free_inode [dir [mode]]
109 Find a free inode and allocate it. If present,
111 specifies the inode number of the directory
112 which the inode is to be located. The second
115 specifies the permissions of the new inode. (If the directory bit is set
116 on the mode, the allocation routine will function differently.)
119 Mark the block number
124 Free the inode specified by
128 Print a list of commands understood by
132 Print a listing of the inodes which use the one or more blocks specified
135 .I initialize device blocksize
136 Create an ext2 file system on
140 Note that this does not fully initialize all of the data structures;
143 program. This is just a call to the low-level library, which sets up
144 the superblock and block descriptors.
146 .I kill_file filespec
149 and its blocks. Note that this does not remove any directory
150 entries (if any) to this inode. See the
152 command if you wish to unlink a file.
154 .I ln filespec dest_file
159 Note this does not adjust the inode reference counts.
162 Print a listing of the files in the directory
165 .I modify_inode filespec
166 Modify the contents of the inode structure in the inode
172 .I mknod filespec [p|[[c|b] major minor]]
173 Create a special device file (a named pipe, character or block device).
174 If a character or block device is to be made, the
178 device numbers must be specified.
180 .I ncheck inode_num ...
181 Take the requested list of inode numbers, and print a listing of pathnames
185 Open a file system for editing.
188 Print the current working directory.
197 If this causes the inode pointed to by
199 to have no other references, deallocate the file. This command functions
200 as the unlink() system call.
206 This function is currently not implemented.
209 Mark the block number
216 as in use in the inode bitmap.
219 List the contents of the super block.
222 Display the contents of the inode structure of the inode
226 Test if the block number
228 is marked as allocated in the block bitmap.
233 is marked as allocated in the inode bitmap.
236 Remove the link specified by
238 to an inode. Note this does not adjust the inode reference counts.
240 .I write source_file out_file
241 Create a file in the filesystem named
243 and copy the contents of
245 into the destination file.
251 as an argument to specify an inode (as opposed to a pathname)
252 in the filesystem which is currently opened by
256 argument may be specified in two forms. The first form is an inode
257 number surrounded by angle brackets, e.g.,
259 The second form is a pathname; if the pathname is prefixed by a forward slash
260 ('/'), then it is interpreted relative to the root of the filesystem
261 which is currently opened by
263 If not, the pathname is
264 interpreted relative to the current working directory as maintained by
266 This may be modified by using the
272 was written by Theodore Ts'o <tytso@mit.edu>.