summaryrefslogtreecommitdiff
path: root/debugfs/debugfs.8
blob: 9ff19d63b38a696ffcd6d2c29090d4c0cd028b42 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
.\" -*- nroff -*-
.\" Copyright 1993, 1994, 1995 by Theodore Ts'o.  All Rights Reserved.
.\" This file may be copied under the terms of the GNU Public License.
.\" 
.TH DEBUGFS 8 "October 1995" "Version 0.5c"
.SH NAME
debugfs \- ext2 file system debugger
.SH SYNOPSIS
.B debugfs
[
[
.B \-w
]
device
]
.SH DESCRIPTION
.B debugfs
is a 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
file system (e.g /dev/hdXX).
.SH OPTIONS
.TP
.I -w
Specify that the file system should be open in read-write mode. Without this
option, the file system is open in read-only mode.
.SH COMMANDS
.B debugfs
is an interactive debugger. It understands a number of commands.
.TP
.I cat <file>
Dump the contents of an inode to stdout.
.TP
.I cd <directory>
Change the current working directory to specified directory
.TP
.I chroot <directory>
Change the root directory to be the specified inode.
.TP
.I close
Close the currently open file system.
.TP
.I clri <file>
Clear the contents of the inode corresponding to
.I file
.TP
.I dump <file> <out_file>
Dump the contents of an inode to a file.
.TP
.I expand_dir <file>
Expand a directory.
.TP
.I find_free_block [goal]
Find the first free block, starting from
.I goal
and allocates it.
.TP
.I find_free_inode [dir [mode]]
Find a free inode and allocates it.
.TP
.I freeb <block>
Mark the block as not allocated.
.TP
.I freei <file>
Free the inode corresponding to
.I file
.TP
.I help
Print a list of commands understood by 
.BR debugfs (8).
.TP
.I icheck <block>
Do block->inode translation.
.TP
.I iname <inode>
Print the file name corresponding to
.I inode
(currently not implemented - see ncheck).
.TP
.I initialize <device> <blocksize>
Create an ext2 file system on
.I device
.TP
.I kill_file <file>
Remove a file and deallocates its blocks.
.TP
.I ln <source_file> <dest_file>
Create a link.
.TP
.I ls [pathname]
Emulate the
.BR ls (1)
command.
.TP
.I modify_inode <file>
Modify the contents of the inode corresponding to
.I file
.TP
.I mkdir <file>
Make a directory.
.TP
.I mknod <file> [p|[[c|b] <major> <minor>]]
Create a special device file
.TP
.I ncheck <inode>
Do inode->name translation.
.TP
.I open [-w] <device>
Open a file system.
.TP
.I pwd
Print the current working directory.
.TP
.I quit
Quit
.B debugfs
.TP
.I rm <file>
Remove a file.
.TP
.I rmdir <directory>
Remove a directory.
.TP
.I setb <block>
Mark the block as allocated.
.TP
.I seti <file>
Mark in use the inode corresponding to
.I file
.TP
.I show_super_stats
List the contents of the super block.
.TP
.I stat <file>
Dump the contents of the inode corresponding to
.I file
.TP
.I testb <block>
Test if the block is marked as allocated.
.TP
.I testi <file>
Test if the inode correponding to
.I file
is marked as allocated.
.TP
.I unlink <file>
Remove a link.
.TP
.I write source_file <file>
Create a file in the filesystem named
.IR file ,
and copy the contents of
.I source_file
into the destination file.
.SH AUTHOR
.B debugfs
was written by Theodore Ts'o <tytso@mit.edu>.
.SH SEE ALSO
.BR dumpe2fs (8),
.BR e2fsck (8),
.BR mke2fs (8)