baruch / diskscan

Scan disk for bad or near failure sectors, performs disk diagnostics
GNU General Public License v3.0
108 stars 29 forks source link

Results unclear #30

Closed admirabilis closed 10 years ago

admirabilis commented 10 years ago

Hello, Baruch!

Last month I dropped my new laptop, and then I saw this nifty tool on Debian News. Thanks for writing and sharing it!

From what I figured out of the man page my disk is doomed? Can you please help me out with this?

$ sudo diskscan -s seq /dev/sda
diskscan version unknown-1104c45

I: Validating path /dev/sda
I: Opened disk /dev/sda sector size 512 num bytes 8124599280892641280
I: Scanning disk /dev/sda
Access time histogram:
       1: 6173767
      10: 1452837
     100: 3956
     500: 420
    1000: 128
    2000: 11
    3000: 1
    4000: 0
    5000: 0
    6000: 0
    7000: 0
    8000: 0
    9000: 0
   10000: 0
   15000: 0
   20000: 0
   25000: 0
   30000: 0
above that: 0
 2220 |                                                                       
      |                                                                       
      |                                  ^                                    
      |                                                                       
      |                                                                       
 1850 |                                                                       
      |                                                                       
      |                                                                       
      |    ^                                                                  
      |            ^^                                                         
 1480 |                                                                       
      |                                         ^                             
      |                                                                       
      |                                                                       
      |                ^^                                                     
 1110 |     ^        ^                                                        
      |  ^                                                                    
      |   ^  ^ ^^^    ^                                                       
      | ^                                                                     
      |           ^                                                           
  740 |       ^                      ^ ^     ^                                
      |                     ^                    ^                            
      |                                              ^                        
      |                         ^     ^    ^^ ^          ^                    
      |                   ^^ ^            ^    ^      ^^    ^  ^ ^^   ^^   ^ ^
  370 |                  ^       ^      ^           ^        ^^         ^     
      |                       ^   ^^^             ^             ^  ^^     ^ ^ 
      |                        ^                   ^    ^ ^^         ^   ^    
      | **********************************************************************
      | ______________________________________________________________________
      +-----------------------------------------------------------------------
I: Closed disk /dev/sda

What I have noticed from these results is that it starts slow where the disk is full and then gets gradually faster where it is mostly empty...

The results from smartctl don't seem to display anything wrong, though:

$ sudo smartctl -A /dev/sda
smartctl 5.41 2011-06-09 r3365 [i686-linux-3.10-7.dmz.1-liquorix-686] (local build)
Copyright (C) 2002-11 by Bruce Allen, http://smartmontools.sourceforge.net

=== START OF READ SMART DATA SECTION ===
SMART Attributes Data Structure revision number: 16
Vendor Specific SMART Attributes with Thresholds:
ID# ATTRIBUTE_NAME          FLAG     VALUE WORST THRESH TYPE      UPDATED  WHEN_FAILED RAW_VALUE
  1 Raw_Read_Error_Rate     0x002f   200   200   051    Pre-fail  Always       -       0
  3 Spin_Up_Time            0x0027   176   174   021    Pre-fail  Always       -       2158
  4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always       -       447
  5 Reallocated_Sector_Ct   0x0033   200   200   140    Pre-fail  Always       -       0
  7 Seek_Error_Rate         0x002e   200   200   000    Old_age   Always       -       0
  9 Power_On_Hours          0x0032   097   097   000    Old_age   Always       -       2333
 10 Spin_Retry_Count        0x0032   100   100   000    Old_age   Always       -       0
 11 Calibration_Retry_Count 0x0032   100   100   000    Old_age   Always       -       0
 12 Power_Cycle_Count       0x0032   100   100   000    Old_age   Always       -       446
192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       23
193 Load_Cycle_Count        0x0032   199   199   000    Old_age   Always       -       5956
194 Temperature_Celsius     0x0022   104   099   000    Old_age   Always       -       43
196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always       -       0
198 Offline_Uncorrectable   0x0030   100   253   000    Old_age   Offline      -       0
199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always       -       0
200 Multi_Zone_Error_Rate   0x0008   100   253   000    Old_age   Offline      -       0

Thanks for you attention!

baruch commented 10 years ago

The disk is not in the best shape but it's not near death either. You can try to run it with --fix and diskscan will rewrite back sectors that took long to read. I've seen it help considerably on some older disks I had that showed some problems. It lets the disk either reallocate or just plain rewrite locations that are slightly off the mark.

