{
    "content": [
        {
            "type": "text",
            "text": "# fsck.ext4 (info)\n\n## NAME\n\ne2fsck - check a Linux ext2/ext3/ext4 file system\n\n## SYNOPSIS\n\ne2fsck  [  -pacnyrdfkvtDFV ] [ -b superblock ] [ -B blocksize ] [ -l|-L\nbadblocksfile ] [ -C fd ] [ -j external-journal ] [  -E  extendedop-\ntions ] [ -z undofile ] device\n\n## DESCRIPTION\n\ne2fsck is used to check the ext2/ext3/ext4 family of file systems.  For\next3 and ext4 file systems that use a journal, if the system  has  been\nshut  down  uncleanly without any errors, normally, after replaying the\ncommitted transactions  in the  journal,  the  file  system  should  be\nmarked  as clean.   Hence, for file systems that use journaling, e2fsck\nwill normally replay the journal and exit, unless its superblock  indi-\ncates that further checking is required.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **OPTIONS**\n- **EXIT CODE**\n- **SIGNALS**\n- **REPORTING BUGS**\n- **ENVIRONMENT**\n- **AUTHOR**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "fsck.ext4",
        "section": "",
        "mode": "info",
        "summary": "e2fsck - check a Linux ext2/ext3/ext4 file system",
        "synopsis": "e2fsck  [  -pacnyrdfkvtDFV ] [ -b superblock ] [ -B blocksize ] [ -l|-L\nbadblocksfile ] [ -C fd ] [ -j external-journal ] [  -E  extendedop-\ntions ] [ -z undofile ] device",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [
            {
                "name": "e2fsck.conf",
                "section": "5",
                "url": "https://www.chedong.com/phpMan.php/man/e2fsck.conf/5/json"
            },
            {
                "name": "badblocks",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/badblocks/8/json"
            },
            {
                "name": "dumpe2fs",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/dumpe2fs/8/json"
            },
            {
                "name": "debugfs",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/debugfs/8/json"
            },
            {
                "name": "e2image",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/e2image/8/json"
            },
            {
                "name": "mke2fs",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/mke2fs/8/json"
            },
            {
                "name": "tune2fs",
                "section": "8",
                "url": "https://www.chedong.com/phpMan.php/man/tune2fs/8/json"
            }
        ],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 28,
                "subsections": []
            },
            {
                "name": "OPTIONS",
                "lines": 247,
                "subsections": []
            },
            {
                "name": "EXIT CODE",
                "lines": 12,
                "subsections": []
            },
            {
                "name": "SIGNALS",
                "lines": 11,
                "subsections": []
            },
            {
                "name": "REPORTING BUGS",
                "lines": 27,
                "subsections": []
            },
            {
                "name": "ENVIRONMENT",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 4,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "e2fsck - check a Linux ext2/ext3/ext4 file system\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "e2fsck  [  -pacnyrdfkvtDFV ] [ -b superblock ] [ -B blocksize ] [ -l|-L\nbadblocksfile ] [ -C fd ] [ -j external-journal ] [  -E  extendedop-\ntions ] [ -z undofile ] device\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "e2fsck is used to check the ext2/ext3/ext4 family of file systems.  For\next3 and ext4 file systems that use a journal, if the system  has  been\nshut  down  uncleanly without any errors, normally, after replaying the\ncommitted transactions  in the  journal,  the  file  system  should  be\nmarked  as clean.   Hence, for file systems that use journaling, e2fsck\nwill normally replay the journal and exit, unless its superblock  indi-\ncates that further checking is required.\n\ndevice  is a block device (e.g., /dev/sdc1) or file containing the file\nsystem.\n\nNote that in general it is not safe to run e2fsck on mounted file  sys-\ntems.  The only exception is if the -n option is specified, and -c, -l,\nor -L options are not specified.   However, even if it is  safe  to  do\nso,  the  results printed by e2fsck are not valid if the file system is\nmounted.   If e2fsck asks whether or not you should check a file system\nwhich  is mounted, the only correct answer is ``no''.  Only experts who\nreally know what they are doing should consider answering this question\nin any other way.\n\nIf  e2fsck  is run in interactive mode (meaning that none of -y, -n, or\n-p are specified), the program will ask the user to  fix  each  problem\nfound  in  the  file system.  A response of 'y' will fix the error; 'n'\nwill leave the error unfixed; and 'a' will fix the problem and all sub-\nsequent  problems;  pressing  Enter  will  proceed with the default re-\nsponse, which is printed before the question mark.  Pressing  Control-C\nterminates e2fsck immediately.\n",
                "subsections": []
            },
            "OPTIONS": {
                "content": "-a     This  option  does  the same thing as the -p option.  It is pro-\nvided for backwards compatibility only;  it  is  suggested  that\npeople use -p option whenever possible.\n\n-b superblock\nInstead  of  using the normal superblock, use an alternative su-\nperblock specified by superblock.  This option is normally  used\nwhen the primary superblock has been corrupted.  The location of\nbackup superblocks is dependent on the file system's  blocksize,\nthe  number of blocks per group, and features such as sparsesu-\nper.\n\nAdditional backup superblocks can be  determined  by  using  the\nmke2fs  program  using  the -n option to print out where the su-\nperblocks exist, supposing mke2fs  is  supplied  with  arguments\nthat  are  consistent with the file system's layout (e.g. block-\nsize, blocks per group, sparsesuper, etc.).\n\nIf an alternative superblock is specified and the file system is\nnot opened read-only, e2fsck will make sure that the primary su-\nperblock is updated appropriately upon completion  of  the  file\nsystem check.\n\n-B blocksize\nNormally,  e2fsck will search for the superblock at various dif-\nferent block sizes in an attempt to find the  appropriate  block\nsize.   This  search  can  be fooled in some cases.  This option\nforces e2fsck to only try locating the superblock at a  particu-\nlar blocksize.  If the superblock is not found, e2fsck will ter-\nminate with a fatal error.\n\n-c     This option causes e2fsck to use badblocks(8) program  to  do  a\nread-only  scan  of  the device in order to find any bad blocks.\nIf any bad blocks are found, they are added to the bad block in-\node to prevent them from being allocated to a file or directory.\nIf this option is specified twice, then the bad block scan  will\nbe done using a non-destructive read-write test.\n\n-C fd  This option causes e2fsck to write completion information to the\nspecified file descriptor so that the progress of the file  sys-\ntem  check  can  be monitored.  This option is typically used by\nprograms which are running e2fsck.  If the file descriptor  num-\nber is negative, then absolute value of the file descriptor will\nbe used, and the progress information will  be  suppressed  ini-\ntially.  It can later be enabled by sending the e2fsck process a\nSIGUSR1 signal.  If the file descriptor specified is  0,  e2fsck\nwill print a completion bar as it goes about its business.  This\nrequires that e2fsck is running on a video console or terminal.\n\n-d     Print  debugging  output  (useless  unless  you  are   debugging\ne2fsck).\n\n-D     Optimize  directories in file system.  This option causes e2fsck\nto try to optimize all directories, either by  re-indexing  them\nif  the  file system supports directory indexing,  or by sorting\nand compressing directories for smaller directories, or for file\nsystems using traditional linear directories.\n\nEven  without the -D option, e2fsck may sometimes optimize a few\ndirectories --- for example, if directory  indexing  is  enabled\nand  a directory is not indexed and would benefit from being in-\ndexed, or if the index structures are corrupted and need  to  be\nrebuilt.   The -D option forces all directories in the file sys-\ntem to be optimized.  This can  sometimes  make  them  a  little\nsmaller  and  slightly  faster  to  search, but in practice, you\nshould rarely need to use this option.\n\nThe -D option will detect directory entries with duplicate names\nin  a  single  directory, which e2fsck normally does not enforce\nfor performance reasons.\n\n-E extendedoptions\nSet e2fsck extended options.  Extended options are  comma  sepa-\nrated,  and  may  take  an argument using the equals ('=') sign.\nThe following options are supported:\n\neaver=extendedattributeversion\nSet the version of  the  extended  attribute  blocks\nwhich  e2fsck  will  require while checking the file\nsystem.  The version number may be 1 or 2.  The  de-\nfault extended attribute version format is 2.\n\njournalonly\nOnly replay the journal if required, but do not per-\nform any further checks or repairs.\n\nfragcheck\nDuring pass 1, print a detailed report of  any  dis-\ncontiguous blocks for files in the file system.\n\ndiscard\nAttempt  to  discard  free  blocks  and unused inode\nblocks after the full file system check  (discarding\nblocks is useful on solid state devices and sparse /\nthin-provisioned storage). Note that discard is done\nin  pass  5  AFTER  the  file  system has been fully\nchecked and only if it does not contain recognizable\nerrors.  However  there  might be cases where e2fsck\ndoes not fully recognize a problem and hence in this\ncase this option may prevent you from further manual\ndata recovery.\n\nnodiscard\nDo not attempt to discard free blocks and unused in-\node  blocks.  This option is exactly the opposite of\ndiscard option. This is set as default.\n\nnooptimizeextents\nDo not offer to optimize the extent tree  by  elimi-\nnating unnecessary width or depth.  This can also be\nenabled in the options section of /etc/e2fsck.conf.\n\noptimizeextents\nOffer to optimize the extent tree by eliminating un-\nnecessary  width  or depth.  This is the default un-\nless otherwise specified in /etc/e2fsck.conf.\n\ninodecountfullmap\nTrade off using memory for  speed  when  checking  a\nfile  system  with  a  large  number  of hard-linked\nfiles.  The amount of  memory  required  is  propor-\ntional  to  the number of inodes in the file system.\nFor large file systems, this  can  be  gigabytes  of\nmemory.   (For  example, a 40TB file system with 2.8\nbillion inodes will consume  an  additional  5.7  GB\nmemory if this optimization is enabled.)  This opti-\nmization can also be enabled in the options  section\nof /etc/e2fsck.conf.\n\nnoinodecountfullmap\nDisable  the inodecountfullmap optimization.  This\nis  the  default  unless  otherwise   specified   in\n/etc/e2fsck.conf.\n\nreadaheadkb\nUse this many KiB of memory to pre-fetch metadata in\nthe hopes of reducing e2fsck runtime.   By  default,\nthis  is  set to the size of two block groups' inode\ntables (typically 4MiB on a regular ext4  file  sys-\ntem);  if  this  amount is more than 1/50th of total\nphysical memory, readahead is disabled.  Set this to\nzero to disable readahead entirely.\n\nbmap2extent\nConvert block-mapped files to extent-mapped files.\n\nfixesonly\nOnly fix damaged metadata; do not optimize htree di-\nrectories or compress extent trees.  This option  is\nincompatible with the -D and -E bmap2extent options.\n\ncheckencoding\nForce  verification of encoded filenames in case-in-\nsensitive directories.  This is the default mode  if\nthe file system has the strict flag enabled.\n\nunshareblocks\nIf  the  file  system  has  shared  blocks, with the\nshared blocks read-only feature enabled,  then  this\nwill  unshare  all shared blocks and unset the read-\nonly feature bit. If there is not enough free  space\nthen  the  operation  will fail.  If the file system\ndoes not have the read-only  feature  bit,  but  has\nshared  blocks anyway, then this option will have no\neffect. Note when using this option, if there is  no\nfree  space  to  clone blocks, there is no prompt to\ndelete files and instead the operation will fail.\n\nNote that unshareblocks implies the \"-f\" option  to\nensure  that  all  passes  are run. Additionally, if\n\"-n\" is also specified, e2fsck will simulate  trying\nto  allocate  enough  space  to deduplicate. If this\nfails, the exit code will be non-zero.\n\n-f     Force checking even if the file system seems clean.\n\n-F     Flush the file system device's buffer caches  before  beginning.\nOnly really useful for doing e2fsck time trials.\n\n-j external-journal\nSet the pathname where the external-journal for this file system\ncan be found.\n\n-k     When combined with the -c option, any existing bad blocks in the\nbad  blocks  list are preserved, and any new bad blocks found by\nrunning badblocks(8) will be added to the  existing  bad  blocks\nlist.\n\n-l filename\nAdd  the  block numbers listed in the file specified by filename\nto the list of bad blocks.  The format of this file is the  same\nas the one generated by the badblocks(8) program.  Note that the\nblock numbers are based on the blocksize  of  the  file  system.\nHence, badblocks(8) must be given the blocksize of the file sys-\ntem in order to obtain correct results.  As a result, it is much\nsimpler  and safer to use the -c option to e2fsck, since it will\nassure that the correct parameters are passed to  the  badblocks\nprogram.\n\n-L filename\nSet  the  bad  blocks list to be the list of blocks specified by\nfilename.  (This option is the same as the -l option, except the\nbad  blocks list is cleared before the blocks listed in the file\nare added to the bad blocks list.)\n\n-n     Open the file system read-only, and assume an answer of `no'  to\nall  questions.   Allows  e2fsck  to  be used non-interactively.\nThis option may not be specified at the same time as the  -p  or\n-y options.\n\n-p     Automatically  repair  (\"preen\")  the  file system.  This option\nwill cause e2fsck to automatically fix any file system  problems\nthat  can be safely fixed without human intervention.  If e2fsck\ndiscovers a problem which may require the  system  administrator\nto  take  additional  corrective action, e2fsck will print a de-\nscription of the problem and then exit with the  value  4  logi-\ncally  or'ed  into  the exit code.  (See the EXIT CODE section.)\nThis option is normally used by the system's boot  scripts.   It\nmay not be specified at the same time as the -n or -y options.\n\n-r     This  option  does nothing at all; it is provided only for back-\nwards compatibility.\n\n-t     Print timing statistics for e2fsck.   If  this  option  is  used\ntwice,  additional  timing  statistics  are printed on a pass by\npass basis.\n\n-v     Verbose mode.\n\n-V     Print version information and exit.\n\n-y     Assume an answer of `yes' to all questions; allows e2fsck to  be\nused non-interactively.  This option may not be specified at the\nsame time as the -n or -p options.\n\n-z undofile\nBefore overwriting a file system block, write the  old  contents\nof  the  block to an undo file.  This undo file can be used with\ne2undo(8) to restore the old contents of the file system  should\nsomething  go  wrong.   If  the  empty  string  is passed as the\nundofile argument, the undo file will  be  written  to  a  file\nnamed  e2fsck-device.e2undo  in  the directory specified via the\nE2FSPROGSUNDODIR environment variable.\n\nWARNING: The undo file cannot be used to recover from a power or\nsystem crash.\n",
                "subsections": []
            },
            "EXIT CODE": {
                "content": "The  exit  code  returned  by e2fsck is the sum of the following condi-\ntions:\n0    - No errors\n1    - File system errors corrected\n2    - File system errors corrected, system should\nbe rebooted\n4    - File system errors left uncorrected\n8    - Operational error\n16   - Usage or syntax error\n32   - E2fsck canceled by user request\n128  - Shared library error\n",
                "subsections": []
            },
            "SIGNALS": {
                "content": "The following signals have the following effect when sent to e2fsck.\n\nSIGUSR1\nThis signal causes e2fsck to start displaying a  completion  bar\nor emitting progress information.  (See discussion of the -C op-\ntion.)\n\nSIGUSR2\nThis signal causes e2fsck to stop displaying a completion bar or\nemitting progress information.\n",
                "subsections": []
            },
            "REPORTING BUGS": {
                "content": "Almost  any  piece of software will have bugs.  If you manage to find a\nfile system which causes e2fsck to crash, or which e2fsck is unable  to\nrepair, please report it to the author.\n\nPlease  include  as  much  information  as possible in your bug report.\nIdeally, include a complete transcript of the e2fsck run, so I can  see\nexactly  what  error  messages  are displayed.  (Make sure the messages\nprinted by e2fsck are in English; if your system has been configured so\nthat  e2fsck's  messages  have  been  translated into another language,\nplease set the the LCALL environment variable to C so that  the  tran-\nscript  of  e2fsck's  output  will  be  useful  to  me.)  If you have a\nwritable file system where the transcript can be stored, the  script(1)\nprogram is a handy way to save the output of e2fsck to a file.\n\nIt is also useful to send the output of dumpe2fs(8).  If a specific in-\node or inodes seems to be giving e2fsck trouble, try  running  the  de-\nbugfs(8) command and send the output of the stat(1u) command run on the\nrelevant inode(s).  If the inode is a directory, the debugfs dump  com-\nmand  will  allow  you  to extract the contents of the directory inode,\nwhich can sent to me after being first run  through  uuencode(1).   The\nmost useful data you can send to help reproduce the bug is a compressed\nraw image dump of the file system, generated using e2image(8).  See the\ne2image(8) man page for more details.\n\nAlways include the full version string which e2fsck displays when it is\nrun, so I know which version you are running.\n",
                "subsections": []
            },
            "ENVIRONMENT": {
                "content": "E2FSCKCONFIG\nDetermines  the  location  of  the   configuration   file   (see\ne2fsck.conf(5)).\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "This version of e2fsck was written by Theodore Ts'o <tytso@mit.edu>.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "e2fsck.conf(5),   badblocks(8),  dumpe2fs(8),  debugfs(8),  e2image(8),\nmke2fs(8), tune2fs(8)\n\nE2fsprogs version 1.46.5         December 2021                       E2FSCK(8)",
                "subsections": []
            }
        }
    }
}