Whamcloud - gitweb
build: update version to 1.45.6.wc7
[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/ext3/ext4 file system debugger
8 .SH SYNOPSIS
9 .B debugfs
10 [
11 .B \-DVwcin
12 ]
13 [
14 .B \-b
15 blocksize
16 ]
17 [
18 .B \-s
19 superblock
20 ]
21 [
22 .B \-f
23 cmd_file
24 ]
25 [
26 .B \-R
27 request
28 ]
29 [
30 .B \-d
31 data_source_device
32 ]
33 [
34 .B \-z
35 .I undo_file
36 ]
37 [
38 device
39 ]
40 .SH DESCRIPTION
41 The
42 .B debugfs
43 program is an interactive file system debugger. It can be used to
44 examine and change the state of an ext2, ext3, or ext4 file system.
45 .PP
46 .I device
47 is a block device (e.g., /dev/sdXX) or a file containing the file system.
48 .SH OPTIONS
49 .TP
50 .I \-w
51 Specifies that the file system should be opened in read-write mode.
52 Without this option, the file system is opened in read-only mode.
53 .TP
54 .I \-n
55 Disables metadata checksum verification.  This should only be used if
56 you believe the metadata to be correct despite the complaints of
57 e2fsprogs.
58 .TP
59 .I \-c
60 Specifies that the file system should be opened in catastrophic mode, in
61 which the inode and group bitmaps are not read initially.  This can be
62 useful for filesystems with significant corruption, but because of this,
63 catastrophic mode forces the filesystem to be opened read-only.
64 .TP
65 .I \-i
66 Specifies that
67 .I device
68 represents an ext2 image file created by the
69 .B e2image
70 program.  Since the ext2 image file only contains the superblock, block
71 group descriptor, block and inode allocation bitmaps, and
72 the inode table, many
73 .B debugfs
74 commands will not function properly.
75 .B Warning:
76 no safety checks are in place, and
77 .B debugfs
78 may fail in interesting ways if commands such as
79 .IR ls ", " dump ", "
80 etc. are tried without specifying the
81 .I data_source_device
82 using the
83 .I \-d
84 option.
85 .B debugfs
86 is a debugging tool.  It has rough edges!
87 .TP
88 .I -d data_source_device
89 Used with the
90 .I \-i
91 option, specifies that
92 .I data_source_device
93 should be used when reading blocks not found in the ext2 image file.
94 This includes data, directory, and indirect blocks.
95 .TP
96 .I -b blocksize
97 Forces the use of the given block size (in bytes) for the file system,
98 rather than detecting the correct block size automatically.  (This
99 option is rarely needed; it is used primarily when the file system is
100 extremely badly damaged/corrupted.)
101 .TP
102 .I -s superblock
103 Causes the file system superblock to be read from the given block
104 number, instead of using the primary superblock (located at an offset of
105 1024 bytes from the beginning of the filesystem).  If you specify the
106 .I -s
107 option, you must also provide the blocksize of the filesystem via the
108 .I -b
109 option.   (This
110 option is rarely needed; it is used primarily when the file system is
111 extremely badly damaged/corrupted.)
112 .TP
113 .I -f cmd_file
114 Causes
115 .B debugfs
116 to read in commands from
117 .IR cmd_file ,
118 and execute them.  When
119 .B debugfs
120 is finished executing those commands, it will exit.
121 .TP
122 .I -D
123 Causes
124 .B debugfs
125 to open the device using Direct I/O, bypassing the buffer cache.  Note
126 that some Linux devices, notably device mapper as of this writing, do
127 not support Direct I/O.
128 .TP
129 .I -R request
130 Causes
131 .B debugfs
132 to execute the single command
133 .IR request ,
134 and then exit.
135 .TP
136 .I -V
137 print the version number of
138 .B debugfs
139 and exit.
140 .TP
141 .BI \-z " undo_file"
142 Before overwriting a file system block, write the old contents of the block to
143 an undo file.  This undo file can be used with e2undo(8) to restore the old
144 contents of the file system should something go wrong.  If the empty string is
145 passed as the undo_file argument, the undo file will be written to a file named
146 debugfs-\fIdevice\fR.e2undo in the directory specified via the
147 \fIE2FSPROGS_UNDO_DIR\fR environment variable.
148
149 WARNING: The undo file cannot be used to recover from a power or system crash.
150 .SH SPECIFYING FILES
151 Many
152 .B debugfs
153 commands take a
154 .I filespec
155 as an argument to specify an inode (as opposed to a pathname)
156 in the filesystem which is currently opened by
157 .BR debugfs .
158 The
159 .I filespec
160 argument may be specified in two forms.  The first form is an inode
161 number surrounded by angle brackets, e.g.,
162 .IR <2> .
163 The second form is a pathname; if the pathname is prefixed by a forward slash
164 ('/'), then it is interpreted relative to the root of the filesystem
165 which is currently opened by
166 .BR debugfs .
167 If not, the pathname is
168 interpreted relative to the current working directory as maintained by
169 .BR debugfs .
170 This may be modified by using the
171 .B debugfs
172 command
173 .IR cd .
174 .\"
175 .\"
176 .\"
177 .SH COMMANDS
178 This is a list of the commands which
179 .B debugfs
180 supports.
181 .TP
182 .BI blocks " filespec"
183 Print the blocks used by the inode
184 .I filespec
185 to stdout.
186 .TP
187 .BI bmap " [ -a ] filespec logical_block [physical_block]"
188 Print or set the physical block number corresponding to the logical block number
189 .I logical_block
190 in the inode
191 .IR filespec .
192 If the
193 .I \-a
194 flag is specified, try to allocate a block if necessary.
195 .TP
196 .BI block_dump " '[ -x ] [-f filespec] block_num"
197 Dump the filesystem block given by
198 .I block_num
199 in hex and ASCII format to the console.  If the
200 .I \-f
201 option is specified, the block number is relative to the start of the given
202 .BR filespec .
203 If the
204 .I \-x
205 option is specified, the block is interpreted as an extended attribute
206 block and printed to show the structure of extended attribute data
207 structures.
208 .TP
209 .BI cat " filespec"
210 Dump the contents of the inode
211 .I filespec
212 to stdout.
213 .TP
214 .BI cd " filespec"
215 Change the current working directory to
216 .IR filespec .
217 .TP
218 .BI chroot " filespec"
219 Change the root directory to be the directory
220 .IR filespec .
221 .TP
222 .BI close " [-a]"
223 Close the currently open file system.  If the
224 .I -a
225 option is specified, write out any changes to the superblock and block
226 group descriptors to all of the backup superblocks, not just to the
227 master superblock.
228 .TP
229 .BI clri " filespec"
230 Clear the contents of the inode
231 .IR filespec .
232 .TP
233 .BI copy_inode " source_inode destination_inode"
234 Copy the contents of the inode structure in
235 .I source_inode
236 and use it to overwrite the inode structure at
237 .IR destination_inode .
238 .TP
239 .BI dirsearch " filespec filename"
240 Search the directory
241 .I filespec
242 for
243 .IR filename .
244 .TP
245 .BI dirty " [-clean]"
246 Mark the filesystem as dirty, so that the superblocks will be written on exit.
247 Additionally, clear the superblock's valid flag, or set it if
248 .I -clean
249 is specified.
250 .TP
251 .BI dump " [-p] filespec out_file"
252 Dump the contents of the inode
253 .I filespec
254 to the output file
255 .IR out_file .
256 If the
257 .I -p
258 option is given set the owner, group and permissions information on
259 .I out_file
260 to match
261 .IR filespec .
262 .TP
263 .BI dump_mmp " [mmp_block]"
264 Display the multiple-mount protection (mmp) field values.  If
265 .I mmp_block
266 is specified then verify and dump the MMP values from the given block
267 number, otherwise use the
268 .B s_mmp_block
269 field in the superblock to locate and use the existing MMP block.
270 .TP
271 .BI dx_hash " [-h hash_alg] [-s hash_seed] filename"
272 Calculate the directory hash of
273 .IR filename .
274 The hash algorithm specified with
275 .I -h
276 may be
277 .BR legacy , " half_md4" ", or " tea .
278 The hash seed specified with
279 .I -s
280 must be in UUID format.
281 .TP
282 .BI dump_extents " [-n] [-l] filespec"
283 Dump the the extent tree of the inode
284 .IR filespec .
285 The
286 .I -n
287 flag will cause
288 .B dump_extents
289 to only display the interior nodes in the extent tree.   The
290 .I -l
291 flag will cause
292 .B dump_extents
293 to only display the leaf nodes in the extent tree.
294 .IP
295 (Please note that the length and range of blocks for the last extent in
296 an interior node is an estimate by the extents library functions, and is
297 not stored in filesystem data structures.   Hence, the values displayed
298 may not necessarily by accurate and does not indicate a problem or
299 corruption in the file system.)
300 .TP
301 .B dump_unused
302 Dump unused blocks which contain non-null bytes.
303 .TP
304 .BI ea_get " [-f outfile]|[-xVC] [-r] filespec attr_name"
305 Retrieve the value of the extended attribute
306 .I attr_name
307 in the file
308 .I filespec
309 and write it either to stdout or to \fIoutfile\fR.
310 .TP
311 .BI ea_list " filespec
312 List the extended attributes associated with the file
313 .I filespec
314 to standard output.
315 .TP
316 .BI ea_set " [-f infile] [-r] filespec attr_name attr_value
317 Set the value of the extended attribute
318 .I attr_name
319 in the file
320 .I filespec
321 to the string value
322 .I attr_value
323 or read it from \fIinfile\fR.
324 .TP
325 .BI ea_rm " filespec attr_names...
326 Remove the extended attribute
327 .I attr_name
328 from the file \fIfilespec\fR.
329 .TP
330 .BI expand_dir " filespec"
331 Expand the directory
332 .IR filespec .
333 .TP
334 .BI fallocate " filespec start_block [end_block]
335 Allocate and map uninitialized blocks into \fIfilespec\fR between
336 logical block \fIstart_block\fR and \fIend_block\fR, inclusive.  If
337 \fIend_block\fR is not supplied, this function maps until it runs out
338 of free disk blocks or the maximum file size is reached.  Existing
339 mappings are left alone.
340 .TP
341 .BI feature " [fs_feature] [-fs_feature] ..."
342 Set or clear various filesystem features in the superblock.  After setting
343 or clearing any filesystem features that were requested, print the current
344 state of the filesystem feature set.
345 .TP
346 .BI filefrag " [-dvr] filespec"
347 Print the number of contiguous extents in
348 .IR filespec .
349 If
350 .I filespec
351 is a directory and the
352 .I -d
353 option is not specified,
354 .I filefrag
355 will print the number of contiguous extents for each file in
356 the directory.  The
357 .I -v
358 option will cause
359 .I filefrag
360 print a tabular listing of the contiguous extents in the
361 file.  The
362 .I -r
363 option will cause
364 .I filefrag
365 to do a recursive listing of the directory.
366 .TP
367 .BI find_free_block " [count [goal]]"
368 Find the first
369 .I count
370 free blocks, starting from
371 .I goal
372 and allocate it.  Also available as
373 .BR ffb .
374 .TP
375 .BI find_free_inode " [dir [mode]]"
376 Find a free inode and allocate it.  If present,
377 .I dir
378 specifies the inode number of the directory
379 which the inode is to be located.  The second
380 optional argument
381 .I mode
382 specifies the permissions of the new inode.  (If the directory bit is set
383 on the mode, the allocation routine will function differently.)  Also
384 available as
385 .BR ffi .
386 .TP
387 .BI freeb " block [count]"
388 Mark the block number
389 .I block
390 as not allocated.
391 If the optional argument
392 .I count
393 is present, then
394 .I count
395 blocks starting at block number
396 .I block
397 will be marked as not allocated.
398 .TP
399 .BI freefrag " [-c chunk_kb]"
400 Report free space fragmentation on the currently open file system.
401 If the
402 .I \-c
403 option is specified then the filefrag command will print how many free
404 chunks of size
405 .I chunk_kb
406 can be found in the file system.  The chunk size must be a power of two
407 and be larger than the file system block size.
408 .TP
409 .BI freei " filespec [num]"
410 Free the inode specified by
411 .IR filespec .
412 If
413 .I num
414 is specified, also clear num-1 inodes after the specified inode.
415 .TP
416 .BI get_quota " quota_type id"
417 Display quota information for given quota type (user, group, or project) and ID.
418 .TP
419 .B help
420 Print a list of commands understood by
421 .BR debugfs .
422 .TP
423 .BI htree_dump " filespec"
424 Dump the hash-indexed directory
425 .IR filespec ,
426 showing its tree structure.
427 .TP
428 .BI icheck " block ..."
429 Print a listing of the inodes which use the one or more blocks specified
430 on the command line.
431 .TP
432 .BI inode_dump " [-b]|[-e]|[-x] filespec"
433 Print the contents of the inode data structure in hex and ASCII format.
434 The
435 .I \-b
436 option causes the command to only dump the contents of the
437 .B i_blocks
438 array.  The
439 .I \-e
440 option causes the command to only dump the contents of the extra inode
441 space, which is used to store in-line extended attributes. The
442 .I \-x
443 option causes the command to dump the extra inode space interpreted and
444 extended attributes.  This is useful to debug corrupted inodes
445 containing extended attributes.
446 .TP
447 .BI imap " filespec"
448 Print the location of the inode data structure (in the inode table)
449 of the inode
450 .IR filespec .
451 .TP
452 .BI init_filesys " device blocksize"
453 Create an ext2 file system on
454 .I device
455 with device size
456 .IR blocksize .
457 Note that this does not fully initialize all of the data structures;
458 to do this, use the
459 .BR mke2fs (8)
460 program.  This is just a call to the low-level library, which sets up
461 the superblock and block descriptors.
462 .TP
463 .BI journal_close
464 Close the open journal.
465 .TP
466 .BI journal_open " [-c] [-v ver] [-f ext_jnl]
467 Opens the journal for reading and writing.  Journal checksumming can
468 be enabled by supplying \fI-c\fR; checksum formats 2 and 3 can be
469 selected with the \fI-v\fR option.  An external journal can be loaded
470 from \fIext_jnl\fR.
471 .TP
472 .BI journal_run
473 Replay all transactions in the open journal.
474 .TP
475 .BI journal_write " [-b blocks] [-r revoke] [-c] file
476 Write a transaction to the open journal.  The list of blocks to write
477 should be supplied as a comma-separated list in \fIblocks\fR; the
478 blocks themselves should be readable from \fIfile\fR.  A list of
479 blocks to revoke can be supplied as a comma-separated list in
480 \fIrevoke\fR.  By default, a commit record is written at the end; the
481 \fI-c\fR switch writes an uncommitted transaction.
482 .TP
483 .BI kill_file " filespec"
484 Deallocate the inode
485 .I filespec
486 and its blocks.  Note that this does not remove any directory
487 entries (if any) to this inode.  See the
488 .BR rm (1)
489 command if you wish to unlink a file.
490 .TP
491 .BI lcd " directory"
492 Change the current working directory of the
493 .B debugfs
494 process to
495 .I directory
496 on the native filesystem.
497 .TP
498 .BI list_quota " quota_type"
499 Display quota information for given quota type (user, group, or project).
500 .TP
501 .BI ln " filespec dest_file"
502 Create a link named
503 .I dest_file
504 which is a hard link to
505 .IR filespec .
506 Note this does not adjust the inode reference counts.
507 .TP
508 .BI logdump " [-acsOS] [-b block] [-i filespec] [-f journal_file] [output_file]"
509 Dump the contents of the ext3 journal.  By default, dump the journal inode as
510 specified in the superblock.  However, this can be overridden with the
511 .I \-i
512 option, which dumps the journal from the internal inode given by
513 .IR filespec .
514 A regular file containing journal data can be specified using the
515 .I \-f
516 option.  Finally, the
517 .I \-s
518 option utilizes the backup information in the superblock to locate the
519 journal.
520 .IP
521 The
522 .I \-S
523 option causes
524 .B logdump
525 to print the contents of the journal superblock.
526 .IP
527 The
528 .I \-a
529 option causes the
530 .B logdump
531 program to print the contents of all of the descriptor blocks.
532 The
533 .I \-b
534 option causes
535 .B logdump
536 to print all journal records that refer to the specified block.
537 The
538 .I \-c
539 option will print out the contents of all of the data blocks selected by
540 the
541 .I \-a
542 and
543 .I \-b
544 options.
545 .IP
546 The
547 .I \-O
548 option causes logdump to display old (checkpointed) journal entries.
549 This can be used to try to track down journal problems even after the
550 journal has been replayed.
551 .TP
552 .BI ls " [-l] [-c] [-d] [-p] [-r] [-D] filespec"
553 Print a listing of the files in the directory
554 .IR filespec .
555 The
556 .I \-c
557 flag causes directory block checksums (if present) to be displayed.
558 The
559 .I \-d
560 flag will list deleted entries in the directory.
561 The
562 .I \-l
563 flag will list files using a more verbose format.
564 The
565 .I \-p
566 flag will list the files in a format which is more easily parsable by
567 scripts, as well as making it more clear when there are spaces or other
568 non-printing characters at the end of filenames.
569 The
570 .I \-r
571 flag will force the printing of the filename, even if it is encrypted.
572 The
573 .I \-D
574 flag will print the extra data found inside each entry when the
575 .I \-l
576 flag is used.
577 .TP
578 .BI list_deleted_inodes " [limit]"
579 List deleted inodes, optionally limited to those deleted within
580 .I limit
581 seconds ago.  Also available as
582 .BR lsdel .
583 .IP
584 This command was useful for recovering from accidental file deletions
585 for ext2 file systems.  Unfortunately, it is not useful for this purpose
586 if the files were deleted using ext3 or ext4, since the inode's
587 data blocks are no longer available after the inode is released.
588 .TP
589 .BI modify_inode " filespec"
590 Modify the contents of the inode structure in the inode
591 .IR filespec .
592 Also available as
593 .BR mi .
594 .TP
595 .BI mkdir " filespec"
596 Make a directory.
597 .TP
598 .BI mknod " filespec [p|[[c|b] major minor]]"
599 Create a special device file (a named pipe, character or block device).
600 If a character or block device is to be made, the
601 .I major
602 and
603 .I minor
604 device numbers must be specified.
605 .TP
606 .BI ncheck " [-c] inode_num ..."
607 Take the requested list of inode numbers, and print a listing of pathnames
608 to those inodes.  The
609 .I -c
610 flag will enable checking the file type information in the directory
611 entry to make sure it matches the inode's type.
612 .TP
613 .BI open " [-weficD] [-b blocksize] [-d image_filename] [-s superblock] [-z undo_file] device"
614 Open a filesystem for editing.  The
615 .I -f
616 flag forces the filesystem to be opened even if there are some unknown
617 or incompatible filesystem features which would normally
618 prevent the filesystem from being opened.  The
619 .I -e
620 flag causes the filesystem to be opened in exclusive mode.  The
621 .IR -b ", " -c ", " -d ", " -i ", " -s ", " -w ", and " -D
622 options behave the same as the command-line options to
623 .BR debugfs .
624 .TP
625 .BI punch " filespec start_blk [end_blk]"
626 Delete the blocks in the inode ranging from
627 .I start_blk
628 to
629 .IR end_blk .
630 If
631 .I end_blk
632 is omitted then this command will function as a truncate command; that
633 is, all of the blocks starting at
634 .I start_blk
635 through to the end of the file will be deallocated.
636 .TP
637 .BI symlink " filespec target"
638 Make a symbolic link.
639 .TP
640 .B pwd
641 Print the current working directory.
642 .TP
643 .B quit
644 Quit
645 .B debugfs
646 .TP
647 .BI rdump " directory[...] destination"
648 Recursively dump
649 .IR directory ,
650 or multiple
651 .IR directories ,
652 and all its contents (including regular files, symbolic links, and other
653 directories) into the named
654 .IR destination ,
655 which should be an existing directory on the native filesystem.
656 .TP
657 .BI rm " pathname"
658 Unlink
659 .IR pathname .
660 If this causes the inode pointed to by
661 .I pathname
662 to have no other references, deallocate the file.  This command functions
663 as the unlink() system call.
664 .I
665 .TP
666 .BI rmdir " filespec"
667 Remove the directory
668 .IR filespec .
669 .TP
670 .BI setb " block [count]"
671 Mark the block number
672 .I block
673 as allocated.
674 If the optional argument
675 .I count
676 is present, then
677 .I count
678 blocks starting at block number
679 .I block
680 will be marked as allocated.
681 .TP
682 .BI set_block_group " bgnum field value"
683 Modify the block group descriptor specified by
684 .I bgnum
685 so that the block group descriptor field
686 .I field
687 has value
688 .IR value .
689 Also available as
690 .BR set_bg .
691 .TP
692 .BI set_current_time " time"
693 Set current time in seconds since Unix epoch to use when setting filesystem
694 fields.
695 .TP
696 .BI seti " filespec [num]"
697 Mark inode
698 .I filespec
699 as in use in the inode bitmap.  If
700 .I num
701 is specified, also set num-1 inodes after the specified inode.
702 .TP
703 .BI set_inode_field " filespec field value"
704 Modify the inode specified by
705 .I filespec
706 so that the inode field
707 .I field
708 has value
709 .I value.
710 The list of valid inode fields which can be set via this command
711 can be displayed by using the command:
712 .B set_inode_field -l
713 Also available as
714 .BR sif .
715 .TP
716 .BI set_mmp_value " field value"
717 Modify the multiple-mount protection (MMP) data so that the MMP field
718 .I field
719 has value
720 .I value.
721 The list of valid MMP fields which can be set via this command
722 can be displayed by using the command:
723 .B set_mmp_value -l
724 Also available as
725 .BR smmp .
726 .TP
727 .BI set_super_value " field value"
728 Set the superblock field
729 .I field
730 to
731 .I value.
732 The list of valid superblock fields which can be set via this command
733 can be displayed by using the command:
734 .B set_super_value -l
735 Also available as
736 .BR ssv .
737 .TP
738 .B show_debugfs_params
739 Display
740 .B debugfs
741 parameters such as information about currently opened filesystem.
742 .TP
743 .BI show_super_stats " [-h]"
744 List the contents of the super block and the block group descriptors.  If the
745 .I -h
746 flag is given, only print out the superblock contents. Also available as
747 .BR stats .
748 .TP
749 .BI stat " filespec"
750 Display the contents of the inode structure of the inode
751 .IR filespec .
752 .TP
753 .B supported_features
754 Display filesystem features supported by this version of
755 .BR debugfs .
756 .TP
757 .BI testb " block [count]"
758 Test if the block number
759 .I block
760 is marked as allocated in the block bitmap.
761 If the optional argument
762 .I count
763 is present, then
764 .I count
765 blocks starting at block number
766 .I block
767 will be tested.
768 .TP
769 .BI testi " filespec"
770 Test if the inode
771 .I filespec
772 is marked as allocated in the inode bitmap.
773 .TP
774 .BI undel " <inode_number> [pathname]"
775 Undelete the specified inode number (which must be surrounded by angle
776 brackets) so that it and its blocks are marked in use, and optionally
777 link the recovered inode to the specified pathname.  The
778 .B e2fsck
779 command should always be run after using the
780 .B undel
781 command to recover deleted files.
782 .IP
783 Note that if you are recovering a large number of deleted files, linking
784 the inode to a directory may require the directory to be expanded, which
785 could allocate a block that had been used by one of the
786 yet-to-be-undeleted files.  So it is safer to undelete all of the
787 inodes without specifying a destination pathname, and then in a separate
788 pass, use the debugfs
789 .B link
790 command to link the inode to the destination pathname, or use
791 .B e2fsck
792 to check the filesystem and link all of the recovered inodes to the
793 lost+found directory.
794 .TP
795 .BI unlink " pathname"
796 Remove the link specified by
797 .I pathname
798 to an inode.  Note this does not adjust the inode reference counts.
799 .TP
800 .BI write " source_file out_file"
801 Copy the contents of
802 .I source_file
803 into a newly-created file in the filesystem named
804 .IR out_file .
805 .TP
806 .BI zap_block " [-f filespec] [-o offset] [-l length] [-p pattern] block_num"
807 Overwrite the block specified by
808 .I block_num
809 with zero (NUL) bytes, or if
810 .I -p
811 is given use the byte specified by
812 .IR pattern .
813 If
814 .I -f
815 is given then
816 .I block_num
817 is relative to the start of the file given by
818 .IR filespec .
819 The
820 .I -o
821 and
822 .I -l
823 options limit the range of bytes to zap to the specified
824 .I offset
825 and
826 .I length
827 relative to the start of the block.
828 .TP
829 .BI zap_block " [-f filespec] [-b bit] block_num"
830 Bit-flip portions of the physical
831 .IR block_num .
832 If
833 .I -f
834 is given, then
835 .I block_num
836 is a logical block relative to the start of
837 .IR filespec .
838 .SH ENVIRONMENT VARIABLES
839 .TP
840 .B DEBUGFS_PAGER, PAGER
841 The
842 .B debugfs
843 program always pipes the output of the some commands through a
844 pager program.  These commands include:
845 .IR show_super_stats " (" stats ),
846 .IR list_directory " (" ls ),
847 .IR show_inode_info " (" stat ),
848 .IR list_deleted_inodes " (" lsdel ),
849 and
850 .IR htree_dump .
851 The specific pager can explicitly specified by the
852 .B DEBUGFS_PAGER
853 environment variable, and if it is not set, by the
854 .B PAGER
855 environment variable.
856 .IP
857 Note that since a pager is always used, the
858 .BR less (1)
859 pager is not particularly appropriate, since it clears the screen before
860 displaying the output of the command and clears the output the screen
861 when the pager is exited.  Many users prefer to use the
862 .BR less (1)
863 pager for most purposes, which is why the
864 .B DEBUGFS_PAGER
865 environment variable is available to override the more general
866 .B PAGER
867 environment variable.
868 .SH AUTHOR
869 .B debugfs
870 was written by Theodore Ts'o <tytso@mit.edu>.
871 .SH SEE ALSO
872 .BR dumpe2fs (8),
873 .BR tune2fs (8),
874 .BR e2fsck (8),
875 .BR mke2fs (8),
876 .BR ext4 (5)