Commit Graph

41 Commits (master)

Author SHA1 Message Date
Theodore Ts'o b199291909 debugfs: add the debugfs copy_inode subcommand
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2016-08-31 18:13:16 -04:00
Theodore Ts'o 9603da15cb Revert "debugfs: add the hexdump_block command"
This reverts commit 58b0356a25.

We already have the block_dump (bd) command, but I had completely
forgotten about it.  Oops!

Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-06-21 20:14:32 -04:00
Theodore Ts'o 58b0356a25 debugfs: add the hexdump_block command
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-06-20 00:10:20 -04:00
Darrick J. Wong 2f8c0d028c debugfs: implement fallocate
Implement a fallocate function for debugfs, and add some tests to
demonstrate that it works (more or less).

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2015-06-10 20:01:24 -04:00
Darrick J. Wong 463eb92131 debugfs: add the ability to write transactions to the journal
Extend debugfs with the ability to create transactions and replay the
journal.  This will eventually be used to test kernel recovery and
metadata_csum recovery.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-09-11 16:52:37 -04:00
Theodore Ts'o f9f3050a0a Merge branch 'maint' into next
Conflicts:
	debian/changelog
	e2fsck/pass1.c
	lib/ext2fs/Makefile.in
2014-07-22 14:57:40 -04:00
Darrick J. Wong e13ebfdd5f debugfs: create inode_dump command to dump an inode in hex
Create a command that will dump an entire inode's space in hex.

[ Modified by tytso to add a description to the man page, and to add
  the more formal command name, inode_dump, in addition to short
  command name of "idump". ]

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2014-07-22 13:48:54 -04:00
Theodore Ts'o ba08cb996a Merge branch 'maint' into next
Conflicts:
	debugfs/Makefile.in
	debugfs/debug_cmds.ct
	debugfs/debugfs.c
	debugfs/debugfs.h
	e2fsck/Makefile.in
	misc/Makefile.in
	misc/mke2fs.c
2014-05-13 11:01:07 -04:00
Theodore Ts'o 75fc42f1a1 debugfs: add commands to query the quota information
This allows us to verify quota information in an ext4 file systems
with the quota feature.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Reviewed-by: Aditya Kali <adityakali@google.com>
2014-05-13 10:13:19 -04:00
Darrick J. Wong 227239b10b debugfs: create commands to edit extended attributes
Enhance debugfs to be able to display and modify extended attributes, and
create some simple tests for the extended attribute editing functions.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2014-03-11 23:50:08 -04:00
Darren Hart 4df6a37bd3 debugfs: add symlink command
Add support for symbolic links using a new symlink command.  Modeled
after the do_mkdir() command.

Testing demonstrates both fastlinks and slowlinks work correctly.
Very long target paths fail as the command parsing appears to truncate
the input to somewhere around 256 bytes.

Signed-off-by: Darren Hart <dvhart@infradead.org>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
Cc: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: Andreas Dilger <adilger@dilger.ca>
2013-01-16 14:09:20 -05:00
Theodore Ts'o 9e85208e84 debugfs: fix gcc-wall complaints
Fix the missing function prototypes from the recently added new
debugfs commands, plus some signed vs unsigned comparison complaints.

Also change the abbreviation of the block_dump command from "bp" to
the more appropriate "bp".

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2013-01-14 16:54:09 -05:00
Eric Sandeen 85a24385b6 debugfs: document zap_block & block_dump
What little docs there were had a cut & paste error.
We can do better. :)

Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2013-01-12 19:26:37 -05:00
Theodore Ts'o ba75d9e208 debugfs: add the commands "zap_block" and "block_dump"
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-12-24 10:49:45 -05:00
Theodore Ts'o bee7b67ce9 debugfs: add the ability to manipulate the extent tree directly
This commit adds the functionality which had previously only been in
the tst_extents command to debugfs.  The debugfs command extent_open
will open extent tree of a particular inode, and enables a series of
commands which will allow the user to interact with the extent tree
directly.  Once the extent tree is closed via extent_open(), these
additional commands will be disabled again.

