Forrest logo
back to the e2fsck tool

e2fsck:tldr:9c0cb

e2fsck: Check filesystem in read only mode.
$ sudo e2fsck -c ${-dev-sdXN}
try on your machine

This command is used to check the file system integrity of a specified partition on a Linux system.

Here's a breakdown of the command:

  • sudo: It is a command that gives the user executing it administrative privileges. It is often required to run certain commands as a superuser.
  • e2fsck: It stands for "ext2/ext3/ext4 file system check." It is a program used to check the integrity of a file system and repair any errors found.
  • -c: This option tells e2fsck to perform a bad block scan during the file system check. It will scan the partition for any bad sectors on the disk.
  • ${-dev-sdXN}: This is a placeholder indicating a specific partition on the disk. You should replace ${-dev-sdXN} with the actual device file corresponding to the partition you want to check. For example, it could be /dev/sdb1, where /dev/sdb represents the disk and 1 represents the partition number.

So, by running sudo e2fsck -c ${-dev-sdXN}, you are running e2fsck with the -c option on the specified partition to check for file system errors and bad blocks on the disk.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the e2fsck tool