Penguin
Annotated edit history of debugfs(8) version 2, including all changes. View license author blame.
Rev Author # Line
1 perry 1 DEBUGFS
2 !!!DEBUGFS
3 NAME
4 SYNOPSIS
5 DESCRIPTION
6 OPTIONS
7 SPECIFYING FILES
8 COMMANDS
9 AUTHOR
10 SEE ALSO
11 ----
12 !!NAME
13
14
15 debugfs - ext2 file system debugger
16 !!SYNOPSIS
17
18
19 __debugfs__ [[ __-b__ blocksize ] [[ __-s__
20 superblock ] [[ __-f__ cmd_file ] [[ __-R__ request ] [[
21 __-V__ ] [[ [[ __-w__ ] [[ __-c__ ] [[ __-i__ ] [[
22 device ] ]
23 !!DESCRIPTION
24
25
26 The __debugfs__ program is an interactive file system
27 debugger. It can be used to examine and change the state of
28 an ext2 file system.''
29 device'' is the special file corresponding to the device
30 containing the ext2 file system (e.g
31 /dev/hdXX).
32 !!OPTIONS
33
34
35 ''-w''
36
37
38 Specifies that the file system should be opened in
39 read-write mode. Without this option, the file system is
40 opened in read-only mode.
41
42
43 ''-c''
44
45
46 Specifies that the file system should be opened in
47 catastrophic mode, in which the inode and group bitmaps are
48 not read initially. This can be useful for filesystems with
49 significant corruption, but because of this, catastrophic
50 mode forces the filesystem to be opened
51 read-only.
52
53
54 ''-i''
55
56
57 Specifies that ''device'' represents an ext2 image file
58 created by the __e2image__ program. Since the ext2 image
59 file only contains the superblock, block group descriptor,
60 block and inode allocation bitmaps, and the inode table,
61 many __debugfs__ commands will not function properly.
62 __Warning:__ no safety checks are in place, and
63 __debugfs__ may fail in interesting ways if commands such
64 as ''ls'', ''dump'', etc. are tried. __debugfs__ is
65 a debugging tool. It has rough edges!
66
67
68 ''-b blocksize''
69
70
71 Forces the use of the given block size for the file system,
72 rather than detecting the correct block size as
73 normal.
74
75
76 ''-s superblock''
77
78
79 Causes the file system superblock to be read from the given
80 block number, rather than the default (1). If you give a
81 ''-s'' option, you must also give a ''-b''
82 option.
83
84
85 ''-f cmd_file''
86
87
88 Causes __debugfs__ to read in commands from
89 ''cmd_file'', and execute them. When __debugfs__ is
90 finished executing those commands, it will
91 exit.
92
93
94 ''-R request''
95
96
97 Causes __debugfs__ to execute the single command
98 ''request'', and then exit.
99
100
101 ''-V''
102
103
104 print the version number of __debugfs__ and
105 exit.
106 !!SPECIFYING FILES
107
108
109 Many __debugfs__ commands take a ''filespec'' as an
110 argument to specify an inode (as opposed to a pathname) in
111 the filesystem which is currently opened by __debugfs__.
112 The ''filespec'' argument may be specified in two forms.
113 The first form is an inode number surrounded by angle
114 brackets, e.g., ''''. The second form is a
115 pathname; if the pathname is prefixed by a forward slash
116 ('/'), then it is interpreted relative to the root of the
117 filesystem which is currently opened by __debugfs__. If
118 not, the pathname is interpreted relative to the current
119 working directory as maintained by __debugfs__. This may
120 be modified by using the __debugfs__ command
121 ''cd''.
122 !!COMMANDS
123
124
125 This is a list of the commands which __debugfs__
126 supports.
127
128
129 ''cat filespec''
130
131
132 Dump the contents of the inode ''filespec'' to
133 stdout.
134
135
136 ''cd filespec''
137
138
139 Change the current working directory to
140 ''filespec''.
141
142
143 ''chroot filespec''
144
145
146 Change the root directory to be the directory
147 ''filespec''.
148
149
150 ''close''
151
152
153 Close the currently open file system.
154
155
156 ''clri file''
157
158
159 Clear the contents of the inode ''file''.
160
161
162 ''dump [[-p] filspec out_file''
163
164
165 Dump the contents of the inode ''filespec'' to the output
166 file ''out_file''. If the ''-p'' option is given set
167 the owner, group and permissions information on
168 ''out_file'' to match ''filespec''.
169
170
171 ''expand_dir filespec''
172
173
174 Expand the directory ''filespec''.
175
176
177 ''feature [[fs_feature] [[-fs_feature] ...''
178
179
180 Set or clear various filesystem features in the superblock.
181 After setting or clearing any filesystem features that were
182 requested, print the current state of the filesystem feature
183 set.
184
185
186 ''find_free_block [[count [[goal]]''
187
188
189 Find the first ''count'' free blocks, starting from
190 ''goal'' and allocate it.
191
192
193 ''find_free_inode [[dir [[mode]]''
194
195
196 Find a free inode and allocate it. If present, ''dir''
197 specifies the inode number of the directory which the inode
198 is to be located. The second optional argument ''mode''
199 specifies the permissions of the new inode. (If the
200 directory bit is set on the mode, the allocation routine
201 will function differently.)
202
203
204 ''freeb block [[count]''
205
206
207 Mark the block number ''block'' as not allocated. If the
208 optional argument ''count'' is present, then ''count''
209 blocks starting at block number ''block'' will be marked
210 as not allocated.
211
212
213 ''freei filespec''
214
215
216 Free the inode specified by ''filespec''.
217
218
219 ''help''
220
221
222 Print a list of commands understood by
223 debugfs(8).
224
225
226 ''icheck block ...''
227
228
229 Print a listing of the inodes which use the one or more
230 blocks specified on the command line.
231
232
233 ''initialize device blocksize''
234
235
236 Create an ext2 file system on ''device'' with device size
237 ''blocksize''. Note that this does not fully initialize
238 all of the data structures; to do this, use the
2 perry 239 mke2fs(8) program. This is just a call to the
1 perry 240 low-level library, which sets up the superblock and block
241 descriptors.
242
243
244 ''kill_file filespec''
245
246
247 Deallocate the inode ''filespec'' and its blocks. Note
248 that this does not remove any directory entries (if any) to
249 this inode. See the rm(1) command if you wish to
250 unlink a file.
251
252
253 ''lcd directory''
254
255
256 Change the current working directory of the __debugfs__
257 process to ''directory'' on the native
258 filesystem.
259
260
261 ''ln filespec dest_file''
262
263
264 Create a link named ''dest_file'' which is a link to
265 ''filespec''. Note this does not adjust the inode
266 reference counts.
267
268
269 ''logdump [[-ac] [[-b
270 ''
271
272
273 Dump the contents of the ext3 journal.
274
275
276 ''ls [[-l] [[-d] filespec''
277
278
279 Print a listing of the files in the directory
280 ''filespec''. The ''-l'' flag will list files using a
281 more verbose format. The ''-d'' flag will list deleted
282 entries in the directory.
283
284
285 ''modify_inode filespec''
286
287
288 Modify the contents of the inode structure in the inode
289 ''filespec''.
290
291
292 ''mkdir filespec''
293
294
295 Make a directory.
296
297
298 ''mknod filespec [[p|[[[[c|b] major minor]]''
299
300
301 Create a special device file (a named pipe, character or
302 block device). If a character or block device is to be made,
303 the ''major'' and ''minor'' device numbers must be
304 specified.
305
306
307 ''ncheck inode_num ...''
308
309
310 Take the requested list of inode numbers, and print a
311 listing of pathnames to those inodes.
312
313
314 ''open [[-w] [[-f] [[-i] [[-c] [[-b blocksize] [[-s superblock]
315 device''
316
317
318 Open a filesystem for editing. The ''-w'' flag causes the
319 filesystem to be opened for writing. The ''-f'' flag
320 forces the filesystem to be opened even if there are some
321 unknown or incompatible filesystem features which would
322 normally prevent the filesystem from being opened. The
323 ''-c'', ''-b'', ''-i'', ''and'' -s options
324 behave the same as those to __debugfs__
325 itself.
326
327
328 ''pwd''
329
330
331 Print the current working directory.
332
333
334 ''quit''
335
336
337 Quit __debugfs__
338
339
340 ''rdump directory destination''
341
342
343 Recursively dump ''directory'' and all its contents
344 (including regular files, symbolic links, and other
345 directories) into the named ''destination'' which should
346 be an existing directory on the native
347 filesystem.
348
349
350 ''rm pathname''
351
352
353 Unlink ''pathname''. If this causes the inode pointed to
354 by ''pathname'' to have no other references, deallocate
355 the file. This command functions as the unlink() system
356 call.
357
358
359 ''rmdir filespec''
360
361
362 Remove the directory ''filespec''. This function is
363 currently not implemented.
364
365
366 ''setb block [[count]''
367
368
369 Mark the block number ''block'' as allocated. If the
370 optional argument ''count'' is present, then ''count''
371 blocks starting at block number ''block'' will be marked
372 as allocated.
373
374
375 ''seti filespec''
376
377
378 Mark inode ''filespec'' as in use in the inode
379 bitmap.
380
381
382 ''set_super_value field value''
383
384
385 Set the superblock field ''field'' to ''value.'' The
386 list of valid superblock fields which can be set via this
387 command can be displayed by using the command:
388 __set_super_value -l__
389
390
391 ''show_super_stats [[-h]''
392
393
394 List the contents of the super block and the block group
395 descriptors. If the ''-h'' flag is given, only print out
396 the superblock contents.
397
398
399 ''stat filespec''
400
401
402 Display the contents of the inode structure of the inode
403 ''filespec''.
404
405
406 ''testb block [[count]''
407
408
409 Test if the block number ''block'' is marked as allocated
410 in the block bitmap. If the optional argument ''count''
411 is present, then ''count'' blocks starting at block
412 number ''block'' will be tested.
413
414
415 ''testi filespec''
416
417
418 Test if the inode ''filespec'' is marked as allocated in
419 the inode bitmap.
420
421
422 ''unlink pathname''
423
424
425 Remove the link specified by ''pathname'' to an inode.
426 Note this does not adjust the inode reference
427 counts.
428
429
430 ''write source_file out_file''
431
432
433 Create a file in the filesystem named ''out_file'', and
434 copy the contents of ''source_file'' into the destination
435 file.
436 !!AUTHOR
437
438
439 __debugfs__ was written by Theodore Ts'o
440 __
441 !!SEE ALSO
442
443
2 perry 444 dumpe2fs(8), __e2fsck__(8),
445 mke2fs(8)
1 perry 446 ----
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.