Skip to content

Instantly share code, notes, and snippets.

@StokicDusan
Created October 16, 2021 11:38
Show Gist options
  • Save StokicDusan/41c2504127aae7b567d0f1df6ce4c453 to your computer and use it in GitHub Desktop.
Save StokicDusan/41c2504127aae7b567d0f1df6ce4c453 to your computer and use it in GitHub Desktop.
How to find and avoid bad blocks on hard disk.
# This is a script for finding bad blocks on hard drive.
# Repace "/dev/sdb" with disk you wish to check.
sudo fdisk -l
sudo badblocks -v /dev/sdb > /tmp/bad-blocks.txt
sudo e2fsck -l /tmp/bad-blocks.txt /dev/sdb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment