How can I check the health of my hard drive?

191,603

Solution 1

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

Solution 2

You can also use gsmartcontrol, a GUI for smartctl.

Solution 3

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:
191,603

Related videos on Youtube

Abdur Rahman
Author by

Abdur Rahman

Updated on September 18, 2022

Comments

  • Abdur Rahman
    Abdur Rahman over 1 year

    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?

  • Eliah Kagan
    Eliah Kagan about 11 years
    Why would shred be helpful here?
  • ntc2
    ntc2 almost 10 years
    @EliahKagan: I guess shred is suggested as a tool for stress testing the drive.
  • Allen
    Allen over 8 years
    What is the actual program name for "Disk Utility"? I don't see an exact match for that. There are several "disk-related" programs when I search the dash for "disk utility" and I don't like to guess. The most likely one I see is "Disks".
  • Allen
    Allen over 8 years
    Looking here I see the screenshot looks like the UI for the application currently named "Disks". In the title bar shown in the screen shot, I see that it was called "Disk Utility", so I assume the name was changed at some point.
  • kbuilds
    kbuilds over 8 years
    The command for "Disk Utility" is gnome-disks
  • Rovanion
    Rovanion about 7 years
    And it is packaged as ´gnome-disk-utility´.
  • Mehdi
    Mehdi over 4 years
    disappeared from Ubuntu 18.04
  • Oli
    Oli over 4 years
    @Mehdi gnome-disks is the current incantation. It's not the same as palimpsest but it's close.
  • s1mmel
    s1mmel almost 4 years
    shred can be used as a digital data shredder to completly remove data from a drive, hence the name shred
  • Basil A
    Basil A almost 4 years
    badblocks command does not make the drive lose data