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
47 is a file system debugger. It can be used to examine and change the
48 state of an ext2 file system.
51 is the special file corresponding to the device containing the ext2
52 file system (e.g /dev/hdXX).
56 Specifies that the file system should be opened in read-write mode.
57 Without this option, the file system is opened in read-only mode.
60 Specifies that the file system should be opened in catastrophic mode, in
61 which the inode and group bitmaps are not read initially. This can be
62 useful for filesystems with significant corruption, but because of this,
63 catastrophic mode forces the filesystem to be opened read-only.
68 represents an ext2 image file created by the
70 program. Since the ext2 image file only contains the superblock, block
71 group descriptor, block and inode allocation bitmaps, and
74 commands will not function properly.
76 no safety checks are in place, and
78 may fail in interesting ways if commands such as
82 is a debugging tool. It has rough edges!
85 Forces the use of the given block size for the file system, rather than
86 detecting the correct block size as normal.
89 Causes the file system superblock to be read from the given block number,
90 rather than the default (1). If you give a
92 option, you must also give a
99 to read in commands from
101 and execute them. When
103 is finished executing those commands, it will exit.
108 to execute the single command
113 print the version number of
118 is an interactive debugger. It understands a number of commands.
121 Dump the contents of the inode
126 Change the current working directory to
130 Change the root directory to be the directory
134 Close the currently open file system.
137 Clear the contents of the inode
140 .I dump [-p] filspec out_file
141 Dump the contents of the inode
147 option is given set the owner, group and permissions information on
152 .I expand_dir filespec
156 .I feature [fs_feature] [-fs_feature] ...
157 Set or clear various filesystem features in the superblock. After setting
158 or clearing any filesystem features that were requested, print the current
159 state of the filesystem feature set.
161 .I find_free_block [goal]
162 Find the first free block, starting from
166 .I find_free_inode [dir [mode]]
167 Find a free inode and allocate it. If present,
169 specifies the inode number of the directory
170 which the inode is to be located. The second
173 specifies the permissions of the new inode. (If the directory bit is set
174 on the mode, the allocation routine will function differently.)
177 Mark the block number
182 Free the inode specified by
186 Print a list of commands understood by
190 Print a listing of the inodes which use the one or more blocks specified
193 .I initialize device blocksize
194 Create an ext2 file system on
198 Note that this does not fully initialize all of the data structures;
201 program. This is just a call to the low-level library, which sets up
202 the superblock and block descriptors.
204 .I kill_file filespec
207 and its blocks. Note that this does not remove any directory
208 entries (if any) to this inode. See the
210 command if you wish to unlink a file.
212 .I ln filespec dest_file
217 Note this does not adjust the inode reference counts.
220 Print a listing of the files in the directory
223 .I modify_inode filespec
224 Modify the contents of the inode structure in the inode
230 .I mknod filespec [p|[[c|b] major minor]]
231 Create a special device file (a named pipe, character or block device).
232 If a character or block device is to be made, the
236 device numbers must be specified.
238 .I ncheck inode_num ...
239 Take the requested list of inode numbers, and print a listing of pathnames
242 .I open [-w] [-f] [-i] [-c] [-b blocksize] [-s superblock] device
243 Open a filesystem for editing. The
245 flag causes the filesystem to be opened for writing. The
247 flag forces the filesystem to be opened even if there are some unknown
248 or incompatible filesystem features which would normally
249 prevent the filesystem from being opened. The
250 .IR -c ", " -b ", " -i ", " and " -s
251 options behave the same as those to
256 Print the current working directory.
265 If this causes the inode pointed to by
267 to have no other references, deallocate the file. This command functions
268 as the unlink() system call.
274 This function is currently not implemented.
277 Mark the block number
284 as in use in the inode bitmap.
286 .I show_super_stats [-h]
287 List the contents of the super block and the block group descriptors. If the
289 flag is given, only print out the superblock contents.
292 Display the contents of the inode structure of the inode
296 Test if the block number
298 is marked as allocated in the block bitmap.
303 is marked as allocated in the inode bitmap.
306 Remove the link specified by
308 to an inode. Note this does not adjust the inode reference counts.
310 .I write source_file out_file
311 Create a file in the filesystem named
313 and copy the contents of
315 into the destination file.
318 Change the current working directory of the
322 on the native filesystem.
324 .I rdump directory destination
327 and all its contents (including regular files, symbolic links, and other
328 directories) into the named
330 which should be an existing directory on the native filesystem.
336 as an argument to specify an inode (as opposed to a pathname)
337 in the filesystem which is currently opened by
341 argument may be specified in two forms. The first form is an inode
342 number surrounded by angle brackets, e.g.,
344 The second form is a pathname; if the pathname is prefixed by a forward slash
345 ('/'), then it is interpreted relative to the root of the filesystem
346 which is currently opened by
348 If not, the pathname is
349 interpreted relative to the current working directory as maintained by
351 This may be modified by using the
357 was written by Theodore Ts'o <tytso@mit.edu>.