This commit exports two new functions from lib/ext2fs/extent.c which
had previously been statically defined: ext2fs_extent_node_split() and
ext2fs_extent_goto2().

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2012-12-24 10:49:41 -05:00
Bryce Harrington 84461ea9d0 e2fsprogs: fix spelling of 'filesystme' in debugfs help
Signed-off-by: Bryce Harrington <bryce@canonical.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2012-08-19 17:56:06 -04:00
Theodore Ts'o c4ab66c526 debugfs: add filefrag command
Add the ability to report on the fragmentation of a file on a file
system opened using debugfs.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-11-18 22:14:15 -05:00
Theodore Ts'o 5e96c5721d debugfs: add the freefrag command
The freefrag command provides the functionality of e2freefrag on the
currently open file system in debugfs.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-11-18 22:12:12 -05:00
Andreas Dilger 0f5eba7501 ext2fs: add multi-mount protection (INCOMPAT_MMP)
Multi-mount protection is feature that allows mke2fs, e2fsck, and
others to detect if the filesystem is mounted on a remote node (on
SAN disks) and avoid corrupting the filesystem.  For e2fsprogs this
means that it checks the MMP block to see if the filesystem is in use,
and marks the filesystem busy while e2fsck is running on the system.

This is useful on SAN disks that are shared between high-availability
servers, or accessible by multiple nodes that aren't in HA pairs.  MMP
isn't intended to serve as a primary HA exclusion mechanism, but as a
failsafe to protect against user, software, or hardware errors.

There is no requirement that e2fsck updates the MMP block at regular
intervals, but e2fsck does this occasionally to provide useful
information to the sysadmin in case of a detected conflict.

For the kernel (since Linux 3.0) MMP adds a "heartbeat" mechanism to
periodically write to disk (every few seconds by default) to notify
other nodes that the filesystem is still in use and unsafe to modify.

Originally-by: Kalpak Shah <kalpak@clusterfs.com>

Signed-off-by: Johann Lombardi <johann@whamcloud.com>
Signed-off-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2011-09-25 01:55:23 -04:00
Theodore Ts'o af0df2aa4a debugfs: add a new debugfs command 'blocks'
The blocks command prints out the blocks used by a particular inode,
in a format which is useful for test suite automation.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2011-07-09 12:13:40 -04:00
Theodore Ts'o 8668592362 debugfs: Add new debugfs command punch (aka truncate)
This uses the newly added ext2fs_punch() function.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2010-07-22 09:39:04 -04:00
Theodore Ts'o 187cb623dc debugfs: Add the new command dump_extents and extent the stat command
Extend the stat command to display more detailed extent information if
the file uses extent mapping instead of displaying the block map using
the block_iterate funtion.

Add the command dump_extents which displays even more detailed
information about an inode's extent tree.

This commit is an extension of a patch from Curt Wohlgemuth.

Signed-off-by: Curt Wohlgemuth <curtw@google.com>
Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2009-07-27 10:37:20 -04:00
Theodore Ts'o d17ad1234d Update release notes, version string, etc. for E2fsprogs 1.41.6 release 2009-05-30 13:56:31 -04:00
Andreas Dilger 03efde8abe add debugfs command to print known features
Print out the currently supported features of e2fsprogs/libext2fs
via a new "debugfs supported_features" command.  This helps scripts
to know whether it is possible to try and enable specific features
in the filesystem.

Signed-off-by: Kalpak Shah <kalpak.shah@sun.com>
Signed-off-by: Andreas Dilger <adilger@sun.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
2008-08-24 21:31:52 -04:00
Theodore Ts'o c7c1209efd Add new debugfs command "set_block_group"
This command allows the user to set a value in the block group descriptors
for a particular block group.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2007-04-13 15:56:00 -04:00
Theodore Ts'o 4efae606bf New debugfs command: set_current_time
Generalize the time parsing code and move it to
util.c:string_to_time().  Add new command, set_current_time, which
sets the time used to set the filesystems's time fields.

Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>
2005-09-24 21:56:38 -04:00
Theodore Ts'o 1d3a951118 Make the official name of the new debugfs set_inode command be
set_inode_field, since it is more intuitive.
2005-01-07 21:14:12 -05:00
Theodore Ts'o 7dec050a80 Enhance debugfs so that set_super_value can now set the wtime, mtime,
lastcheck, and mkfs_time fields with date/time values.

