Whamcloud - gitweb
ChangeLog, config.guess:
[tools/e2fsprogs.git] / debugfs / debugfs.8.in
1 .\" -*- nroff -*-
2 .\" Copyright 1993, 1994, 1995 by Theodore Ts'o.  All Rights Reserved.
3 .\" This file may be copied under the terms of the GNU Public License.
4 .\" 
5 .TH DEBUGFS 8 "@E2FSPROGS_MONTH@ @E2FSPROGS_YEAR@" "E2fsprogs version @E2FSPROGS_VERSION@"
6 .SH NAME
7 debugfs \- ext2 file system debugger
8 .SH SYNOPSIS
9 .B debugfs
10 [
11 .B \-f 
12 cmd_file
13 ]
14 [
15 .B \-R
16 request
17 ]
18 [
19 .B \-V
20 ]
21 [
22 .B \-w
23 [
24 device
25 ]
26 ]
27 .SH DESCRIPTION
28 The 
29 .B debugfs 
30 program
31 is a file system debugger. It can be used to examine and change the
32 state of an ext2 file system.
33 .br
34 .I device
35 is the special file corresponding to the device containing the ext2
36 file system (e.g /dev/hdXX).
37 .SH OPTIONS
38 .TP
39 .I -w
40 Specifies that the file system should be opened in read-write mode.
41 Without this option, the file system is opened in read-only mode.
42 .TP
43 .I -f cmd_file
44 Causes 
45 .B debugfs
46 to read in commands from 
47 .IR cmd_file , 
48 and execute them.  When 
49 .B debugfs
50 is finished executing those commands, it will exit.
51 .TP 
52 .I -R request
53 Causes 
54 .B debugfs
55 to execute the single command 
56 .IR request ,
57 and then exit.
58 .TP
59 .I -V
60 print the version number of 
61 .B debugfs
62 and exit.
63 .SH COMMANDS
64 .B debugfs
65 is an interactive debugger. It understands a number of commands.
66 .TP
67 .I cat filespec
68 Dump the contents of the inode 
69 .I filespec
70 to stdout.
71 .TP
72 .I cd filespec
73 Change the current working directory to 
74 .IR filespec .
75 .TP
76 .I chroot filespec
77 Change the root directory to be the directory 
78 .IR filespec .
79 .TP
80 .I close
81 Close the currently open file system.
82 .TP
83 .I clri file
84 Clear the contents of the inode 
85 .IR file .
86 .TP
87 .I dump [-p] filspec out_file
88 Dump the contents of the inode 
89 .I filespec
90 to the output file 
91 .IR out_file .  
92 If the 
93 .I -p 
94 option is given set the owner, group and permissions information on 
95 .I out_file 
96 to match 
97 .IR filespec .
98 .TP
99 .I expand_dir filespec
100 Expand the directory
101 .IR filespec .
102 .TP
103 .I find_free_block [goal]
104 Find the first free block, starting from
105 .I goal
106 and allocate it.
107 .TP
108 .I find_free_inode [dir [mode]]
109 Find a free inode and allocate it.  If present, 
110 .I dir
111 specifies the inode number of the directory 
112 which the inode is to be located.  The second 
113 optional argument
114 .I mode
115 specifies the permissions of the new inode.  (If the directory bit is set
116 on the mode, the allocation routine will function differently.)
117 .TP
118 .I freeb block
119 Mark the block number
120 .I block
121 as not allocated.
122 .TP
123 .I freei filespec
124 Free the inode specified by 
125 .IR filespec .
126 .TP
127 .I help
128 Print a list of commands understood by 
129 .BR debugfs (8).
130 .TP
131 .I icheck block ...
132 Print a listing of the inodes which use the one or more blocks specified
133 on the command line.
134 .TP
135 .I initialize device blocksize
136 Create an ext2 file system on
137 .I device
138 with device size
139 .IR blocksize .
140 Note that this does not fully initialize all of the data structures; 
141 to do this, use the 
142 .BR mke2fs (8)
143 program.  This is just a call to the low-level library, which sets up
144 the superblock and block descriptors.
145 .TP
146 .I kill_file filespec
147 Deallocate the inode 
148 .I filespec
149 and its blocks.  Note that this does not remove any directory
150 entries (if any) to this inode.  See the 
151 .BR rm (1)
152 command if you wish to unlink a file.
153 .TP
154 .I ln filespec dest_file
155 Create a link named 
156 .I dest_file
157 which is a link to 
158 .IR filespec .
159 Note this does not adjust the inode reference counts.
160 .TP
161 .I ls [-l] filespec
162 Print a listing of the files in the directory
163 .IR filespec .
164 .TP
165 .I modify_inode filespec
166 Modify the contents of the inode structure in the inode
167 .IR filespec .
168 .TP
169 .I mkdir filespec
170 Make a directory.
171 .TP
172 .I mknod filespec [p|[[c|b] major minor]]
173 Create a special device file (a named pipe, character or block device).
174 If a character or block device is to be made, the 
175 .I major
176 and
177 .I minor
178 device numbers must be specified.
179 .TP
180 .I ncheck inode_num ...
181 Take the requested list of inode numbers, and print a listing of pathnames
182 to those inodes.
183 .TP
184 .I open [-w] device
185 Open a file system for editing.  
186 .TP
187 .I pwd
188 Print the current working directory.
189 .TP
190 .I quit
191 Quit
192 .B debugfs
193 .TP
194 .I rm pathname
195 Unlink 
196 .IR pathname .
197 If this causes the inode pointed to by 
198 .I pathname
199 to have no other references, deallocate the file.  This command functions
200 as the unlink() system call.
201 .I 
202 .TP
203 .I rmdir filespec
204 Remove the directory
205 .IR filespec .
206 This function is currently not implemented.
207 .TP
208 .I setb block
209 Mark the block number
210 .I block
211 as allocated.
212 .TP
213 .I seti filespec
214 Mark inode 
215 .I filespec
216 as in use in the inode bitmap.
217 .TP
218 .I show_super_stats
219 List the contents of the super block.
220 .TP
221 .I stat filespec
222 Display the contents of the inode structure of the inode
223 .IR filespec .
224 .TP
225 .I testb block
226 Test if the block number
227 .I block
228 is marked as allocated in the block bitmap.
229 .TP
230 .I testi filespec
231 Test if the inode 
232 .I filespec
233 is marked as allocated in the inode bitmap.
234 .TP
235 .I unlink pathname
236 Remove the link specified by 
237 .I pathname 
238 to an inode.  Note this does not adjust the inode reference counts.
239 .TP
240 .I write source_file out_file
241 Create a file in the filesystem named
242 .IR out_file ,
243 and copy the contents of
244 .I source_file
245 into the destination file.
246 .SH SPECIFYING FILES
247 Many
248 .B debugfs
249 commands take a
250 .I filespec
251 as an argument to specify an inode (as opposed to a pathname) 
252 in the filesystem which is currently opened by 
253 .BR debugfs . 
254 The
255 .I filespec
256 argument may be specified in two forms.  The first form is an inode 
257 number surrounded by angle brackets, e.g., 
258 .IR <2> .
259 The second form is a pathname; if the pathname is prefixed by a forward slash
260 ('/'), then it is interpreted relative to the root of the filesystem 
261 which is currently opened by 
262 .BR debugfs .
263 If not, the pathname is 
264 interpreted relative to the current working directory as maintained by 
265 .BR debugfs .  
266 This may be modified by using the 
267 .B debugfs
268 command
269 .IR cd .
270 .SH AUTHOR
271 .B debugfs
272 was written by Theodore Ts'o <tytso@mit.edu>.
273 .SH SEE ALSO
274 .BR dumpe2fs (8),
275 .BR e2fsck (8),
276 .BR mke2fs (8)