]> git.ipfire.org Git - thirdparty/e2fsprogs.git/blob - debugfs/debugfs.8.in
Drop use of -pedantic when doing gcc-wall
[thirdparty/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] 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 .TP
573 .BI list_deleted_inodes " [limit]"
574 List deleted inodes, optionally limited to those deleted within
575 .I limit
576 seconds ago. Also available as
577 .BR lsdel .
578 .IP
579 This command was useful for recovering from accidental file deletions
580 for ext2 file systems. Unfortunately, it is not useful for this purpose
581 if the files were deleted using ext3 or ext4, since the inode's
582 data blocks are no longer available after the inode is released.
583 .TP
584 .BI modify_inode " filespec"
585 Modify the contents of the inode structure in the inode
586 .IR filespec .
587 Also available as
588 .BR mi .
589 .TP
590 .BI mkdir " filespec"
591 Make a directory.
592 .TP
593 .BI mknod " filespec [p|[[c|b] major minor]]"
594 Create a special device file (a named pipe, character or block device).
595 If a character or block device is to be made, the
596 .I major
597 and
598 .I minor
599 device numbers must be specified.
600 .TP
601 .BI ncheck " [-c] inode_num ..."
602 Take the requested list of inode numbers, and print a listing of pathnames
603 to those inodes. The
604 .I -c
605 flag will enable checking the file type information in the directory
606 entry to make sure it matches the inode's type.
607 .TP
608 .BI open " [-weficD] [-b blocksize] [-d image_filename] [-s superblock] [-z undo_file] device"
609 Open a filesystem for editing. The
610 .I -f
611 flag forces the filesystem to be opened even if there are some unknown
612 or incompatible filesystem features which would normally
613 prevent the filesystem from being opened. The
614 .I -e
615 flag causes the filesystem to be opened in exclusive mode. The
616 .IR -b ", " -c ", " -d ", " -i ", " -s ", " -w ", and " -D
617 options behave the same as the command-line options to
618 .BR debugfs .
619 .TP
620 .BI punch " filespec start_blk [end_blk]"
621 Delete the blocks in the inode ranging from
622 .I start_blk
623 to
624 .IR end_blk .
625 If
626 .I end_blk
627 is omitted then this command will function as a truncate command; that
628 is, all of the blocks starting at
629 .I start_blk
630 through to the end of the file will be deallocated.
631 .TP
632 .BI symlink " filespec target"
633 Make a symbolic link.
634 .TP
635 .B pwd
636 Print the current working directory.
637 .TP
638 .B quit
639 Quit
640 .B debugfs
641 .TP
642 .BI rdump " directory[...] destination"
643 Recursively dump
644 .IR directory ,
645 or multiple
646 .IR directories ,
647 and all its contents (including regular files, symbolic links, and other
648 directories) into the named
649 .IR destination ,
650 which should be an existing directory on the native filesystem.
651 .TP
652 .BI rm " pathname"
653 Unlink
654 .IR pathname .
655 If this causes the inode pointed to by
656 .I pathname
657 to have no other references, deallocate the file. This command functions
658 as the unlink() system call.
659 .I
660 .TP
661 .BI rmdir " filespec"
662 Remove the directory
663 .IR filespec .
664 .TP
665 .BI setb " block [count]"
666 Mark the block number
667 .I block
668 as allocated.
669 If the optional argument
670 .I count
671 is present, then
672 .I count
673 blocks starting at block number
674 .I block
675 will be marked as allocated.
676 .TP
677 .BI set_block_group " bgnum field value"
678 Modify the block group descriptor specified by
679 .I bgnum
680 so that the block group descriptor field
681 .I field
682 has value
683 .IR value .
684 Also available as
685 .BR set_bg .
686 .TP
687 .BI set_current_time " time"
688 Set current time in seconds since Unix epoch to use when setting filesystem
689 fields.
690 .TP
691 .BI seti " filespec [num]"
692 Mark inode
693 .I filespec
694 as in use in the inode bitmap. If
695 .I num
696 is specified, also set num-1 inodes after the specified inode.
697 .TP
698 .BI set_inode_field " filespec field value"
699 Modify the inode specified by
700 .I filespec
701 so that the inode field
702 .I field
703 has value
704 .I value.
705 The list of valid inode fields which can be set via this command
706 can be displayed by using the command:
707 .B set_inode_field -l
708 Also available as
709 .BR sif .
710 .TP
711 .BI set_mmp_value " field value"
712 Modify the multiple-mount protection (MMP) data so that the MMP field
713 .I field
714 has value
715 .I value.
716 The list of valid MMP fields which can be set via this command
717 can be displayed by using the command:
718 .B set_mmp_value -l
719 Also available as
720 .BR smmp .
721 .TP
722 .BI set_super_value " field value"
723 Set the superblock field
724 .I field
725 to
726 .I value.
727 The list of valid superblock fields which can be set via this command
728 can be displayed by using the command:
729 .B set_super_value -l
730 Also available as
731 .BR ssv .
732 .TP
733 .B show_debugfs_params
734 Display
735 .B debugfs
736 parameters such as information about currently opened filesystem.
737 .TP
738 .BI show_super_stats " [-h]"
739 List the contents of the super block and the block group descriptors. If the
740 .I -h
741 flag is given, only print out the superblock contents. Also available as
742 .BR stats .
743 .TP
744 .BI stat " filespec"
745 Display the contents of the inode structure of the inode
746 .IR filespec .
747 .TP
748 .B supported_features
749 Display filesystem features supported by this version of
750 .BR debugfs .
751 .TP
752 .BI testb " block [count]"
753 Test if the block number
754 .I block
755 is marked as allocated in the block bitmap.
756 If the optional argument
757 .I count
758 is present, then
759 .I count
760 blocks starting at block number
761 .I block
762 will be tested.
763 .TP
764 .BI testi " filespec"
765 Test if the inode
766 .I filespec
767 is marked as allocated in the inode bitmap.
768 .TP
769 .BI undel " <inode_number> [pathname]"
770 Undelete the specified inode number (which must be surrounded by angle
771 brackets) so that it and its blocks are marked in use, and optionally
772 link the recovered inode to the specified pathname. The
773 .B e2fsck
774 command should always be run after using the
775 .B undel
776 command to recover deleted files.
777 .IP
778 Note that if you are recovering a large number of deleted files, linking
779 the inode to a directory may require the directory to be expanded, which
780 could allocate a block that had been used by one of the
781 yet-to-be-undeleted files. So it is safer to undelete all of the
782 inodes without specifying a destination pathname, and then in a separate
783 pass, use the debugfs
784 .B link
785 command to link the inode to the destination pathname, or use
786 .B e2fsck
787 to check the filesystem and link all of the recovered inodes to the
788 lost+found directory.
789 .TP
790 .BI unlink " pathname"
791 Remove the link specified by
792 .I pathname
793 to an inode. Note this does not adjust the inode reference counts.
794 .TP
795 .BI write " source_file out_file"
796 Copy the contents of
797 .I source_file
798 into a newly-created file in the filesystem named
799 .IR out_file .
800 .TP
801 .BI zap_block " [-f filespec] [-o offset] [-l length] [-p pattern] block_num"
802 Overwrite the block specified by
803 .I block_num
804 with zero (NUL) bytes, or if
805 .I -p
806 is given use the byte specified by
807 .IR pattern .
808 If
809 .I -f
810 is given then
811 .I block_num
812 is relative to the start of the file given by
813 .IR filespec .
814 The
815 .I -o
816 and
817 .I -l
818 options limit the range of bytes to zap to the specified
819 .I offset
820 and
821 .I length
822 relative to the start of the block.
823 .TP
824 .BI zap_block " [-f filespec] [-b bit] block_num"
825 Bit-flip portions of the physical
826 .IR block_num .
827 If
828 .I -f
829 is given, then
830 .I block_num
831 is a logical block relative to the start of
832 .IR filespec .
833 .SH ENVIRONMENT VARIABLES
834 .TP
835 .B DEBUGFS_PAGER, PAGER
836 The
837 .B debugfs
838 program always pipes the output of the some commands through a
839 pager program. These commands include:
840 .IR show_super_stats " (" stats ),
841 .IR list_directory " (" ls ),
842 .IR show_inode_info " (" stat ),
843 .IR list_deleted_inodes " (" lsdel ),
844 and
845 .IR htree_dump .
846 The specific pager can explicitly specified by the
847 .B DEBUGFS_PAGER
848 environment variable, and if it is not set, by the
849 .B PAGER
850 environment variable.
851 .IP
852 Note that since a pager is always used, the
853 .BR less (1)
854 pager is not particularly appropriate, since it clears the screen before
855 displaying the output of the command and clears the output the screen
856 when the pager is exited. Many users prefer to use the
857 .BR less (1)
858 pager for most purposes, which is why the
859 .B DEBUGFS_PAGER
860 environment variable is available to override the more general
861 .B PAGER
862 environment variable.
863 .SH AUTHOR
864 .B debugfs
865 was written by Theodore Ts'o <tytso@mit.edu>.
866 .SH SEE ALSO
867 .BR dumpe2fs (8),
868 .BR tune2fs (8),
869 .BR e2fsck (8),
870 .BR mke2fs (8),
871 .BR ext4 (5)