Inexplicable Hard Drive Error
I'm not sure what hardware details would be relevant here but I'll try to supply any asked for. For months now I've had a weird issue. My hard drive activity light will come on and stay on and the computer all but locks up, everything takes forever to execute. Rebooting doesn't fix it and the only thing that will fix it is shutting down, booting back up with a disc that gives a live environment, then running GParted and having it check and repair errors. It never reports any errors, but after I do that it will run fine until the next time it happens (it happens maybe two or three times a week) I assumed my hard drive was going out and so bought a new one only to have the new one do the exact same thing. Any hints on where to start troubleshooting this would be greatky appreciated.
About this post
- Posted
- Archived
- Score
- 4 · 100% up
- Kind
- Text
- ID
- 63rboh
6 comments
I'm totally at a loss, but you can parse through dmesg logs, sudo journalctl -r, for past events, and sudo journalctl -f to follow system messages and errors in realtime. Clues may abound.
Thank you. I use Arch and I've been Linux only for at least ten years so you'd think I'd know more.
With I think 4.8 and 4.9 kernel versions, I had issues with all disks locking up for a minute or longer occasionally. Programs then froze when they accessed the drives. When was the last time you did
pacman -Syu? If your problem is related to what I saw, it might be fixed with an update.To research if you have a hardware problem with your HDD, look at the output of
smartctl -xorsmartctl -afor your drive. I mean, run for example the following if the HDD you are interested in is /dev/sda:Search for a list named "Vendor Specific SMART Attributes with Thresholds" in the output. It looks like a table. The entries in that table are explained in this Wikipedia article:
https://en.wikipedia.org/wiki/S.M.A.R.T.
On that Wikipedia page, you'll find a table with descriptions if you scroll down. The lines with a highlighted background are the ones you want to look at.
If you are confused, show the table you see in smartctl's output here so that other people can take a look at it.
For my HDD, the scary entries are named like this in smartctl's output:
And there's this entry here that usually means that the data cable is broken and needs to be replaced:
I run pacman -Syu daily. Also, thank you so much for this great detailed response. I will give your suggestions a try.
"all but locks up". So it doesn't lock up and you can run commands if you're patient, and ideally run commands that are quick. So you can investigate. Leave
dstat -tcdngym 10running somewhere you can switch to it, e.g. on a VT, or in screen(1), even if you have to be patient. Look at it occasionally to get an idea of "normal". Next time there's a problem, be patient enough to reach it, you'll have some history, ten seconds a line, and see what's different. Is there lots of paging? A high "wai" percent, waiting on I/O? That will be a step towards asking with more detail.The smartctl(8) is good, but, again, get a feel for what all the values the drive returns. Run it daily. diff them to see what's changing, e.g. power-on hours, and look for anything odd.
Thank you as well, I've got dstat running now. Given that Arch users are expected to be a bit more savvy I appreciate the help with something basic like this.