LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   'Disks' application - how reliable is it? (https://www.linuxquestions.org/questions/linux-software-2/disks-application-how-reliable-is-it-4175591673/)

Summer Deep 10-18-2016 02:21 PM

'Disks' application - how reliable is it?
 
This is the feature which seems to be present in most distros in the Ubuntu/Mint family, and maybe quite a few others (eg Knoppix). It's the one which, as well as giving a graphical illustration of the hard drive's partitions, provides basic information about its make, serial number, capacity and 'general health' (bad sectors and current temperature). It's this latter aspect that I'm concerned with. Last week I bought a second-hand Samsung 120GB hard drive as a spare part and to play around with. When I tested it using the 'Disks' feature on a Knoppix usb, it stated something like: 'Disk is OK, 5630 bad sectors'. Quite apart from the question of whether a hard drive with 5000+ bad sectors can be correctly described as OK, I wonder just how accurate or reliable this figure was - it's provided instantaneously without any perceptible 'scanning' period. When I returned the disk to the store (CEX in Manchester), they ran what seemed to be a more technically sophisticated scan using a Windows-based analyser, which apparently showed it to be free of bad sectors. They still gave me a full refund though, LOL. The Linux 'Disks' application by the way shows the vast majority of my HDDs to have no bad sectors. Any views?

smallpond 10-18-2016 03:46 PM

Disks was probably accessing the SMART count of reallocated sectors. My disk which is 4 years old appers to have 0.

Code:

sudo smartctl -A /dev/sda |grep -E '(RAW|Reallocated)'
ID# ATTRIBUTE_NAME          FLAG    VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  5 Reallocated_Sector_Ct  0x0033  100  100  036    Pre-fail  Always      -      0


ardvark71 10-18-2016 03:50 PM

Quote:

Originally Posted by Summer Deep (Post 5619707)
Any views?

Hi...

From what I understand here and here, it appears that Disks is simply reporting what the hard drive is telling it. From the times I've used Disks myself, it's always struck me as reliable and accurate, despite the irony you've mentioned. :D

However, the utility is only as good as the information it's receiving from S.M.A.R.T. ;)

To confirm the condition of your drive, you can also run the diagnostic utility provided by your hard drive's manufacturer. If you need help finding it, please let is know the manufacturer of your drive. :)

Regards...

rknichols 10-18-2016 04:18 PM

S.M.A.R.T. will not report a drive as "Failing" due to bad sectors until it has nearly exhausted its supply of spare sectors. That is long past the point where most people would consider the drive unsuitable for anything you care about.

Summer Deep 10-19-2016 04:53 AM

Thanks everyone, plenty to think about there.....This SMART data business seems well worth exploring, though most of what I've seen of it so far goes rather above my head (UltraDMA CRC Error Count, anyone?!). I've got a utility which analyses SMART hard drive data on a Windows 8.1 desktop machine, and can't help but be amused by the precision of its predictions: according to its analysis of the spin up time, the drive is set to fail on 9 November 2023 at 06-50 and 13 seconds. Presumably this means that if I need to send a couple of emails at 06-40 on that day, I should be okay so long as I don't hang about. On the other hand, a few minutes earlier it had predicted a date in 2021 for this to occur, so maybe not....The other HDD I've had an issue with was one that had a Windows OS on 80% of its volume, and a Linux one on the rest. It showed 40 bad sectors on the 'Disks' analyser, so I ran the CHKDSK -R command on the Windows section, which is supposed to identify bad sectors and try to repair them, but this just resulted in the number of bad sectors increasing to 53. Then I tried erasing all the partitions with GParted, but the 53 bad sectors remained on the disk. Not sure whether there are any other tricks to try - maybe the disk is just irretrievably impaired?

rknichols 10-19-2016 09:15 AM

Look at the detailed S.M.A.R.T. attributes. Disk tool considers reallocated sectors (attribute 5) to be "bad". Once the drive has internally detected a bad sector and reallocated it to a spare sector, that reallocation is permanent. To the OS, the sector still appears fault free. A count of 53 reallocated sectors is something that bears watching, but as long as that number does not continue to increase, the drive is not in terrible shape.

Farther down the list, attribute 197 is the count of bad sectors that are pending reallocation. Those bad sectors are visible to the OS (will cause an I/O error when read). The next time those sectors are written, they will either be declared "good" (the write was successful) or they will be reallocated to a spare sector (reallocated sector count will increase). As long as the raw value for that attribute is zero, the drive still appears fault-free to the OS.

Note that these counts only reflect sectors that developed a problem after the drive left the factory. Even when the counts are zero, it does not mean the platter is perfect. The manufacturer will have identified and mapped out bad or weak spots on the disk, and none of that is reported in the S.M.A.R.T. attributes.

kilgoretrout 10-19-2016 12:04 PM

I assume this is a Samsung SSD, not a regular hard drive. If that's the case, you can rule out any mechanical failure of the drive. Since SSDs have limited writes to any given sector, I assume that the bad sector count would indicate that for those sectors, the write count has been exceeded and the drive firmware has marked them "bad". Having a bad sector count that high would indicate that the drive has seen heavy use. When the drive runs out of spare sectors for reallocation, the drive will fail. I'd just keep and eye on it and run the SMART test from time to time to see if the bad sector count is increasing.

rknichols 10-19-2016 12:23 PM

I seriously doubt that a "second-hand Samsung 120GB hard drive" is an SSD.

Summer Deep 10-19-2016 01:36 PM

^^ That's correct. It was a 2.5" mechanical hard drive, probably at least 7 or 8 years old.

kilgoretrout 10-19-2016 03:35 PM

Sorry for the confusion. Just bought a used intel 110GB ssd. Many people are trading up to 250GB or 500GB ssds now that prices have come down. Thought you might have been in the same boat. I can't remember the last time I bought even a 250GB standard hard drive. Do they make them any more?

rknichols 10-19-2016 07:30 PM

On a drive that spent 7 or 8 years knocking about in a laptop, 53 reallocated sectors might not be excessive. What's important to know is whether the drive continues to develop new bad sectors. I recommend zeroing the entire drive ("dd if=/dev/zero of=/dev/sdX bs=1M"). That should ensure that any currently pending sectors or as yet undetected bad sectors get reallocated. Then you can check whether the reallocation count or pending sector count increases (the smartd daemon can do that automatically). If you don't want to zero the drive, just reading it ("dd if=/dev/sdX of=/dev/null bs=64k conv=noerror") will at least discover any as yet undetected bad sectors and put them in the "pending" list.

Summer Deep 11-14-2016 07:14 PM

Here's an update/postscript that I couldn't resist making. Bought a 250 GB Hitachi 2.5" mechanical hard drive from CEX at the weekend, scanned it with the 'Disks' utility on a Knoppix usb, which revealed that it had over 131,000 bad sectors but, as usual, was apparently 'OK'. Needless to say I've become a little sceptical about the effectiveness (or even the existence) of the testing procedures at some branches of this company, but still don't fully understand how 'Disks' can be apparently so indulgent in its assessment of the overall state of the disk. How many 'bad sectors' does it take to render a hard drive 'not OK'?

ardvark71 11-14-2016 07:56 PM

Quote:

Originally Posted by Summer Deep (Post 5630623)
Bought a 250 GB Hitachi 2.5" mechanical hard drive from CEX at the weekend, scanned it with the 'Disks' utility on a Knoppix usb, which revealed that it had over 131,000 bad sectors but, as usual, was apparently 'OK'.

Hi...

Just as a side note, you might want to verify that number with Hitachi's hard drive diagnostic utility, which you can find here.

At the point you consider this issue resolved, please don't forget the mark this thread as "SOLVED" by clicking on "Thread Tools" directly above your initial post. Thanks! :)

Regards...

rknichols 11-14-2016 07:56 PM

Quote:

Originally Posted by Summer Deep (Post 5630623)
How many 'bad sectors' does it take to render a hard drive 'not OK'?

That is determined by the drive's manufacturer. When the SMART report starts saying "FAILING NOW" for one of the attributes, then the tool should report the drive as failed. The thresholds for the minimum acceptable values for each of the normalized attributes are set by the manufacturer. The tool is just reporting what the drive is saying.

Just out of curiosity, what does "smartctl -A" report for that drive?

Summer Deep 11-15-2016 07:39 PM

Quote:

Originally Posted by ardvark71 (Post 5630638)

At the point you consider this issue resolved, please don't forget the mark this thread as "SOLVED"


It was a very generalized original question, to which I wasn't expecting a specific 'solution', so I'm not sure it needs to be designated as 'solved'. Nonetheless, maybe the issue has now been aired as adequately as is practicable.

Quote:

Originally Posted by rknicholls
Just out of curiosity, what does "smartctl -A" report for that drive?

Sorry, I returned the hard drive to the retailer and no longer have it.


All times are GMT -5. The time now is 09:36 PM.