Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I had a bad experience on an old Dell computer where shortly after installing Ubuntu on it, the hard drive failed due to excessive loading/unloading cycles. What is the best way to check the health of my hard drive in Ubuntu? Can it be done from the command line?

share|improve this question
add comment

3 Answers 3

up vote 25 down vote accepted

For the desktop, you can use "Disk Utility" (aka palimpsest or gnome-disks depending on the Ubuntu release) for this.

For the command line I suggest you install the smartmontools package and play around with smartctl. Eg:

sudo smartctl --all /dev/sda
share|improve this answer
add comment

There is also a utility called badblocks, and another called shred. Both of these utilities can perform read/write operations on your write drive that can be used to make sure that a drive is safe for use. Personally, if I saw an error in either of these I'd replace the drive.

They are very slow and can take some time to complete, but can give you a an idea of their health. Also, since they are writing you'll lose the data on the drive and should be run from live cd as suggested by caesay. I've been lugging around SystemRescueCd lately.

share|improve this answer
2  
Why would shred be helpful here? –  Eliah Kagan Apr 4 '13 at 0:45
    
@EliahKagan: I guess shred is suggested as a tool for stress testing the drive. –  ntc2 May 22 at 22:13
add comment

You can also use gsmartcontrol, a GUI for smartctl.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.