BadBlocks = lost data. You can check and correct them in a couple of commands.
See which disc we will check:
sudo fdisk -l
Knowing the disk, we launch the badblocks utility:
sudo badblocks -v /dev/sdb1 > badsectors.txt
What do the parameters mean:
We specify the following parameters for verification:
- -v — detailed conclusion of information on the audit results,
- /dev/sdb1 — section to be audited,
- badsectors.txt — in this file we save information about broken sectors, which we will then work with..
Two utilities are usually used for fixing:
- e2fsck – for file systems ext2, ext3, ext4,
- fsck – for all others who are not ext*
We are launching:
sudo e2fsck -l badsectors.txt /dev/sdb1
sudo fsck -l badsectors.txt /dev/sdb1
… and basically everything!
P.S. I recommend doing this regularly 🙂
Upd. Using smartmontools:
I saw another utility that shows SMART data (Self-Diagnostic Winchester Data):
sudo apt-get install smartmontools sudo smartctl -H /dev/sdb1
- -a or –all – show all data about the disk,
- -x or –xall – to see other parameters of the drive