Do run --fix only a disk you are not working with and not booted from at the time, that means using it from a live-cd image. Otherwise data corruption may occur. I have issue #20 to handle that automatically for the users.

admirabilis commented 10 years ago

Hello, Baruch! Thanks for your reply!

Before running it with the `--fix' option, I decided to run the read-only test again, just to see if it would show the same results, because yesterday I run it while working and playing music, which could be the reason for the slow reads.

But see what I got:

(teresaejunior)> sudo diskscan -s seq /dev/sda
diskscan version unknown-1104c45

I: Validating path /dev/sda
I: Opened disk /dev/sda sector size 512 num bytes 8124599280892641280
I: Scanning disk /dev/sda
I: Fixing region by rewriting, offset=-1774232576 size=83
E: Error while attempting to rewrite the data! errno=9: Bad file descriptor
I: Fixing region by rewriting, offset=-1774101504 size=83
E: Error while attempting to rewrite the data! errno=9: Bad file descriptor
^CI: Disk scan interrupted

And I'm sure I run it without `--fix', I just copied the text from the terminal and pasted here. The disk was mounted, now I'm worried!!! Maybe this should be updated on Debian if it was already fixed here!

Thanks for your attention again!

baruch commented 10 years ago

there was a but in that version of diskscan that tried to fix even without the fix flag but it couldn't because the disk was opened as read only. You shouldn't worry about that. On Dec 27, 2013 5:34 PM, "teresaejunior" notifications@github.com wrote:

Hello, Baruch! Thanks for your reply!

Before running it with the `--fix' option, I decided to run the read-only test again, just to see if it would show the same results, because yesterday I run it while working and playing music, which could be the reason for the slow reads.

But see what I got:

(teresaejunior)> sudo diskscan -s seq /dev/sda diskscan version unknown-1104c45

I: Validating path /dev/sda I: Opened disk /dev/sda sector size 512 num bytes 8124599280892641280 I: Scanning disk /dev/sda I: Fixing region by rewriting, offset=-1774232576 size=83 E: Error while attempting to rewrite the data! errno=9: Bad file descriptor I: Fixing region by rewriting, offset=-1774101504 size=83 E: Error while attempting to rewrite the data! errno=9: Bad file descriptor ^CI: Disk scan interrupted

And I'm sure I run it without `--fix', I just copied the text from the terminal and pasted here. The disk was mounted, now I'm worried!!! Maybe this should be updated on Debian if it was already fixed here!

Thanks for your attention again!

— Reply to this email directly or view it on GitHubhttps://github.com/baruch/diskscan/issues/30#issuecomment-31266788 .

admirabilis commented 10 years ago

But opened read-only by diskscan, you mean? Because the disk was mounted as read-write.

baruch commented 10 years ago

Yes. Diskscan openned the disk as read only. That's why you saw the errors when it tried to fix when it shouldn't have even tried. On Dec 27, 2013 6:39 PM, "teresaejunior" notifications@github.com wrote:

But opened read-only by diskscan, you mean? Because the disk was mounted as read-write.

— Reply to this email directly or view it on GitHubhttps://github.com/baruch/diskscan/issues/30#issuecomment-31269549 .

admirabilis commented 10 years ago

OK, awesome! Thanks!

baruch commented 10 years ago

The yet unreleased version tries to give an answer if the disk is ok or not. In the case shown above it would say the disk is ok. I hoped to release that version by now but it got delayed. Closing this ticket for now, if you find the next version unsatisfactory in that regard feel free to open another ticket on this.

Cheers!

admirabilis commented 10 years ago

OK, I'll certainly try it again when the new version comes! Thanks!

baruch commented 10 years ago

Hi,

Just thought to let you now that a new version was released. It should fix that issue you saw.

Let me know how it works for you.

Baruch

On Fri, Dec 27, 2013 at 11:55 PM, teresaejunior notifications@github.comwrote:

OK, I'll certainly try it again when the new version comes! Thanks!

— Reply to this email directly or view it on GitHubhttps://github.com/baruch/diskscan/issues/30#issuecomment-31281855 .

admirabilis commented 10 years ago

I have just tested the new version, and this problem was fixed, and it also displayed "passed" at the end, which helps the faint of heart!

Thanks, Baruch!

baruch commented 10 years ago

Yay! On Jun 5, 2014 2:32 PM, "teresaejunior" notifications@github.com wrote:

I have just tested the new version, and this problem was fixed, and it also displayed "passed" at the end, which helps the faint of heart!

Thanks, Baruch!

— Reply to this email directly or view it on GitHub https://github.com/baruch/diskscan/issues/30#issuecomment-45208391.