Skip to content

Instantly share code, notes, and snippets.

@ktprezes
Last active August 23, 2023 19:46
Show Gist options
  • Save ktprezes/165577069fc2c90c7f63fc3f79a4b2db to your computer and use it in GitHub Desktop.
Save ktprezes/165577069fc2c90c7f63fc3f79a4b2db to your computer and use it in GitHub Desktop.
Linux - fsck command and `bad blocks search / disk surface scan` - remarks
The `fsck` command (file system check) works as a kind of _wrapper_ for file-system-type-dependent specialized commands,
and the options allowed MAY VARY depending of the file system type...
For example:
- for `fat32` file system the `fsck.vfat` is used, and the `-c N` option selects the `DOS codepage`,
and the `-t` option tests for bad clusters
- for `ext4` file system the `e2fsck` is used, and checking for bad blocks requires the `-c` (read-only test) option
or the `-cc` (read/non-destructive-write test) option - and the `badblocks` command is used then under the hood
- some linux systems contain the `fsck.ntfs` command, but some don't. And it seems the `ntfsfix` command
doesn't offer the `bad blocks` check, and the `badblocks` command lists the bad bocks found, but apparently doesn't
update the `bad blocks list` of the device
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment