Linux check hdd health

How to check the health of a hard drive

My SATA drive started clicking and I was unable to access the data. It was not clicking loudly though, like a drive that has already gone bad. After tightening the connections to the hard drive, it stopped clicking and I was able to access the data again. I have started to move files off of the drive, but I think this drive might still be in good health. I didn’t find any data corruption and I haven’t had any trouble accessing any files. I have never had an SATA drive fail before so I’m thinking that it could have just been the loose connections that was causing the problem. What tests can I run on this drive to find out how healthy it is? This is the hard drive in question: HITACHI Deskstar T7K250 HDT722525DLA380 (0A31636) 250GB 7200 RPM 8MB Cache SATA 3.0Gb/s 3.5″ Hard Drive -Bare Drive

Oh, when I answered you hadn’t mentioned that it was a deathstar. At least some of the Deskstar line has a very bad reputation for longevity and reliability. Bad enough that the failing drives are termed «deathstar».

13 Answers 13

sudo smartctl -a /dev/sda | less 

This will give you an abundance of information about your hard drive’s health. The tool also permits you to start and monitor self tests of the drive.

If you want to do benchmarks / check all of the sectors to find one that is bad, you can find other tools for that, but smartctl is the first place to go for drive health status.

For anyone who finds they don’t have smartctl : it’s probably under your package manager as «smartmontools».

badblocks is one more useful utility; it shows the amount and location of bad blocks on your drive. Above is an example with an ongoing progress of currently scanned device:

sudo badblocks -v /dev/sda -s 

@Emmanuel Yes. but at the cost of increased wear. For example, Seagate Surveillance drives are rated for around 180TB/year. Doing badblocks on a 10TB one will transfer 80TB of data. It really makes sense to do it before you start using it. If a block is particularly bad there is a good chance running badblocks in read only mode will trip the badblock and it’ll get reported on smart. Also, badblocks takes ~96 hours to run on a WD Red 8TB, which is kind of annoying, especially if you lose power and aren’t sure where you left off.

Читайте также:  Создать расшаренную папку linux

so badblocks -v seems to report bad block «numbers», one per line, e.g. 37754169 , 37754170 . . Knowing the bad blocks, what can then be done?

I see that no one has mentioned gsmartcontrol which is a GUI.

In Ubuntu you can install it with $ sudo apt-get install gsmartcontrol

If you launch sudo gsmartcontrol you see all the hard drives in your computer.

Then if you right click on a device and click View Details you see something like this.

You can get a lot of details in the different tabs here. You can also perform tests in the Perform Tests tab.

GSmartControl

If a HD starts to give you physical hints about an upcoming failure, no software will help. Yes, SMART exists and things like smartctl can read its results for you, but you shouldn’t bet on it. SMART can be useful for detecting things like high temperatures or bad sectors, but if your HD starts to click or does not start up during the first try, it’s time to

  • make sure you have backups
  • rush to nearest computer dealer, buy a new HD and copy everything there

When HD decides to fail, it will do it without a previous warning and Murphy’s law says that the failure will happen during the most unwanted moment. So be prepared and backup & replace the disk NOW rather than waiting for the catastrophe.

Why not bet on S.M.A.R.T., provided it is properly supported by the HDD and its host? @Janne Pikkarainen

@etherous You shall see beyond the apparent question. Actually this is the most accurate answer, as most software methods will fail to DETECT most PRE-failures.

Try using SpinRite (It isn’t free) but I have used many, many tools. Most tools make more damage than help, when I say damage, I mean «not taking good care of your information«. This tool will check your drive and fix the bad sectors, while moving your information to secure sectors. It also is a preventing method for hard disk catastrophes

I strongly suggest risking on buying a fully tested product with a good background, than losing your so valuable information.

+1 For SpinRite. It is so fast and light, it has save many hard drives with crucial data. I recommend you give it a go.

Besides the already mentioned SMART status it might be important to mention that modern HDDs tend not to fail gracefully. Often from one day to the next you only hear a clicking sound or can’t access the disk at all. So while your problem could also be caused by a loose cable be always prepared by having regular backups on a different disk.

Читайте также:  Linux mint menu icon

