Install Badblocks On A Debian, Ubuntu, Alpine, Arch, Kali, CentOS, Fedora, Raspbian And MacOS

Install Badblocks On A Debian, Ubuntu, Alpine, Arch, Kali, CentOS, Fedora, Raspbian And MacOS

badblocks

Search a device for bad blocks.
Some usages of badblocks can cause destructive actions, such as erasing all the data on a disk, including the partition table.

Maintainer: Theodore Y. Ts'o



Section: admin

Install badblocks

  • Debian apt-get install e2fsprogs Click to copy
  • Ubuntu apt-get install e2fsprogs Click to copy
  • Alpine OS apk add e2fsprogs Click to copy
  • Arch Linux pacman -S e2fsprogs Click to copy
  • Kali Linux apt-get install e2fsprogs Click to copy
  • CentOS yum install e2fsprogs Click to copy
  • Fedora dnf install e2fsprogs Click to copy
  • Raspbian apt-get install e2fsprogs Click to copy
  • macOS brew install e2fsprogs Click to copy

Search a device for bad blocks. Some usages of badblocks can cause destructive actions, such as erasing all the data on a disk, including the partition table.

How to use badblocks?

Below are few example commands for badblocks that you can use in the terminal.

Search a disk for bad blocks by using a non-destructive read-only test:
sudo badblocks /dev/sdaClick to copy
Search an unmounted disk for bad blocks with a non-destructive read-write test:
sudo badblocks -n /dev/sdaClick to copy
Search an unmounted disk for bad blocks with a destructive write test:
sudo badblocks -w /dev/sdaClick to copy
Installation of latest badblocks command is available for Debian, Ubuntu, Alpine, Arch, Kali, CentOS, Fedora, Raspbian and macOS. You can copy the command for your OS from above and paste it into your terminal. Once you run the command it will download the 2026 latest package from the repository and install it in your computer/server.