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.
|
|
|
|
.\"
|
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
|
2003-08-25 01:56:41 +04:00
|
|
|
debugfs \- ext2/ext3 file system debugger
|
1997-04-26 17:21:57 +04:00
|
|
|
.SH SYNOPSIS
|
|
|
|
.B debugfs
|
|
|
|
[
|
2004-07-29 05:11:48 +04:00
|
|
|
.B \-Vwci
|
|
|
|
]
|
|
|
|
[
|
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
|
|
|
|
]
|
|
|
|
[
|
1997-04-29 18:51:31 +04:00
|
|
|
.B \-f
|
|
|
|
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
|
|
|
]
|
|
|
|
[
|
1997-04-26 17:21:57 +04:00
|
|
|
device
|
|
|
|
]
|
|
|
|
.SH DESCRIPTION
|
1997-04-29 18:51:31 +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
|
|
|
|
examine and change the state of an ext2 file system.
|
1997-04-26 17:21:57 +04:00
|
|
|
.br
|
|
|
|
.I device
|
|
|
|
is the special file corresponding to the device containing the ext2
|
|
|
|
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
|
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
|
|
|
|
Specifies that
|
|
|
|
.I device
|
|
|
|
represents an ext2 image file created by the
|
|
|
|
.B e2image
|
|
|
|
program. Since the ext2 image file only contains the superblock, block
|
|
|
|
group descriptor, block and inode allocation bitmaps, and
|
|
|
|
the inode table, many
|
|
|
|
.B debugfs
|
|
|
|
commands will not function properly.
|
|
|
|
.B Warning:
|
|
|
|
no safety checks are in place, and
|
|
|
|
.B debugfs
|
|
|
|
may fail in interesting ways if commands such as
|
|
|
|
.IR ls ", " dump ", "
|
2004-07-29 05:11:48 +04:00
|
|
|
etc. are tried without specifying the
|
|
|
|
.I data_source_device
|
|
|
|
using the
|
|
|
|
.I \-d
|
|
|
|
option.
|
2001-05-03 19:05:55 +04:00
|
|
|
.B debugfs
|
|
|
|
is a debugging tool. It has rough edges!
|
|
|
|
.TP
|
2004-07-29 05:11:48 +04:00
|
|
|
.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
|
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
|
|
|
|
Causes the file system superblock to be read from the given block number,
|
|
|
|
rather than the default (1). If you give a
|
|
|
|
.I -s
|
|
|
|
option, you must also give a
|
|
|
|
.I -b
|
|
|
|
option.
|
|
|
|
.TP
|
1997-04-29 18:51:31 +04:00
|
|
|
.I -f cmd_file
|
|
|
|
Causes
|
|
|
|
.B debugfs
|
|
|
|
to read in commands from
|
|
|
|
.IR cmd_file ,
|
|
|
|
and execute them. When
|
|
|
|
.B debugfs
|
1997-05-09 07:06:31 +04:00
|
|
|
is finished executing those commands, it will exit.
|
1997-04-29 18:51:31 +04:00
|
|
|
.TP
|
|
|
|
.I -R request
|
|
|
|
Causes
|
|
|
|
.B debugfs
|
|
|
|
to execute the single command
|
|
|
|
.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
|
|
|
|
print the version number of
|
|
|
|
.B debugfs
|
|
|
|
and exit.
|
2001-11-25 00:10:52 +03:00
|
|
|
.SH SPECIFYING FILES
|
|
|
|
Many
|
|
|
|
.B debugfs
|
|
|
|
commands take a
|
|
|
|
.I filespec
|
|
|
|
as an argument to specify an inode (as opposed to a pathname)
|
|
|
|
in the filesystem which is currently opened by
|
|
|
|
.BR debugfs .
|
|
|
|
The
|
|
|
|
.I filespec
|
|
|
|
argument may be specified in two forms. The first form is an inode
|
|
|
|
number surrounded by angle brackets, e.g.,
|
|
|
|
.IR <2> .
|
|
|
|
The second form is a pathname; if the pathname is prefixed by a forward slash
|
|
|
|
('/'), 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
|
|
|
|
.BR debugfs .
|
|
|
|
This may be modified by using the
|
|
|
|
.B debugfs
|
|
|
|
command
|
|
|
|
.IR cd .
|
|
|
|
.\"
|
|
|
|
.\"
|
|
|
|
.\"
|
1997-04-26 17:21:57 +04:00
|
|
|
.SH COMMANDS
|
2001-11-25 00:10:52 +03: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
|
2003-05-05 19:35:04 +04:00
|
|
|
.I bmap filespec logical_block
|
|
|
|
Print the physical block number corresponding to the logical block number
|
|
|
|
.I logical_block
|
|
|
|
in the inode
|
|
|
|
.IR filespec .
|
|
|
|
.TP
|
1997-04-29 18:51:31 +04:00
|
|
|
.I cat filespec
|
|
|
|
Dump the contents of the inode
|
|
|
|
.I filespec
|
|
|
|
to stdout.
|
1997-04-26 17:21:57 +04:00
|
|
|
.TP
|
1997-04-29 18:51:31 +04:00
|
|
|
.I cd filespec
|
|
|
|
Change the current working directory to
|
|
|
|
.IR filespec .
|
1997-04-26 17:58:21 +04:00
|
|
|
.TP
|
1997-04-29 18:51:31 +04:00
|
|
|
.I chroot filespec
|
|
|
|
Change the root directory to be the directory
|
|
|
|
.IR filespec .
|
1997-04-26 17:21:57 +04:00
|
|
|
.TP
|
|
|
|
.I close
|
|
|
|
Close the currently open file system.
|
|
|
|
.TP
|
1997-04-29 18:51:31 +04:00
|
|
|
.I clri file
|
|
|
|
Clear the contents of the inode
|
|
|
|
.IR file .
|
|
|
|
.TP
|
|
|
|
.I dump [-p] filspec out_file
|
|
|
|
Dump the contents of the inode
|
|
|
|
.I filespec
|
|
|
|
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
|
|
|
|
.IR filespec .
|
|
|
|
.TP
|
|
|
|
.I expand_dir filespec
|
|
|
|
Expand the directory
|
|
|
|
.IR filespec .
|
1997-04-26 17:21:57 +04:00
|
|
|
.TP
|
1999-09-15 00:55:37 +04:00
|
|
|
.I feature [fs_feature] [-fs_feature] ...
|
|
|
|
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
|
2002-01-03 12:55:25 +03:00
|
|
|
.I find_free_block [count [goal]]
|
|
|
|
Find the first
|
|
|
|
.I count
|
|
|
|
free blocks, starting from
|
1997-04-26 17:21:57 +04:00
|
|
|
.I goal
|
1997-05-09 07:06:31 +04:00
|
|
|
and allocate it.
|
1997-04-26 17:21:57 +04:00
|
|
|
.TP
|
|
|
|
.I find_free_inode [dir [mode]]
|
1997-05-09 07:06:31 +04:00
|
|
|
Find a free inode and allocate it. If present,
|
1997-04-29 18:51:31 +04:00
|
|
|
.I dir
|
|
|
|
specifies the inode number of the directory
|
|
|
|
which the inode is to be located. The second
|
|
|
|
optional argument
|
|
|
|
.I mode
|
|
|
|
specifies the permissions of the new inode. (If the directory bit is set
|
|
|
|
on the mode, the allocation routine will function differently.)
|
|
|
|
.TP
|
2002-01-03 12:55:25 +03:00
|
|
|
.I freeb block [count]
|
1997-04-29 18:51:31 +04:00
|
|
|
Mark the block number
|
|
|
|
.I block
|
|
|
|
as not allocated.
|
2002-01-03 12:55:25 +03:00
|
|
|
If the optional argument
|
|
|
|
.I count
|
|
|
|
is present, then
|
|
|
|
.I count
|
|
|
|
blocks starting at block number
|
|
|
|
.I block
|
|
|
|
will be marked as not allocated.
|
1997-04-29 18:51:31 +04:00
|
|
|
.TP
|
|
|
|
.I freei filespec
|
|
|
|
Free the inode specified by
|
1997-05-09 07:06:31 +04:00
|
|
|
.IR filespec .
|
1997-04-26 17:21:57 +04:00
|
|
|
.TP
|
|
|
|
.I help
|
1997-04-26 17:58:21 +04:00
|
|
|
Print a list of commands understood by
|
|
|
|
.BR debugfs (8).
|
|
|
|
.TP
|
1997-04-29 18:51:31 +04:00
|
|
|
.I 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
|
2003-05-05 19:35:04 +04:00
|
|
|
.I imap filespec
|
|
|
|
Print the location of the inode data structure (in the inode table)
|
|
|
|
of the inode
|
|
|
|
.IR filespec .
|
|
|
|
.TP
|
2004-02-22 06:20:01 +03:00
|
|
|
.I 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 .
|
|
|
|
Note that this does not fully initialize all of the data structures;
|
|
|
|
to do this, use the
|
|
|
|
.BR mke2fs (8)
|
|
|
|
program. This is just a call to the low-level library, which sets up
|
|
|
|
the superblock and block descriptors.
|
|
|
|
.TP
|
|
|
|
.I kill_file filespec
|
1997-05-09 07:06:31 +04:00
|
|
|
Deallocate the inode
|
1997-04-29 18:51:31 +04:00
|
|
|
.I filespec
|
|
|
|
and its blocks. Note that this does not remove any directory
|
|
|
|
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
|
2001-11-25 00:10:52 +03:00
|
|
|
.I lcd directory
|
|
|
|
Change the current working directory of the
|
|
|
|
.B debugfs
|
|
|
|
process to
|
|
|
|
.I directory
|
|
|
|
on the native filesystem.
|
|
|
|
.TP
|
1997-04-29 18:51:31 +04:00
|
|
|
.I ln filespec dest_file
|
|
|
|
Create a link named
|
|
|
|
.I dest_file
|
|
|
|
which is a link to
|
|
|
|
.IR filespec .
|
|
|
|
Note this does not adjust the inode reference counts.
|
|
|
|
.TP
|
2003-08-21 08:40:26 +04:00
|
|
|
.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.
|
2001-11-25 00:10:52 +03:00
|
|
|
.TP
|
2002-01-03 12:55:25 +03:00
|
|
|
.I ls [-l] [-d] 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
|
|
|
|
.I \-l
|
|
|
|
flag will list files using a more verbose format.
|
|
|
|
The
|
|
|
|
.I \-d
|
|
|
|
flag will list deleted entries in the directory.
|
1997-04-29 18:51:31 +04:00
|
|
|
.TP
|
|
|
|
.I modify_inode filespec
|
|
|
|
Modify the contents of the inode structure in the inode
|
|
|
|
.IR filespec .
|
|
|
|
.TP
|
|
|
|
.I mkdir filespec
|
1997-04-26 17:21:57 +04:00
|
|
|
Make a directory.
|
|
|
|
.TP
|
1997-04-29 18:51:31 +04:00
|
|
|
.I mknod filespec [p|[[c|b] major minor]]
|
|
|
|
Create a special device file (a named pipe, character or block device).
|
|
|
|
If a character or block device is to be made, the
|
|
|
|
.I major
|
|
|
|
and
|
|
|
|
.I minor
|
|
|
|
device numbers must be specified.
|
1997-04-26 17:58:21 +04:00
|
|
|
.TP
|
1997-04-29 18:51:31 +04:00
|
|
|
.I ncheck inode_num ...
|
1997-05-09 07:06:31 +04:00
|
|
|
Take the requested list of inode numbers, and print a listing of pathnames
|
1997-04-29 18:51:31 +04:00
|
|
|
to those inodes.
|
1997-04-26 17:58:21 +04:00
|
|
|
.TP
|
2001-05-03 19:05:55 +04:00
|
|
|
.I open [-w] [-f] [-i] [-c] [-b blocksize] [-s superblock] device
|
1999-09-15 00:55:37 +04:00
|
|
|
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
|
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
|
2001-05-03 19:05:55 +04:00
|
|
|
.IR -c ", " -b ", " -i ", " and " -s
|
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
|
|
|
options behave the same as those to
|
|
|
|
.B debugfs
|
|
|
|
itself.
|
1997-04-26 17:21:57 +04:00
|
|
|
.TP
|
|
|
|
.I pwd
|
1997-04-26 17:58:21 +04:00
|
|
|
Print the current working directory.
|
1997-04-26 17:21:57 +04:00
|
|
|
.TP
|
|
|
|
.I quit
|
|
|
|
Quit
|
|
|
|
.B debugfs
|
|
|
|
.TP
|
2001-11-25 00:10:52 +03:00
|
|
|
.I rdump directory destination
|
|
|
|
Recursively dump
|
|
|
|
.I directory
|
|
|
|
and all its contents (including regular files, symbolic links, and other
|
|
|
|
directories) into the named
|
|
|
|
.I destination
|
|
|
|
which should be an existing directory on the native filesystem.
|
|
|
|
.TP
|
1997-04-29 18:51:31 +04:00
|
|
|
.I rm pathname
|
|
|
|
Unlink
|
|
|
|
.IR pathname .
|
1997-05-09 07:06:31 +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.
|
|
|
|
.I
|
|
|
|
.TP
|
|
|
|
.I rmdir filespec
|
|
|
|
Remove the directory
|
|
|
|
.IR filespec .
|
|
|
|
.TP
|
2002-01-03 12:55:25 +03:00
|
|
|
.I setb block [count]
|
1997-04-29 18:51:31 +04:00
|
|
|
Mark the block number
|
|
|
|
.I block
|
|
|
|
as allocated.
|
2002-01-03 12:55:25 +03:00
|
|
|
If the optional argument
|
|
|
|
.I count
|
|
|
|
is present, then
|
|
|
|
.I count
|
|
|
|
blocks starting at block number
|
|
|
|
.I block
|
|
|
|
will be marked as allocated.
|
1997-04-29 18:51:31 +04:00
|
|
|
.TP
|
|
|
|
.I seti filespec
|
|
|
|
Mark inode
|
|
|
|
.I filespec
|
|
|
|
as in use in the inode bitmap.
|
1997-04-26 17:21:57 +04:00
|
|
|
.TP
|
2005-01-08 05:14:12 +03:00
|
|
|
.I set_inode_field filespec field value
|
2004-12-22 04:37:36 +03:00
|
|
|
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:
|
2005-01-08 05:14:12 +03:00
|
|
|
.B set_inode_field -l
|
2004-12-22 04:37:36 +03:00
|
|
|
.TP
|
2001-11-25 00:10:52 +03:00
|
|
|
.I set_super_value field value
|
|
|
|
Set the superblock field
|
|
|
|
.I field
|
|
|
|
to
|
|
|
|
.I value.
|
|
|
|
The list of valid superblock fields which can be set via this command
|
|
|
|
can be displayed by using the command:
|
|
|
|
.B set_super_value -l
|
|
|
|
.TP
|
1999-09-15 00:55:37 +04:00
|
|
|
.I show_super_stats [-h]
|
|
|
|
List the contents of the super block and the block group descriptors. If the
|
|
|
|
.I -h
|
|
|
|
flag is given, only print out the superblock contents.
|
1997-04-26 17:21:57 +04:00
|
|
|
.TP
|
1997-04-29 18:51:31 +04:00
|
|
|
.I stat filespec
|
|
|
|
Display the contents of the inode structure of the inode
|
|
|
|
.IR filespec .
|
1997-04-26 17:21:57 +04:00
|
|
|
.TP
|
2002-01-03 12:55:25 +03:00
|
|
|
.I 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.
|
2002-01-03 12:55:25 +03:00
|
|
|
If the optional argument
|
|
|
|
.I count
|
|
|
|
is present, then
|
|
|
|
.I count
|
|
|
|
blocks starting at block number
|
|
|
|
.I block
|
|
|
|
will be tested.
|
1997-04-26 17:21:57 +04:00
|
|
|
.TP
|
1997-04-29 18:51:31 +04:00
|
|
|
.I testi filespec
|
|
|
|
Test if the inode
|
|
|
|
.I filespec
|
|
|
|
is marked as allocated in the inode bitmap.
|
1997-04-26 17:21:57 +04:00
|
|
|
.TP
|
1997-04-29 18:51:31 +04:00
|
|
|
.I unlink pathname
|
|
|
|
Remove the link specified by
|
|
|
|
.I pathname
|
|
|
|
to an inode. Note this does not adjust the inode reference counts.
|
1997-04-26 17:58:21 +04:00
|
|
|
.TP
|
1997-04-29 18:51:31 +04:00
|
|
|
.I write source_file out_file
|
1997-04-26 17:58:21 +04:00
|
|
|
Create a file in the filesystem named
|
1997-04-29 18:51:31 +04:00
|
|
|
.IR out_file ,
|
1997-04-26 17:58:21 +04:00
|
|
|
and copy the contents of
|
|
|
|
.I source_file
|
|
|
|
into the destination file.
|
2004-01-25 02:54:41 +03:00
|
|
|
.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.
|
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),
|
|
|
|
.BR e2fsck (8),
|
|
|
|
.BR mke2fs (8)
|