Test environment: Permanent Live Ubuntu 16.04 USB made based on the thread How to Make Persistent Live Ubuntu of 16.04? Connect your HDD on your computer. Boot to the live Ubuntu. The GUI program gnome-disks which shows also bad-sectors and where you can do benchmarking of the discs and its different sectors. It is similar to the tools of smartmontools for sudo smartctl -a . . Example output of benchmarking my 500 GB disc where you see the read/write speed degenerates in time under heavy load

enter image description here

Other view: SMART Data & Self-Tests where I run short self-test. You can find temperature of the drive, and how many years/months/days your drive has had power on

enter image description here

Any idea why the «Smart Data and Self-Tests. » menu is disabled in sudo gnome-disks for disks that do have SMART (as shown by gsmartcontrol )?

Output of smartctl is hard to read for me. gnome-disks pulls in GNOME which nowadays cannot live without NetworkManager.

I found skdump (part of libatasmart ) which I able to understand. It produce also «Pretty» and «Good» columns alongside with Overall status:

Bad Sectors: 0 sectors Powered On: 7.4 years Power Cycles: 2144 Average Powered On Per Power Cycle: 1.3 days Temperature: 33.0 C Attribute Parsing Verification: Good Overall Status: GOOD ID# Name Value Worst Thres Pretty Raw Type Updates Good Good/Past 1 raw-read-error-rate 100 91 51 36 0x240000000000 prefail online yes yes 3 spin-up-time 76 76 11 8.0 s 0x181f00000000 prefail online yes yes 4 start-stop-count 98 98 0 2173 0x7d0800000000 old-age online n/a n/a 5 reallocated-sector-count 100 100 10 0 sectors 0x000000000000 prefail online yes yes 7 seek-error-rate 100 100 51 0 0x000000000000 prefail online yes yes 8 seek-time-performance 100 100 15 n/a 0x072700000000 prefail offline yes yes 9 power-on-hours 87 87 0 7.4 years 0xd1fd00000000 old-age online n/a n/a 10 spin-retry-count 100 100 51 0 0x000000000000 prefail online yes yes 11 calibration-retry-count 100 100 0 0 0x000000000000 old-age online n/a n/a 12 power-cycle-count 98 98 0 2144 0x600800000000 old-age online n/a n/a 13 read-soft-error-rate 100 91 0 36 0x240000000000 old-age online n/a n/a 183 runtime-bad-block-total 100 100 0 0 0x000000000000 old-age online n/a n/a 184 end-to-end-error 100 100 0 0 0x000000000000 prefail online n/a n/a 187 reported-uncorrect 100 100 0 2540 sectors 0xec0900000000 old-age online n/a n/a 188 command-timeout 100 100 0 0 0x000000000000 old-age online n/a n/a 190 airflow-temperature-celsius 67 53 0 33.0 C 0x21000f210000 old-age online n/a n/a 194 temperature-celsius-2 67 52 0 33.0 C 0x21000f220000 old-age online n/a n/a 195 hardware-ecc-recovered 100 100 0 47099 0xfbb700000000 old-age online n/a n/a 196 reallocated-event-count 100 100 0 0 0x000000000000 old-age online n/a n/a 197 current-pending-sector 100 100 0 0 sectors 0x000000000000 old-age online n/a n/a 198 offline-uncorrectable 100 100 0 0 sectors 0x000000000000 old-age offline n/a n/a 199 udma-crc-error-count 100 100 0 0 0x000000000000 old-age online n/a n/a 200 multi-zone-error-rate 100 100 0 0 0x000000000000 old-age online n/a n/a 201 soft-read-error-rate 100 100 0 0 0x000000000000 old-age online n/a n/a 

Though it states «GOOD» (Samsung HD103UJ). In output of smartctl I saw log with errors and you can see them under 187 (uncorrected errors) which indicates how much data I really lost. Seeing 7 (reallocated sectors) being at 0 is a bit unexpected for me.

Читайте также:  Pdf for linux mint

Источник

How can I check the health of my hard drive?

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?

3 Answers 3

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:

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».

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.

You can also use gsmartcontrol , a GUI for smartctl .

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.

shred can be used as a digital data shredder to completly remove data from a drive, hence the name shred

Источник

Оцените статью
Adblock
detector