.SH DESCRIPTION
The
.B debugfs
-program
-is a file system debugger. It can be used to examine and change the
-state of an ext2 file system.
+program is an interactive file system debugger. It can be used to
+examine and change the state of an ext2 file system.
.br
.I device
is the special file corresponding to the device containing the ext2
print the version number of
.B debugfs
and exit.
+.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 .
+.\"
+.\"
+.\"
.SH COMMANDS
+This is a list of the commands which
.B debugfs
-is an interactive debugger. It understands a number of commands.
+supports.
.TP
.I cat filespec
Dump the contents of the inode
.BR rm (1)
command if you wish to unlink a file.
.TP
+.I lcd directory
+Change the current working directory of the
+.B debugfs
+process to
+.I directory
+on the native filesystem.
+.TP
.I ln filespec dest_file
Create a link named
.I dest_file
.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.
+.TP
.I ls [-l] filespec
Print a listing of the files in the directory
.IR filespec .
Quit
.B debugfs
.TP
+.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
.I rm pathname
Unlink
.IR pathname .
.I filespec
as in use in the inode bitmap.
.TP
+.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
.I show_super_stats [-h]
List the contents of the super block and the block group descriptors. If the
.I -h
and copy the contents of
.I source_file
into the destination file.
-.TP
-.I lcd directory
-Change the current working directory of the
-.B debugfs
-process to
-.I directory
-on the native filesystem.
-.TP
-.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.
-.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 .
.SH AUTHOR
.B debugfs
was written by Theodore Ts'o <tytso@mit.edu>.
return 0;
}
+static void print_possible_fields()
+{
+ struct super_set_info *ss;
+ char *type;
+
+ printf("Superblock fields supported by the set_super_value command:\n");
+ for (ss = super_fields ; ss->name ; ss++) {
+ type = "unknown";
+ if (ss->func == parse_string)
+ type = "string";
+ else if (ss->func == parse_int)
+ type = "integer";
+ else if (ss->func == parse_uint)
+ type = "unsigned integer";
+ printf("\t%-20s\t%s\n", ss->name, type);
+ }
+}
+
+
void do_set_super(int argc, char *argv[])
{
+ const char *usage = "Usage: set_super <field> <value>\n"
+ "\t\"set_super -l\" will list the names of superblock fields "
+ "which\n\tcan be set.";
static struct super_set_info *ss;
+ if ((argc == 2) && !strcmp(argv[1], "-l")) {
+ print_possible_fields();
+ return;
+ }
+
if (check_fs_open(argv[0]))
return;
if (argc != 3) {
- com_err(argv[0], 0, "Usage: set_super <field> <value>");
+ com_err(argv[0], 0, usage);
return;
}