Whamcloud - gitweb
Remove default sizeof sizes in configure script when cross-compiling
[tools/e2fsprogs.git] / debugfs / debugfs.8.in
index f51f8fe..81b411e 100644 (file)
@@ -4,10 +4,13 @@
 .\" 
 .TH DEBUGFS 8 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@"
 .SH NAME
-debugfs \- ext2 file system debugger
+debugfs \- ext2/ext3 file system debugger
 .SH SYNOPSIS
 .B debugfs
 [
+.B \-Vwci
+]
+[
 .B \-b
 blocksize
 ]
@@ -24,22 +27,12 @@ cmd_file
 request
 ]
 [
-.B \-V
-]
-[
-[
-.B \-w
-]
-[
-.B \-c
-]
-[
-.B \-i
+.B \-d
+data_source_device
 ]
 [
 device
 ]
-]
 .SH DESCRIPTION
 The 
 .B debugfs 
@@ -76,10 +69,22 @@ no safety checks are in place, and
 .B debugfs 
 may fail in interesting ways if commands such as
 .IR ls ", " dump ", " 
-etc. are tried.  
+etc. are tried without specifying the 
+.I data_source_device
+using the 
+.I \-d
+option.
 .B debugfs 
 is a debugging tool.  It has rough edges!
 .TP
+.I -d data_source_device
+Used with the 
+.I \-i
+option, specifies that
+.I data_source_device
+should be used when reading blocks not found in the ext2 image file.
+This includes data, directory, and indirect blocks.
+.TP
 .I -b blocksize
 Forces the use of the given block size for the file system, rather than
 detecting the correct block size as normal.
@@ -237,7 +242,7 @@ Print the location of the inode data structure (in the inode table)
 of the inode
 .IR filespec .
 .TP
-.I initialize device blocksize
+.I init_filesys device blocksize
 Create an ext2 file system on
 .I device
 with device size
@@ -270,8 +275,36 @@ which is a link to
 .IR filespec .
 Note this does not adjust the inode reference counts.
 .TP
-.I logdump [-ac] [-b<block>] [-i<inode>] [-f<journal_file>] [output_file]
-Dump the contents of the ext3 journal.
+.I logdump [-acs] [-b<block>] [-i<filespec>] [-f<journal_file>] [output_file]
+Dump the contents of the ext3 journal.  By default, the journal inode as
+specified in the superblock.  However, this can be overridden with the 
+.I \-i
+option, which uses an inode specifier to specify the journal to be
+used.  A file containing journal data can be specified using the
+.I \-f
+option.   Finally, the 
+.I \-s
+option utilizes the backup information in the superblock to locate the
+journal.
+.IP
+The 
+.I \-a
+option causes the 
+.I logdump
+program to print the contents of all of the descriptor blocks.
+The 
+.I \-b
+option causes 
+.I logdump
+to print all journal records that are refer to the specified block. 
+The 
+.I \-c
+option will print out the contents of all of the data blocks selected by
+the 
+.I \-a
+and 
+.I \-b
+options.
 .TP
 .I ls [-l] [-d] filespec
 Print a listing of the files in the directory
@@ -302,18 +335,17 @@ device numbers must be specified.
 Take the requested list of inode numbers, and print a listing of pathnames
 to those inodes.
 .TP
-.I open [-w] [-f] [-i] [-c] [-b blocksize] [-s superblock] device
+.I open [-w] [-e] [-f] [-i] [-c] [-b blocksize] [-s superblock] device
 Open a filesystem for editing.  The 
-.I -w 
-flag causes the filesystem to be opened for writing.  The 
 .I -f 
 flag forces the filesystem to be opened even if there are some unknown 
 or incompatible filesystem features which would normally 
 prevent the filesystem from being opened.  The
-.IR -c ", " -b ", " -i ", " and " -s
-options behave the same as those to
-.B debugfs
-itself.
+.I -e
+flag causes the filesystem to be opened in exclusive mode.  The
+.IR -b ", " -c ", " -i ", " -s ", and " -w
+options behave the same as the command-line options to 
+.BR debugfs .
 .TP
 .I pwd
 Print the current working directory.
@@ -355,11 +387,30 @@ blocks starting at block number
 .I block
 will be marked as allocated.
 .TP
+.I set_block_group bgnum field value
+Modify the block group descriptor specified by
+.I bgnum
+so that the block group descriptor field
+.I field
+has value
+.I value.
+.TP
 .I seti filespec
 Mark inode 
 .I filespec
 as in use in the inode bitmap.
 .TP
+.I set_inode_field filespec field value
+Modify the inode specified by 
+.I filespec
+so that the inode field
+.I field
+has value 
+.I value.
+The list of valid inode fields which can be set via this command 
+can be displayed by using the command:
+.B set_inode_field -l
+.TP
 .I set_super_value field value
 Set the superblock field
 .I field
@@ -395,6 +446,27 @@ Test if the inode
 .I filespec
 is marked as allocated in the inode bitmap.
 .TP
+.I undel <inode num> [pathname]
+Undelete the specified inode number (which must be surrounded by angle
+brackets) so that it and its blocks are marked in use, and optionally
+link the recovered inode to the specified pathname.  The 
+.B e2fsck
+command should always be run after using the 
+.B undel
+command to recover deleted files.
+.IP
+Note that if you are recovering a large number of deleted files, linking
+the inode to a directory may require the directory to be expanded, which
+could allocate a block that had been used by one of the
+yet-to-be-undeleted files.  So it is safer to undelete all of the 
+inodes without specifying a destination pathname, and then in a separate
+pass, use the debugfs
+.B link
+command to link the inode to the destination pathname, or use 
+.B e2fsck
+to check the filesystem and link all of the recovered inodes to the
+lost+found dirctory.
+.TP
 .I unlink pathname
 Remove the link specified by 
 .I pathname 
@@ -406,10 +478,41 @@ Create a file in the filesystem named
 and copy the contents of
 .I source_file
 into the destination file.
+.SH ENVIRONMENT VARIABLES
+.TP
+.B DEBUGFS_PAGER, PAGER
+The
+.BR debugfs (8)
+program always pipes the output of the some commands through a
+pager program.  These commands include: 
+.IR show_super_stats ,
+.IR list_directory ,
+.IR show_inode_info ,
+.IR list_deleted_inodes ,
+and
+.IR htree_dump .
+The specific pager can explicitly specified by the
+.B DEBUGFS_PAGER
+environment variable, and if it is not set, by the
+.B PAGER
+environment variable.  
+.IP
+Note that since a pager is always used, the 
+.BR less (1)
+pager is not particularly appropriate, since it clears the screen before
+displaying the output of the command and clears the output the screen
+when the pager is exited.  Many users prefer to use the 
+.BR less (1)
+pager for most purposes, which is why the 
+.B DEBUGFS_PAGER 
+environment variable is available to override the more general
+.B PAGER
+environment variable.
 .SH AUTHOR
 .B debugfs
 was written by Theodore Ts'o <tytso@mit.edu>.
 .SH SEE ALSO
 .BR dumpe2fs (8),
+.BR tune2fs (8),
 .BR e2fsck (8),
 .BR mke2fs (8)