1997-04-26 17:21:57 +04:00
|
|
|
.\" -*- nroff -*-
|
1997-04-26 17:58:21 +04:00
|
|
|
.\" Copyright 1993, 1994, 1995 by Theodore Ts'o. All Rights Reserved.
|
|
|
|
.\" This file may be copied under the terms of the GNU Public License.
|
2013-12-16 07:12:43 +04:00
|
|
|
.\"
|
1997-04-26 18:37:06 +04:00
|
|
|
.TH DEBUGFS 8 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@"
|
1997-04-26 17:21:57 +04:00
|
|
|
.SH NAME
|
2009-05-30 20:34:28 +04:00
|
|
|
debugfs \- ext2/ext3/ext4 file system debugger
|
1997-04-26 17:21:57 +04:00
|
|
|
.SH SYNOPSIS
|
|
|
|
.B debugfs
|
|
|
|
[
|
2012-07-31 01:46:15 +04:00
|
|
|
.B \-DVwcin
|
2004-07-29 05:11:48 +04:00
|
|
|
]
|
|
|
|
[
|
ChangeLog, debug_cmds.ct, debugfs.8.in, debugfs.c, dump.c, ls.c:
debugfs.8.in: Documented new behaviour.
ls.c (ls_l_file): Fix Y2K bug -- was printing 22-May-100 for recent
files. Switched to 4-digit years.
dump.c, debug_cmds.ct (do_rdump): Add new debugfs command "rdump",
which recursively dumps a directory and its contents.
(fix_perms): New function. Break permission-fixing code out of
dump_file() so it can be called by rdump code as well.
(dump_file): Call fix_perms().
debugfs.c, debug_cmds.ct (do_lcd): Add new debugfs command "lcd",
which changes the cwd on the native filesystem.
debugfs.c (open_filesystem): Extra args for superblock, blocksize, and
catastrophic mode. Changed callers.
(do_open_filesys, main): Accept new -b, -s, -c options for
open_filesystem.
ChangeLog, mkdir.c:
mkdir.c (ext2fs_mkdir): Read the parent directory's inode earlier, so
that if there's an error reading it, we can more cleanly back out of
the operation.
version.h:
Update version file for WIP release.
2000-05-27 19:15:40 +04:00
|
|
|
.B \-b
|
|
|
|
blocksize
|
|
|
|
]
|
|
|
|
[
|
|
|
|
.B \-s
|
|
|
|
superblock
|
|
|
|
]
|
|
|
|
[
|
2013-12-16 07:12:43 +04:00
|
|
|
.B \-f
|
1997-04-29 18:51:31 +04:00
|
|
|
cmd_file
|
|
|
|
]
|
|
|
|
[
|
|
|
|
.B \-R
|
|
|
|
request
|
|
|
|
]
|
|
|
|
[
|
2004-07-29 05:11:48 +04:00
|
|
|
.B \-d
|
|
|
|
data_source_device
|
2001-05-03 19:05:55 +04:00
|
|
|
]
|
|
|
|
[
|
2015-05-05 17:41:52 +03:00
|
|
|
.B \-z
|
|
|
|
.I undo_file
|
|
|
|
]
|
|
|
|
[
|
1997-04-26 17:21:57 +04:00
|
|
|
device
|
|
|
|
]
|
|
|
|
.SH DESCRIPTION
|
2013-12-16 07:12:43 +04:00
|
|
|
The
|
|
|
|
.B debugfs
|
2001-11-25 00:10:52 +03:00
|
|
|
program is an interactive file system debugger. It can be used to
|
2009-05-30 20:34:28 +04:00
|
|
|
examine and change the state of an ext2, ext3, or ext4 file system.
|
1997-04-26 17:21:57 +04:00
|
|
|
.br
|
|
|
|
.I device
|
2009-05-30 20:34:28 +04:00
|
|
|
is the special file corresponding to the device containing the
|
1997-04-26 17:21:57 +04:00
|
|
|
file system (e.g /dev/hdXX).
|
|
|
|
.SH OPTIONS
|
|
|
|
.TP
|
2001-05-03 19:05:55 +04:00
|
|
|
.I \-w
|
1997-05-09 07:06:31 +04:00
|
|
|
Specifies that the file system should be opened in read-write mode.
|
|
|
|
Without this option, the file system is opened in read-only mode.
|
1997-04-29 18:51:31 +04:00
|
|
|
.TP
|
2012-07-31 01:46:15 +04:00
|
|
|
.I \-n
|
|
|
|
Disables metadata checksum verification. This should only be used if
|
|
|
|
you believe the metadata to be correct despite the complaints of
|
|
|
|
e2fsprogs.
|
|
|
|
.TP
|
2001-05-03 19:05:55 +04:00
|
|
|
.I \-c
|
ChangeLog, debug_cmds.ct, debugfs.8.in, debugfs.c, dump.c, ls.c:
debugfs.8.in: Documented new behaviour.
ls.c (ls_l_file): Fix Y2K bug -- was printing 22-May-100 for recent
files. Switched to 4-digit years.
dump.c, debug_cmds.ct (do_rdump): Add new debugfs command "rdump",
which recursively dumps a directory and its contents.
(fix_perms): New function. Break permission-fixing code out of
dump_file() so it can be called by rdump code as well.
(dump_file): Call fix_perms().
debugfs.c, debug_cmds.ct (do_lcd): Add new debugfs command "lcd",
which changes the cwd on the native filesystem.
debugfs.c (open_filesystem): Extra args for superblock, blocksize, and
catastrophic mode. Changed callers.
(do_open_filesys, main): Accept new -b, -s, -c options for
open_filesystem.
ChangeLog, mkdir.c:
mkdir.c (ext2fs_mkdir): Read the parent directory's inode earlier, so
that if there's an error reading it, we can more cleanly back out of
the operation.
version.h:
Update version file for WIP release.
2000-05-27 19:15:40 +04:00
|
|
|
Specifies that the file system should be opened in catastrophic mode, in
|
|
|
|
which the inode and group bitmaps are not read initially. This can be
|
|
|
|
useful for filesystems with significant corruption, but because of this,
|
|
|
|
catastrophic mode forces the filesystem to be opened read-only.
|
|
|
|
.TP
|
2001-05-03 19:05:55 +04:00
|
|
|
.I \-i
|
2013-12-16 07:12:43 +04:00
|
|
|
Specifies that
|
2001-05-03 19:05:55 +04:00
|
|
|
.I device
|
|
|
|
represents an ext2 image file created by the
|
|
|
|
.B e2image
|
|
|
|
program. Since the ext2 image file only contains the superblock, block
|
2013-12-16 07:12:43 +04:00
|
|
|
group descriptor, block and inode allocation bitmaps, and
|
2001-05-03 19:05:55 +04:00
|
|
|
the inode table, many
|
|
|
|
.B debugfs
|
2013-12-16 07:12:43 +04:00
|
|
|
commands will not function properly.
|
2001-05-03 19:05:55 +04:00
|
|
|
.B Warning:
|
2013-12-16 07:12:43 +04:00
|
|
|
no safety checks are in place, and
|
|
|
|
.B debugfs
|
2001-05-03 19:05:55 +04:00
|
|
|
may fail in interesting ways if commands such as
|
2013-12-16 07:12:43 +04:00
|
|
|
.IR ls ", " dump ", "
|
|
|
|
etc. are tried without specifying the
|
2004-07-29 05:11:48 +04:00
|
|
|
.I data_source_device
|
2013-12-16 07:12:43 +04:00
|
|
|
using the
|
2004-07-29 05:11:48 +04:00
|
|
|
.I \-d
|
|
|
|
option.
|
2013-12-16 07:12:43 +04:00
|
|
|
.B debugfs
|
2001-05-03 19:05:55 +04:00
|
|
|
is a debugging tool. It has rough edges!
|
|
|
|
.TP
|
2004-07-29 05:11:48 +04:00
|
|
|
.I -d data_source_device
|
2013-12-16 07:12:43 +04:00
|
|
|
Used with the
|
2004-07-29 05:11:48 +04:00
|
|
|
.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
|
ChangeLog, debug_cmds.ct, debugfs.8.in, debugfs.c, dump.c, ls.c:
debugfs.8.in: Documented new behaviour.
ls.c (ls_l_file): Fix Y2K bug -- was printing 22-May-100 for recent
files. Switched to 4-digit years.
dump.c, debug_cmds.ct (do_rdump): Add new debugfs command "rdump",
which recursively dumps a directory and its contents.
(fix_perms): New function. Break permission-fixing code out of
dump_file() so it can be called by rdump code as well.
(dump_file): Call fix_perms().
debugfs.c, debug_cmds.ct (do_lcd): Add new debugfs command "lcd",
which changes the cwd on the native filesystem.
debugfs.c (open_filesystem): Extra args for superblock, blocksize, and
catastrophic mode. Changed callers.
(do_open_filesys, main): Accept new -b, -s, -c options for
open_filesystem.
ChangeLog, mkdir.c:
mkdir.c (ext2fs_mkdir): Read the parent directory's inode earlier, so
that if there's an error reading it, we can more cleanly back out of
the operation.
version.h:
Update version file for WIP release.
2000-05-27 19:15:40 +04:00
|
|
|
.I -b blocksize
|
|
|
|
Forces the use of the given block size for the file system, rather than
|
|
|
|
detecting the correct block size as normal.
|
|
|
|
.TP
|
|
|
|
.I -s superblock
|
2008-06-18 05:55:38 +04:00
|
|
|
Causes the file system superblock to be read from the given block
|
|
|
|
number, instead of using the primary superblock (located at an offset of
|
|
|
|
1024 bytes from the beginning of the filesystem). If you specify the
|
ChangeLog, debug_cmds.ct, debugfs.8.in, debugfs.c, dump.c, ls.c:
debugfs.8.in: Documented new behaviour.
ls.c (ls_l_file): Fix Y2K bug -- was printing 22-May-100 for recent
files. Switched to 4-digit years.
dump.c, debug_cmds.ct (do_rdump): Add new debugfs command "rdump",
which recursively dumps a directory and its contents.
(fix_perms): New function. Break permission-fixing code out of
dump_file() so it can be called by rdump code as well.
(dump_file): Call fix_perms().
debugfs.c, debug_cmds.ct (do_lcd): Add new debugfs command "lcd",
which changes the cwd on the native filesystem.
debugfs.c (open_filesystem): Extra args for superblock, blocksize, and
catastrophic mode. Changed callers.
(do_open_filesys, main): Accept new -b, -s, -c options for
open_filesystem.
ChangeLog, mkdir.c:
mkdir.c (ext2fs_mkdir): Read the parent directory's inode earlier, so
that if there's an error reading it, we can more cleanly back out of
the operation.
version.h:
Update version file for WIP release.
2000-05-27 19:15:40 +04:00
|
|
|
.I -s
|
2008-06-18 05:55:38 +04:00
|
|
|
option, you must also provide the blocksize of the filesystem via the
|
ChangeLog, debug_cmds.ct, debugfs.8.in, debugfs.c, dump.c, ls.c:
debugfs.8.in: Documented new behaviour.
ls.c (ls_l_file): Fix Y2K bug -- was printing 22-May-100 for recent
files. Switched to 4-digit years.
dump.c, debug_cmds.ct (do_rdump): Add new debugfs command "rdump",
which recursively dumps a directory and its contents.
(fix_perms): New function. Break permission-fixing code out of
dump_file() so it can be called by rdump code as well.
(dump_file): Call fix_perms().
debugfs.c, debug_cmds.ct (do_lcd): Add new debugfs command "lcd",
which changes the cwd on the native filesystem.
debugfs.c (open_filesystem): Extra args for superblock, blocksize, and
catastrophic mode. Changed callers.
(do_open_filesys, main): Accept new -b, -s, -c options for
open_filesystem.
ChangeLog, mkdir.c:
mkdir.c (ext2fs_mkdir): Read the parent directory's inode earlier, so
that if there's an error reading it, we can more cleanly back out of
the operation.
version.h:
Update version file for WIP release.
2000-05-27 19:15:40 +04:00
|
|
|
.I -b
|
|
|
|
option.
|
|
|
|
.TP
|
1997-04-29 18:51:31 +04:00
|
|
|
.I -f cmd_file
|
2013-12-16 07:12:43 +04:00
|
|
|
Causes
|
1997-04-29 18:51:31 +04:00
|
|
|
.B debugfs
|
2013-12-16 07:12:43 +04:00
|
|
|
to read in commands from
|
|
|
|
.IR cmd_file ,
|
|
|
|
and execute them. When
|
1997-04-29 18:51:31 +04:00
|
|
|
.B debugfs
|
1997-05-09 07:06:31 +04:00
|
|
|
is finished executing those commands, it will exit.
|
2010-09-24 18:12:54 +04:00
|
|
|
.TP
|
|
|
|
.I -D
|
|
|
|
Causes
|
|
|
|
.B debugfs
|
|
|
|
to open the device using Direct I/O, bypassing the buffer cache. Note
|
|
|
|
that some Linux devices, notably device mapper as of this writing, do
|
|
|
|
not support Direct I/O.
|
|
|
|
.TP
|
1997-04-29 18:51:31 +04:00
|
|
|
.I -R request
|
2013-12-16 07:12:43 +04:00
|
|
|
Causes
|
1997-04-29 18:51:31 +04:00
|
|
|
.B debugfs
|
2013-12-16 07:12:43 +04:00
|
|
|
to execute the single command
|
1997-04-29 18:51:31 +04:00
|
|
|
.IR request ,
|
|
|
|
and then exit.
|
ChangeLog, debugfs.8.in, debugfs.c:
Add a -V option which displays the current version.
ChangeLog, unix.c:
unix.c (e2fsck_update_progress): Remove unused variables.
ChangeLog, inode.c:
inode.c (get_next_blockgroup): Fix bug where if get_next_blockgroup()
is called early because of a missing inode table in a block group, the
current_inode counter wasn't incremented correctly.
ChangeLog, tst_uuid.c:
tst_uuid.c (main): Fixed bogus declaration of the main's argv parameter.
ChangeLog, test_icount.c:
test_icount.c (main): Fix main() declaration so that it returns int,
not void.
Many files:
fsck.c (ignore): Remove unused variable cp.
chattr.c (fatal_error):
tune2fs.c (usage):
lsattr.c (usage):
dumpe2fs.c (usage):
badblocks.c (usage): Remove volatile from declaration.
fsck.c: Change use of strdup to be string_copy, since we don't trust
what glibc is doing with strdup. (Whatever it is, it isn't pretty.)
1998-06-27 09:11:14 +04:00
|
|
|
.TP
|
|
|
|
.I -V
|
2013-12-16 07:12:43 +04:00
|
|
|
print the version number of
|
ChangeLog, debugfs.8.in, debugfs.c:
Add a -V option which displays the current version.
ChangeLog, unix.c:
unix.c (e2fsck_update_progress): Remove unused variables.
ChangeLog, inode.c:
inode.c (get_next_blockgroup): Fix bug where if get_next_blockgroup()
is called early because of a missing inode table in a block group, the
current_inode counter wasn't incremented correctly.
ChangeLog, tst_uuid.c:
tst_uuid.c (main): Fixed bogus declaration of the main's argv parameter.
ChangeLog, test_icount.c:
test_icount.c (main): Fix main() declaration so that it returns int,
not void.
Many files:
fsck.c (ignore): Remove unused variable cp.
chattr.c (fatal_error):
tune2fs.c (usage):
lsattr.c (usage):
dumpe2fs.c (usage):
badblocks.c (usage): Remove volatile from declaration.
fsck.c: Change use of strdup to be string_copy, since we don't trust
what glibc is doing with strdup. (Whatever it is, it isn't pretty.)
1998-06-27 09:11:14 +04:00
|
|
|
.B debugfs
|
|
|
|
and exit.
|
2015-05-05 17:41:52 +03:00
|
|
|
.TP
|
|
|
|
.BI \-z " undo_file"
|
|
|
|
Before overwriting a file system block, write the old contents of the block to
|
|
|
|
an undo file. This undo file can be used with e2undo(8) to restore the old
|
|
|
|
contents of the file system should something go wrong. If the empty string is
|
|
|
|
passed as the undo_file argument, the undo file will be written to a file named
|
|
|
|
resize2fs-\fIdevice\fR.e2undo in the directory specified via the
|
|
|
|
\fIE2FSPROGS_UNDO_DIR\fR environment variable.
|
|
|
|
|
|
|
|
WARNING: The undo file cannot be used to recover from a power or system crash.
|
2001-11-25 00:10:52 +03:00
|
|
|
.SH SPECIFYING FILES
|
|
|
|
Many
|
|
|
|
.B debugfs
|
|
|
|
commands take a
|
|
|
|
.I filespec
|
2013-12-16 07:12:43 +04:00
|
|
|
as an argument to specify an inode (as opposed to a pathname)
|
|
|
|
in the filesystem which is currently opened by
|
|
|
|
.BR debugfs .
|
2001-11-25 00:10:52 +03:00
|
|
|
The
|
|
|
|
.I filespec
|
2013-12-16 07:12:43 +04:00
|
|
|
argument may be specified in two forms. The first form is an inode
|
|
|
|
number surrounded by angle brackets, e.g.,
|
2001-11-25 00:10:52 +03:00
|
|
|
.IR <2> .
|
|
|
|
The second form is a pathname; if the pathname is prefixed by a forward slash
|
2013-12-16 07:12:43 +04:00
|
|
|
('/'), then it is interpreted relative to the root of the filesystem
|
|
|
|
which is currently opened by
|
|
|
|
.BR debugfs .
|
|
|
|
If not, the pathname is
|
|
|
|
interpreted relative to the current working directory as maintained by
|
2001-11-25 00:10:52 +03:00
|
|
|
.BR debugfs .
|
2013-12-16 07:12:43 +04:00
|
|
|
This may be modified by using the
|
2001-11-25 00:10:52 +03:00
|
|
|
.B debugfs
|
|
|
|
command
|
|
|
|
.IR cd .
|
2013-12-16 07:12:43 +04:00
|
|
|
.\"
|
2001-11-25 00:10:52 +03:00
|
|
|
.\"
|
|
|
|
.\"
|
1997-04-26 17:21:57 +04:00
|
|
|
.SH COMMANDS
|
2013-12-16 07:12:43 +04:00
|
|
|
This is a list of the commands which
|
1997-04-26 17:21:57 +04:00
|
|
|
.B debugfs
|
2001-11-25 00:10:52 +03:00
|
|
|
supports.
|
1997-04-26 17:21:57 +04:00
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.BI blocks " filespace"
|
2011-07-09 20:13:40 +04:00
|
|
|
Print the blocks used by the inode
|
|
|
|
.I filespec
|
|
|
|
to stdout.
|
|
|
|
.TP
|
2014-10-13 19:59:30 +04:00
|
|
|
.BI bmap " [ -a ] filespec logical_block [physical_block]"
|
|
|
|
Print or set the physical block number corresponding to the logical block number
|
2003-05-05 19:35:04 +04:00
|
|
|
.I logical_block
|
|
|
|
in the inode
|
|
|
|
.IR filespec .
|
2014-10-13 19:59:30 +04:00
|
|
|
If the
|
|
|
|
.I -a
|
|
|
|
flag is specified, try to allocate a block if necessary.
|
2003-05-05 19:35:04 +04:00
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.BI block_dump " [-f filespec] block_num"
|
|
|
|
Dump the filesystem block given by
|
|
|
|
.I block_num
|
|
|
|
in hex and ASCII format to the console. If the
|
|
|
|
.I -f
|
|
|
|
option is specified, the block number is relative to the start of the given
|
|
|
|
.BR filespec .
|
2013-01-11 11:40:25 +04:00
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.BI cat " filespec"
|
|
|
|
Dump the contents of the inode
|
1997-04-29 18:51:31 +04:00
|
|
|
.I filespec
|
|
|
|
to stdout.
|
1997-04-26 17:21:57 +04:00
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.BI cd " filespec"
|
|
|
|
Change the current working directory to
|
1997-04-29 18:51:31 +04:00
|
|
|
.IR filespec .
|
1997-04-26 17:58:21 +04:00
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.BI chroot " filespec"
|
|
|
|
Change the root directory to be the directory
|
1997-04-29 18:51:31 +04:00
|
|
|
.IR filespec .
|
1997-04-26 17:21:57 +04:00
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.BI close " [-a]"
|
|
|
|
Close the currently open file system. If the
|
2009-05-29 06:03:33 +04:00
|
|
|
.I -a
|
|
|
|
option is specified, write out any changes to the superblock and block
|
|
|
|
group descriptors to all of the backup superblocks, not just to the
|
|
|
|
master superblock.
|
1997-04-26 17:21:57 +04:00
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.BI clri " filespec"
|
|
|
|
Clear the contents of the inode
|
|
|
|
.IR filespec .
|
1997-04-29 18:51:31 +04:00
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.BI dirsearch " filespec filename"
|
2011-05-11 20:49:07 +04:00
|
|
|
Search the directory
|
|
|
|
.I filespec
|
|
|
|
for
|
|
|
|
.IR filename .
|
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.B dirty
|
|
|
|
Mark the filesystem as dirty, so that the superblocks will be written on exit.
|
|
|
|
.TP
|
|
|
|
.BI dump " [-p] filespec out_file"
|
|
|
|
Dump the contents of the inode
|
1997-04-29 18:51:31 +04:00
|
|
|
.I filespec
|
2013-12-16 07:12:43 +04:00
|
|
|
to the output file
|
|
|
|
.IR out_file .
|
|
|
|
If the
|
|
|
|
.I -p
|
|
|
|
option is given set the owner, group and permissions information on
|
|
|
|
.I out_file
|
|
|
|
to match
|
1997-04-29 18:51:31 +04:00
|
|
|
.IR filespec .
|
|
|
|
.TP
|
2016-03-06 03:38:32 +03:00
|
|
|
.BI dump_mmp " [mmp_block]"
|
|
|
|
Display the multiple-mount protection (mmp) field values. If
|
|
|
|
.I mmp_block
|
|
|
|
is specified then verify and dump the MMP values from the given block
|
|
|
|
number, otherwise use the
|
|
|
|
.B s_mmp_block
|
|
|
|
field in the superblock to locate and use the existing MMP block.
|
2011-11-12 06:06:04 +04:00
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.BI dx_hash " [-h hash_alg] [-s hash_seed] filename"
|
2011-05-11 20:49:07 +04:00
|
|
|
Calculate the directory hash of
|
|
|
|
.IR filename .
|
|
|
|
The hash algorithm specified with
|
|
|
|
.I -h
|
2013-12-16 07:12:43 +04:00
|
|
|
may be
|
|
|
|
.BR legacy , " half_md4" ", or " tea .
|
2011-05-11 20:49:07 +04:00
|
|
|
The hash seed specified with
|
|
|
|
.I -s
|
|
|
|
must be in UUID format.
|
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.BI dump_extents " [-n] [-l] filespec"
|
2009-07-27 06:29:47 +04:00
|
|
|
Dump the the extent tree of the inode
|
|
|
|
.IR filespec .
|
2013-12-16 07:12:43 +04:00
|
|
|
The
|
2009-07-27 06:29:47 +04:00
|
|
|
.I -n
|
|
|
|
flag will cause
|
2013-12-16 07:12:43 +04:00
|
|
|
.B dump_extents
|
2009-07-27 06:29:47 +04:00
|
|
|
to only display the interior nodes in the extent tree. The
|
2013-12-16 07:12:43 +04:00
|
|
|
.I -l
|
|
|
|
flag will cause
|
|
|
|
.B dump_extents
|
2009-07-27 06:29:47 +04:00
|
|
|
to only display the leaf nodes in the extent tree.
|
|
|
|
.IP
|
|
|
|
(Please note that the length and range of blocks for the last extent in
|
|
|
|
an interior node is an estimate by the extents library functions, and is
|
2011-03-10 19:09:35 +03:00
|
|
|
not stored in filesystem data structures. Hence, the values displayed
|
2013-12-16 07:12:43 +04:00
|
|
|
may not necessarily by accurate and does not indicate a problem or
|
2009-07-27 06:29:47 +04:00
|
|
|
corruption in the file system.)
|
|
|
|
.TP
|
2015-01-27 18:56:34 +03:00
|
|
|
.BI ea_get " [-f outfile] filespec attr_name"
|
|
|
|
Retrieve the value of the extended attribute
|
|
|
|
.I attr_name
|
|
|
|
in the file
|
|
|
|
.I filespec
|
|
|
|
and write it either to stdout or to \fIoutfile\fR.
|
|
|
|
.TP
|
|
|
|
.BI ea_list " filespec
|
|
|
|
List the extended attributes associated with the file
|
|
|
|
.I filespec
|
|
|
|
to standard output.
|
|
|
|
.TP
|
|
|
|
.BI ea_set " [-f infile] filespec attr_name attr_value
|
|
|
|
Set the value of the extended attribute
|
|
|
|
.I attr_name
|
|
|
|
in the file
|
|
|
|
.I filespec
|
|
|
|
to the string value
|
|
|
|
.I attr_value
|
|
|
|
or read it from \fIinfile\fR.
|
|
|
|
.TP
|
|
|
|
.BI ea_rm " filespec attr_names...
|
|
|
|
Remove the extended attribute
|
|
|
|
.I attr_name
|
|
|
|
from the file \fIfilespec\fR.
|
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.BI expand_dir " filespec"
|
1997-04-29 18:51:31 +04:00
|
|
|
Expand the directory
|
|
|
|
.IR filespec .
|
1997-04-26 17:21:57 +04:00
|
|
|
.TP
|
2015-06-11 03:01:24 +03:00
|
|
|
.BI fallocate " filespec start_block [end_block]
|
|
|
|
Allocate and map uninitialized blocks into \fIfilespec\fR between
|
|
|
|
logical block \fIstart_block\fR and \fIend_block\fR, inclusive. If
|
|
|
|
\fIend_block\fR is not supplied, this function maps until it runs out
|
|
|
|
of free disk blocks or the maximum file size is reached. Existing
|
|
|
|
mappings are left alone.
|
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.BI feature " [fs_feature] [-fs_feature] ..."
|
1999-09-15 00:55:37 +04:00
|
|
|
Set or clear various filesystem features in the superblock. After setting
|
|
|
|
or clearing any filesystem features that were requested, print the current
|
|
|
|
state of the filesystem feature set.
|
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.BI filefrag " [-dvr] filespec"
|
2011-11-18 00:15:38 +04:00
|
|
|
Print the number of contiguous extents in
|
|
|
|
.IR filespec .
|
|
|
|
If
|
|
|
|
.I filespec
|
|
|
|
is a directory and the
|
|
|
|
.I -d
|
|
|
|
option is not specified,
|
|
|
|
.I filefrag
|
|
|
|
will print the number of contiguous extents for each file in
|
|
|
|
the directory. The
|
|
|
|
.I -v
|
|
|
|
option will cause
|
|
|
|
.I filefrag
|
|
|
|
print a tabular listing of the contiguous extents in the
|
|
|
|
file. The
|
|
|
|
.I -r
|
|
|
|
option will cause
|
|
|
|
.I filefrag
|
|
|
|
to do a recursive listing of the directory.
|
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.BI find_free_block " [count [goal]]"
|
|
|
|
Find the first
|
2002-01-03 12:55:25 +03:00
|
|
|
.I count
|
|
|
|
free blocks, starting from
|
1997-04-26 17:21:57 +04:00
|
|
|
.I goal
|
2013-12-16 07:12:43 +04:00
|
|
|
and allocate it. Also available as
|
|
|
|
.BR ffb .
|
1997-04-26 17:21:57 +04:00
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.BI find_free_inode " [dir [mode]]"
|
|
|
|
Find a free inode and allocate it. If present,
|
1997-04-29 18:51:31 +04:00
|
|
|
.I dir
|
2013-12-16 07:12:43 +04:00
|
|
|
specifies the inode number of the directory
|
|
|
|
which the inode is to be located. The second
|
1997-04-29 18:51:31 +04:00
|
|
|
optional argument
|
|
|
|
.I mode
|
|
|
|
specifies the permissions of the new inode. (If the directory bit is set
|
2013-12-16 07:12:43 +04:00
|
|
|
on the mode, the allocation routine will function differently.) Also
|
|
|
|
available as
|
|
|
|
.BR ffi .
|
1997-04-29 18:51:31 +04:00
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.BI freeb " block [count]"
|
1997-04-29 18:51:31 +04:00
|
|
|
Mark the block number
|
|
|
|
.I block
|
|
|
|
as not allocated.
|
2013-12-16 07:12:43 +04:00
|
|
|
If the optional argument
|
|
|
|
.I count
|
|
|
|
is present, then
|
2002-01-03 12:55:25 +03:00
|
|
|
.I count
|
|
|
|
blocks starting at block number
|
|
|
|
.I block
|
|
|
|
will be marked as not allocated.
|
1997-04-29 18:51:31 +04:00
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.BI freefrag " [-c chunk_kb]"
|
2011-11-15 08:31:24 +04:00
|
|
|
Report free space fragmentation on the currently open file system.
|
|
|
|
If the
|
|
|
|
.I \-c
|
|
|
|
option is specified then the filefrag command will print how many free
|
|
|
|
chunks of size
|
|
|
|
.I chunk_kb
|
|
|
|
can be found in the file system. The chunk size must be a power of two
|
|
|
|
and be larger than the file system block size.
|
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.BI freei " filespec [num]"
|
|
|
|
Free the inode specified by
|
1997-05-09 07:06:31 +04:00
|
|
|
.IR filespec .
|
2012-03-26 06:26:30 +04:00
|
|
|
If
|
|
|
|
.I num
|
|
|
|
is specified, also clear num-1 inodes after the specified inode.
|
1997-04-26 17:21:57 +04:00
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.B help
|
|
|
|
Print a list of commands understood by
|
2010-09-24 18:12:54 +04:00
|
|
|
.BR debugfs .
|
1997-04-26 17:58:21 +04:00
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.BI htree_dump " filespec"
|
2011-05-11 20:49:07 +04:00
|
|
|
Dump the hash-indexed directory
|
|
|
|
.IR filespec ,
|
|
|
|
showing its tree structure.
|
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.BI icheck " block ..."
|
1997-05-09 07:06:31 +04:00
|
|
|
Print a listing of the inodes which use the one or more blocks specified
|
1997-04-29 18:51:31 +04:00
|
|
|
on the command line.
|
1997-04-26 17:21:57 +04:00
|
|
|
.TP
|
2014-07-22 20:44:42 +04:00
|
|
|
.BI inode_dump " filespec"
|
|
|
|
Print the contents of the inode data structure in hex and ASCII format.
|
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.BI imap " filespec"
|
|
|
|
Print the location of the inode data structure (in the inode table)
|
2003-05-05 19:35:04 +04:00
|
|
|
of the inode
|
|
|
|
.IR filespec .
|
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.BI init_filesys " device blocksize"
|
1997-04-26 17:21:57 +04:00
|
|
|
Create an ext2 file system on
|
|
|
|
.I device
|
1997-04-29 18:51:31 +04:00
|
|
|
with device size
|
|
|
|
.IR blocksize .
|
2013-12-16 07:12:43 +04:00
|
|
|
Note that this does not fully initialize all of the data structures;
|
|
|
|
to do this, use the
|
1997-04-29 18:51:31 +04:00
|
|
|
.BR mke2fs (8)
|
|
|
|
program. This is just a call to the low-level library, which sets up
|
|
|
|
the superblock and block descriptors.
|
|
|
|
.TP
|
2015-01-27 18:56:34 +03:00
|
|
|
.BI journal_close
|
|
|
|
Close the open journal.
|
|
|
|
.TP
|
|
|
|
.BI journal_open " [-c] [-v ver] [-j ext_jnl]
|
|
|
|
Opens the journal for reading and writing. Journal checksumming can
|
|
|
|
be enabled by supplying \fI-c\fR; checksum formats 2 and 3 can be
|
|
|
|
selected with the \fI-v\fR option. An external journal can be loaded
|
|
|
|
from \fIext_jnl\fR.
|
|
|
|
.TP
|
|
|
|
.BI journal_run
|
|
|
|
Replay all transactions in the open journal.
|
|
|
|
.TP
|
|
|
|
.BI journal_write " [-b blocks] [-r revoke] [-c] file
|
|
|
|
Write a transaction to the open journal. The list of blocks to write
|
|
|
|
should be supplied as a comma-separated list in \fIblocks\fR; the
|
|
|
|
blocks themselves should be readable from \fIfile\fR. A list of
|
|
|
|
blocks to revoke can be supplied as a comma-separated list in
|
|
|
|
\fIrevoke\fR. By default, a commit record is written at the end; the
|
|
|
|
\fI-c\fR switch writes an uncommitted transaction.
|
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.BI kill_file " filespec"
|
|
|
|
Deallocate the inode
|
1997-04-29 18:51:31 +04:00
|
|
|
.I filespec
|
|
|
|
and its blocks. Note that this does not remove any directory
|
2013-12-16 07:12:43 +04:00
|
|
|
entries (if any) to this inode. See the
|
1997-05-09 07:06:31 +04:00
|
|
|
.BR rm (1)
|
1997-04-29 18:51:31 +04:00
|
|
|
command if you wish to unlink a file.
|
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.BI lcd " directory"
|
2001-11-25 00:10:52 +03:00
|
|
|
Change the current working directory of the
|
|
|
|
.B debugfs
|
|
|
|
process to
|
|
|
|
.I directory
|
|
|
|
on the native filesystem.
|
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.BI ln " filespec dest_file"
|
|
|
|
Create a link named
|
1997-04-29 18:51:31 +04:00
|
|
|
.I dest_file
|
2013-12-16 07:12:43 +04:00
|
|
|
which is a hard link to
|
1997-04-29 18:51:31 +04:00
|
|
|
.IR filespec .
|
|
|
|
Note this does not adjust the inode reference counts.
|
|
|
|
.TP
|
2014-05-02 03:13:02 +04:00
|
|
|
.BI logdump " [-acsO] [-b block] [-i filespec] [-f journal_file] [output_file]"
|
2013-12-16 07:12:43 +04:00
|
|
|
Dump the contents of the ext3 journal. By default, dump the journal inode as
|
|
|
|
specified in the superblock. However, this can be overridden with the
|
2003-08-21 08:40:26 +04:00
|
|
|
.I \-i
|
2013-12-16 07:12:43 +04:00
|
|
|
option, which dumps the journal from the internal inode given by
|
|
|
|
.IR filespec .
|
|
|
|
A regular file containing journal data can be specified using the
|
2003-08-21 08:40:26 +04:00
|
|
|
.I \-f
|
2013-12-16 07:12:43 +04:00
|
|
|
option. Finally, the
|
2003-08-21 08:40:26 +04:00
|
|
|
.I \-s
|
|
|
|
option utilizes the backup information in the superblock to locate the
|
|
|
|
journal.
|
|
|
|
.IP
|
2013-12-16 07:12:43 +04:00
|
|
|
The
|
2003-08-21 08:40:26 +04:00
|
|
|
.I \-a
|
2013-12-16 07:12:43 +04:00
|
|
|
option causes the
|
|
|
|
.B logdump
|
2003-08-21 08:40:26 +04:00
|
|
|
program to print the contents of all of the descriptor blocks.
|
2013-12-16 07:12:43 +04:00
|
|
|
The
|
2003-08-21 08:40:26 +04:00
|
|
|
.I \-b
|
2013-12-16 07:12:43 +04:00
|
|
|
option causes
|
|
|
|
.B logdump
|
|
|
|
to print all journal records that are refer to the specified block.
|
|
|
|
The
|
2003-08-21 08:40:26 +04:00
|
|
|
.I \-c
|
|
|
|
option will print out the contents of all of the data blocks selected by
|
2013-12-16 07:12:43 +04:00
|
|
|
the
|
2003-08-21 08:40:26 +04:00
|
|
|
.I \-a
|
2013-12-16 07:12:43 +04:00
|
|
|
and
|
2003-08-21 08:40:26 +04:00
|
|
|
.I \-b
|
|
|
|
options.
|
2014-05-02 03:13:02 +04:00
|
|
|
.IP
|
|
|
|
The
|
|
|
|
.I \-O
|
|
|
|
option causes logdump to display old (checkpointed) journal entries.
|
|
|
|
This can be used to try to track down journal problems even after the
|
|
|
|
journal has been replayed.
|
2001-11-25 00:10:52 +03:00
|
|
|
.TP
|
2015-03-09 01:04:04 +03:00
|
|
|
.BI ls " [-l] [-c] [-d] [-p] [-r] filespec"
|
1997-04-29 18:51:31 +04:00
|
|
|
Print a listing of the files in the directory
|
|
|
|
.IR filespec .
|
2002-01-03 12:55:25 +03:00
|
|
|
The
|
2012-10-14 14:34:09 +04:00
|
|
|
.I \-c
|
|
|
|
flag causes directory block checksums (if present) to be displayed.
|
|
|
|
The
|
2002-01-03 12:55:25 +03:00
|
|
|
.I \-d
|
|
|
|
flag will list deleted entries in the directory.
|
2013-12-16 07:12:43 +04:00
|
|
|
The
|
|
|
|
.I \-l
|
|
|
|
flag will list files using a more verbose format.
|
|
|
|
The
|
2008-01-04 23:28:51 +03:00
|
|
|
.I \-p
|
|
|
|
flag will list the files in a format which is more easily parsable by
|
|
|
|
scripts, as well as making it more clear when there are spaces or other
|
2008-09-07 22:08:40 +04:00
|
|
|
non-printing characters at the end of filenames.
|
2015-03-09 01:04:04 +03:00
|
|
|
The
|
|
|
|
.I \-r
|
|
|
|
flag will force the printing of the filename, even if it is encrypted.
|
1997-04-29 18:51:31 +04:00
|
|
|
.TP
|
2013-12-29 07:15:59 +04:00
|
|
|
.BI list_deleted_inodes " [limit]"
|
|
|
|
List deleted inodes, optionally limited to those deleted within
|
|
|
|
.I limit
|
|
|
|
seconds ago. Also available as
|
|
|
|
.BR lsdel .
|
|
|
|
.IP
|
|
|
|
This command was useful for recovering from accidental file deletions
|
|
|
|
for ext2 file systems. Unfortunately, it is not useful for this purpose
|
|
|
|
if the files were deleted using ext3 or ext4, since the inode's
|
|
|
|
data blocks are no longer available after the inode is released.
|
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.BI modify_inode " filespec"
|
1997-04-29 18:51:31 +04:00
|
|
|
Modify the contents of the inode structure in the inode
|
|
|
|
.IR filespec .
|
2013-12-16 07:12:43 +04:00
|
|
|
Also available as
|
|
|
|
.BR mi .
|
1997-04-29 18:51:31 +04:00
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.BI mkdir " filespec"
|
1997-04-26 17:21:57 +04:00
|
|
|
Make a directory.
|
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.BI mknod " filespec [p|[[c|b] major minor]]"
|
1997-04-29 18:51:31 +04:00
|
|
|
Create a special device file (a named pipe, character or block device).
|
2013-12-16 07:12:43 +04:00
|
|
|
If a character or block device is to be made, the
|
1997-04-29 18:51:31 +04:00
|
|
|
.I major
|
|
|
|
and
|
|
|
|
.I minor
|
|
|
|
device numbers must be specified.
|
1997-04-26 17:58:21 +04:00
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.BI ncheck " [-c] inode_num ..."
|
1997-05-09 07:06:31 +04:00
|
|
|
Take the requested list of inode numbers, and print a listing of pathnames
|
2012-01-18 02:08:39 +04:00
|
|
|
to those inodes. The
|
|
|
|
.I -c
|
|
|
|
flag will enable checking the file type information in the directory
|
|
|
|
entry to make sure it matches the inode's type.
|
1997-04-26 17:58:21 +04:00
|
|
|
.TP
|
2015-05-05 17:41:52 +03:00
|
|
|
.BI open " [-weficD] [-b blocksize] [-s superblock] [-z undo_file] device"
|
2013-12-16 07:12:43 +04:00
|
|
|
Open a filesystem for editing. The
|
|
|
|
.I -f
|
|
|
|
flag forces the filesystem to be opened even if there are some unknown
|
|
|
|
or incompatible filesystem features which would normally
|
ChangeLog, debug_cmds.ct, debugfs.8.in, debugfs.c, dump.c, ls.c:
debugfs.8.in: Documented new behaviour.
ls.c (ls_l_file): Fix Y2K bug -- was printing 22-May-100 for recent
files. Switched to 4-digit years.
dump.c, debug_cmds.ct (do_rdump): Add new debugfs command "rdump",
which recursively dumps a directory and its contents.
(fix_perms): New function. Break permission-fixing code out of
dump_file() so it can be called by rdump code as well.
(dump_file): Call fix_perms().
debugfs.c, debug_cmds.ct (do_lcd): Add new debugfs command "lcd",
which changes the cwd on the native filesystem.
debugfs.c (open_filesystem): Extra args for superblock, blocksize, and
catastrophic mode. Changed callers.
(do_open_filesys, main): Accept new -b, -s, -c options for
open_filesystem.
ChangeLog, mkdir.c:
mkdir.c (ext2fs_mkdir): Read the parent directory's inode earlier, so
that if there's an error reading it, we can more cleanly back out of
the operation.
version.h:
Update version file for WIP release.
2000-05-27 19:15:40 +04:00
|
|
|
prevent the filesystem from being opened. The
|
2006-03-19 03:58:13 +03:00
|
|
|
.I -e
|
|
|
|
flag causes the filesystem to be opened in exclusive mode. The
|
2010-09-24 18:12:54 +04:00
|
|
|
.IR -b ", " -c ", " -i ", " -s ", " -w ", and " -D
|
2013-12-16 07:12:43 +04:00
|
|
|
options behave the same as the command-line options to
|
2006-03-19 03:58:13 +03:00
|
|
|
.BR debugfs .
|
1997-04-26 17:21:57 +04:00
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.BI punch " filespec start_blk [end_blk]"
|
2010-07-22 17:39:04 +04:00
|
|
|
Delete the blocks in the inode ranging from
|
|
|
|
.I start_blk
|
|
|
|
to
|
|
|
|
.IR end_blk .
|
|
|
|
If
|
|
|
|
.I end_blk
|
|
|
|
is omitted then this command will function as a truncate command; that
|
|
|
|
is, all of the blocks starting at
|
|
|
|
.I start_blk
|
|
|
|
through to the end of the file will be deallocated.
|
|
|
|
.TP
|
2013-12-29 07:15:59 +04:00
|
|
|
.BI symlink " filespec target"
|
2013-01-05 00:00:59 +04:00
|
|
|
Make a symbolic link.
|
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.B pwd
|
1997-04-26 17:58:21 +04:00
|
|
|
Print the current working directory.
|
1997-04-26 17:21:57 +04:00
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.B quit
|
1997-04-26 17:21:57 +04:00
|
|
|
Quit
|
|
|
|
.B debugfs
|
|
|
|
.TP
|
2014-08-04 05:54:14 +04:00
|
|
|
.BI rdump " directory[...] destination"
|
2001-11-25 00:10:52 +03:00
|
|
|
Recursively dump
|
2014-08-04 05:54:14 +04:00
|
|
|
.IR directory ,
|
|
|
|
or multiple
|
|
|
|
.IR directories ,
|
2001-11-25 00:10:52 +03:00
|
|
|
and all its contents (including regular files, symbolic links, and other
|
|
|
|
directories) into the named
|
2014-08-04 05:54:14 +04:00
|
|
|
.IR destination ,
|
2001-11-25 00:10:52 +03:00
|
|
|
which should be an existing directory on the native filesystem.
|
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.BI rm " pathname"
|
|
|
|
Unlink
|
1997-04-29 18:51:31 +04:00
|
|
|
.IR pathname .
|
2013-12-16 07:12:43 +04:00
|
|
|
If this causes the inode pointed to by
|
1997-04-29 18:51:31 +04:00
|
|
|
.I pathname
|
|
|
|
to have no other references, deallocate the file. This command functions
|
|
|
|
as the unlink() system call.
|
2013-12-16 07:12:43 +04:00
|
|
|
.I
|
1997-04-29 18:51:31 +04:00
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.BI rmdir " filespec"
|
1997-04-29 18:51:31 +04:00
|
|
|
Remove the directory
|
|
|
|
.IR filespec .
|
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.BI setb " block [count]"
|
1997-04-29 18:51:31 +04:00
|
|
|
Mark the block number
|
|
|
|
.I block
|
|
|
|
as allocated.
|
2013-12-16 07:12:43 +04:00
|
|
|
If the optional argument
|
|
|
|
.I count
|
|
|
|
is present, then
|
2002-01-03 12:55:25 +03:00
|
|
|
.I count
|
|
|
|
blocks starting at block number
|
|
|
|
.I block
|
|
|
|
will be marked as allocated.
|
1997-04-29 18:51:31 +04:00
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.BI set_block_group " bgnum field value"
|
2007-04-13 23:56:00 +04:00
|
|
|
Modify the block group descriptor specified by
|
|
|
|
.I bgnum
|
|
|
|
so that the block group descriptor field
|
|
|
|
.I field
|
|
|
|
has value
|
2013-12-16 07:12:43 +04:00
|
|
|
.IR value .
|
|
|
|
Also available as
|
|
|
|
.BR set_bg .
|
2007-04-13 23:56:00 +04:00
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.BI seti " filespec [num]"
|
|
|
|
Mark inode
|
1997-04-29 18:51:31 +04:00
|
|
|
.I filespec
|
2012-03-26 06:26:30 +04:00
|
|
|
as in use in the inode bitmap. If
|
|
|
|
.I num
|
|
|
|
is specified, also set num-1 inodes after the specified inode.
|
1997-04-26 17:21:57 +04:00
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.BI set_inode_field " filespec field value"
|
|
|
|
Modify the inode specified by
|
2004-12-22 04:37:36 +03:00
|
|
|
.I filespec
|
|
|
|
so that the inode field
|
|
|
|
.I field
|
2013-12-16 07:12:43 +04:00
|
|
|
has value
|
2004-12-22 04:37:36 +03:00
|
|
|
.I value.
|
2013-12-16 07:12:43 +04:00
|
|
|
The list of valid inode fields which can be set via this command
|
2004-12-22 04:37:36 +03:00
|
|
|
can be displayed by using the command:
|
2005-01-08 05:14:12 +03:00
|
|
|
.B set_inode_field -l
|
2013-12-16 07:12:43 +04:00
|
|
|
Also available as
|
|
|
|
.BR sif .
|
2004-12-22 04:37:36 +03:00
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.BI set_mmp_value " field value"
|
|
|
|
Modify the multiple-mount protection (MMP) data so that the MMP field
|
2011-11-12 06:06:04 +04:00
|
|
|
.I field
|
|
|
|
has value
|
|
|
|
.I value.
|
2013-12-16 07:12:43 +04:00
|
|
|
The list of valid MMP fields which can be set via this command
|
2011-11-12 06:06:04 +04:00
|
|
|
can be displayed by using the command:
|
|
|
|
.B set_mmp_value -l
|
2013-12-16 07:12:43 +04:00
|
|
|
Also available as
|
|
|
|
.BR smmp .
|
2011-11-12 06:06:04 +04:00
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.BI set_super_value " field value"
|
2001-11-25 00:10:52 +03:00
|
|
|
Set the superblock field
|
|
|
|
.I field
|
2013-12-16 07:12:43 +04:00
|
|
|
to
|
2001-11-25 00:10:52 +03:00
|
|
|
.I value.
|
2013-12-16 07:12:43 +04:00
|
|
|
The list of valid superblock fields which can be set via this command
|
2001-11-25 00:10:52 +03:00
|
|
|
can be displayed by using the command:
|
|
|
|
.B set_super_value -l
|
2013-12-16 07:12:43 +04:00
|
|
|
Also available as
|
|
|
|
.BR ssv .
|
2001-11-25 00:10:52 +03:00
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.BI show_super_stats " [-h]"
|
1999-09-15 00:55:37 +04:00
|
|
|
List the contents of the super block and the block group descriptors. If the
|
|
|
|
.I -h
|
2013-12-16 07:12:43 +04:00
|
|
|
flag is given, only print out the superblock contents. Also available as
|
|
|
|
.BR stats .
|
1997-04-26 17:21:57 +04:00
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.BI stat " filespec"
|
1997-04-29 18:51:31 +04:00
|
|
|
Display the contents of the inode structure of the inode
|
|
|
|
.IR filespec .
|
1997-04-26 17:21:57 +04:00
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.BI testb " block [count]"
|
1997-04-29 18:51:31 +04:00
|
|
|
Test if the block number
|
|
|
|
.I block
|
|
|
|
is marked as allocated in the block bitmap.
|
2013-12-16 07:12:43 +04:00
|
|
|
If the optional argument
|
|
|
|
.I count
|
|
|
|
is present, then
|
2002-01-03 12:55:25 +03:00
|
|
|
.I count
|
|
|
|
blocks starting at block number
|
|
|
|
.I block
|
|
|
|
will be tested.
|
1997-04-26 17:21:57 +04:00
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.BI testi " filespec"
|
|
|
|
Test if the inode
|
1997-04-29 18:51:31 +04:00
|
|
|
.I filespec
|
|
|
|
is marked as allocated in the inode bitmap.
|
1997-04-26 17:21:57 +04:00
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.BI undel " <inode_number> [pathname]"
|
2008-01-01 19:37:20 +03:00
|
|
|
Undelete the specified inode number (which must be surrounded by angle
|
|
|
|
brackets) so that it and its blocks are marked in use, and optionally
|
2013-12-16 07:12:43 +04:00
|
|
|
link the recovered inode to the specified pathname. The
|
2008-01-01 19:37:20 +03:00
|
|
|
.B e2fsck
|
2013-12-16 07:12:43 +04:00
|
|
|
command should always be run after using the
|
2008-01-01 19:37:20 +03:00
|
|
|
.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
|
2013-12-16 07:12:43 +04:00
|
|
|
yet-to-be-undeleted files. So it is safer to undelete all of the
|
2008-01-01 19:37:20 +03:00
|
|
|
inodes without specifying a destination pathname, and then in a separate
|
|
|
|
pass, use the debugfs
|
|
|
|
.B link
|
2013-12-16 07:12:43 +04:00
|
|
|
command to link the inode to the destination pathname, or use
|
2008-01-01 19:37:20 +03:00
|
|
|
.B e2fsck
|
|
|
|
to check the filesystem and link all of the recovered inodes to the
|
2008-09-07 22:08:40 +04:00
|
|
|
lost+found directory.
|
2008-01-01 19:37:20 +03:00
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.BI unlink " pathname"
|
|
|
|
Remove the link specified by
|
|
|
|
.I pathname
|
1997-04-29 18:51:31 +04:00
|
|
|
to an inode. Note this does not adjust the inode reference counts.
|
1997-04-26 17:58:21 +04:00
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.BI write " source_file out_file"
|
|
|
|
Copy the contents of
|
1997-04-26 17:58:21 +04:00
|
|
|
.I source_file
|
2013-12-16 07:12:43 +04:00
|
|
|
into a newly-created file in the filesystem named
|
|
|
|
.IR out_file .
|
2013-01-11 11:40:25 +04:00
|
|
|
.TP
|
2013-12-16 07:12:43 +04:00
|
|
|
.BI zap_block " [-f filespec] [-o offset] [-l length] [-p pattern] block_num"
|
|
|
|
Overwrite the block specified by
|
|
|
|
.I block_num
|
|
|
|
with zero (NUL) bytes, or if
|
|
|
|
.I -p
|
|
|
|
is given use the byte specified by
|
|
|
|
.IR pattern .
|
|
|
|
If
|
|
|
|
.I -f
|
|
|
|
is given then
|
|
|
|
.I block_num
|
|
|
|
is relative to the start of the file given by
|
|
|
|
.IR filespec .
|
|
|
|
The
|
|
|
|
.I -o
|
|
|
|
and
|
|
|
|
.I -l
|
|
|
|
options limit the range of bytes to zap to the specified
|
|
|
|
.I offset
|
|
|
|
and
|
|
|
|
.I length
|
|
|
|
relative to the start of the block.
|
|
|
|
.TP
|
|
|
|
.BI zap_block " [-f filespec] [-b bit] block_num"
|
|
|
|
Bit-flip portions of the physical
|
|
|
|
.IR block_num .
|
|
|
|
If
|
|
|
|
.I -f
|
|
|
|
is given, then
|
|
|
|
.I block_num
|
|
|
|
is a logical block relative to the start of
|
|
|
|
.IR filespec .
|
2004-01-25 02:54:41 +03:00
|
|
|
.SH ENVIRONMENT VARIABLES
|
|
|
|
.TP
|
|
|
|
.B DEBUGFS_PAGER, PAGER
|
|
|
|
The
|
2010-09-24 18:12:54 +04:00
|
|
|
.B debugfs
|
2004-01-25 02:54:41 +03:00
|
|
|
program always pipes the output of the some commands through a
|
2013-12-16 07:12:43 +04:00
|
|
|
pager program. These commands include:
|
|
|
|
.IR show_super_stats " (" stats ),
|
|
|
|
.IR list_directory " (" ls ),
|
|
|
|
.IR show_inode_info " (" stat ),
|
|
|
|
.IR list_deleted_inodes " (" lsdel ),
|
2004-01-25 02:54:41 +03:00
|
|
|
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
|
2013-12-16 07:12:43 +04:00
|
|
|
environment variable.
|
2004-01-25 02:54:41 +03:00
|
|
|
.IP
|
2013-12-16 07:12:43 +04:00
|
|
|
Note that since a pager is always used, the
|
2004-01-25 02:54:41 +03:00
|
|
|
.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
|
2013-12-16 07:12:43 +04:00
|
|
|
when the pager is exited. Many users prefer to use the
|
2004-01-25 02:54:41 +03:00
|
|
|
.BR less (1)
|
2013-12-16 07:12:43 +04:00
|
|
|
pager for most purposes, which is why the
|
|
|
|
.B DEBUGFS_PAGER
|
2004-01-25 02:54:41 +03:00
|
|
|
environment variable is available to override the more general
|
|
|
|
.B PAGER
|
|
|
|
environment variable.
|
1997-04-26 17:21:57 +04:00
|
|
|
.SH AUTHOR
|
|
|
|
.B debugfs
|
1997-04-26 17:58:21 +04:00
|
|
|
was written by Theodore Ts'o <tytso@mit.edu>.
|
1997-04-26 17:21:57 +04:00
|
|
|
.SH SEE ALSO
|
|
|
|
.BR dumpe2fs (8),
|
2008-02-29 04:50:05 +03:00
|
|
|
.BR tune2fs (8),
|
1997-04-26 17:21:57 +04:00
|
|
|
.BR e2fsck (8),
|
2013-12-25 00:15:31 +04:00
|
|
|
.BR mke2fs (8),
|
|
|
|
.BR ext4 (5)
|