Add the set_inode command to debugfs so that individual inode fields can
be more easily modified.  We should probably make the modify_inode
command go away at some point.
2004-12-21 20:37:36 -05:00
Theodore Ts'o a5fdcd5946 unused.c (do_dump_unused): Add new command which dumps the
unused blocks.  (Initial implementation; currently only
	dumps the output to stdout.)
2003-05-21 17:58:36 -04:00
Theodore Ts'o becf36f6ac debugfs.c (do_imap), debugfs.h, debug_cmds.ct, debugfs.8.in:
Added new command, imap, which prints the location of a
	specified inode in the inode table.
2003-05-05 11:35:04 -04:00
Theodore Ts'o b38cd28363 Add a new command "bmap" to debugfs which calculates the logical->physical block
mapping for a particular inode.

Fixed a bug in the libext2 library which broke ext2fs_bmap if no inode structre
was passed inside for here.

Fixed bad calling parameters to parse_ulong which broken the -b  and -s
options to debugfs, as well as do_init, and the testb, setb, clearb functions.
2002-05-11 22:13:20 -04:00
Theodore Ts'o df614db6ef Add initial support in debugfs for examining directory indexing
information.
2002-02-25 04:28:45 -05:00
Theodore Ts'o e1018eeaa3 Add new debugfs commands and arguments which make it easier to
recover deleted files.  The lsdel command now takes an optional
argument which allows the user to only see the most recently
deleted files.  Also added a new command, undel, which automates
undeleting a deleted inode and linking it back to a directory.
Also added an optional count argument to the testb, freeb, setb,
and find_free_block commands.  The ls command now takes a new
option, -d, which lists deleted directory entries.

Factored out out commonly used code into utility subroutines
for ease of maintenance and to make the executable size smaller.
2002-01-03 04:55:25 -05:00
Theodore Ts'o da81e3fcfe Many files:
debugfs.c (dump_blocks, dump_inode, internal_dump_inode): Add
  	internal_dump_inode() interface for the logdump command.
  logdump.c: Imported code from Stephen Tweedie to dump the ext3 journal.
2001-03-29 20:49:58 +00:00
Theodore Ts'o c6bd0c97e4 Makefile.in, debug_cmds.ct, setsuper.c, ChangeLog:
setsuper.c: New function which implements the set_super_value command.
  	Allows the user to set arbitrary superblock fields.
ChangeLog, util.c:
  util.c (open_pager): If the PAGER environment variable is not set,
  	default to using "more".
2000-08-14 20:37:09 +00:00
Theodore Ts'o 2e8d40d562 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 15:15:40 +00:00
Theodore Ts'o d3aea7dc1b ChangeLog, Makefile.in, debug_cmds.ct, debugfs.8.in, debugfs.c:
debugfs.c, debug_cmds.ct: Add new debugfs command "feature" which
  	allows the user to set or clear filesystme features.  Add the -f
  	(force) option to the open command.  Add the -h (superblock header
  	only) option to the stats command.
1999-09-14 20:55:37 +00:00
Theodore Ts'o 21c84b71e2 Many files:
Checked in e2fsprogs-1.07
1997-04-29 16:15:03 +00:00
Theodore Ts'o 50e1e10fa0 Many files:
Checked in e2fsprogs 0.5c
1997-04-26 13:58:21 +00:00
Theodore Ts'o 6f4a109706 Many files:
Checkin of e2fsprogs 0.5b
1997-04-26 13:32:25 +00:00
Theodore Ts'o 3839e65723 Many files:
Checkin of e2fsprogs 0.5b
1997-04-26 13:21:57 +00:00