Menu
- About
- Ham Radio
- NL SwapShop
- NL SOTA Association
- 3D Models
- Linux
- Raspberry Pi
- Windows
- Software
- Photo Gallery
- Contact
- Search

Check Drive For Errors And Bad Sectors
I covered the basics of checking file systems before...however its good from time to time to run a check on the drive itself; checking for badblocks and physical errors and marking them as bad so the OS doesnt use them. Like any drive check if you get errors especially a lot of them its time to start investing in another drive or face corrupt files or total drive failure
For the following examples I am going to use my secondary drive (/dev/sdb) replace this with whatever drive your checking...
to check a drive has smart enabled
This should tell you if smart detection is enabled. If it is not you should
enable it via
Although smart should alert you on boot....if you are running a system like a
server you probably dont reboot often and you can run a smart test on the fly
Smart is very good at picking up on failed drives but you should also run a
badblocks check on your drives every now and then to test for physical bad
spots on the disk platters
You can check for bad blocks only...just a check and not marking the bad areas
as do not use.
The above command will ouput any bad blocks it finds to a file "bad-blocks".
We now use that file to tell the OS to not use those areas of the drive to
store files. Most common filesystem is ext3, if you are using ext4 simply
change the 3 to a 4 in the following command
That should cover off most hard drive errors. You can also do a filesystem check.
you can do a *SAFE* read only test with the following command
To read data and write the same data back (read/write test) run the following command