You are not logged in.

#1 2017-07-10 19:39:29

buntolo
Member
Registered: 2011-10-11
Posts: 202

Can't fix disk with smart error

I've various disks with issues, I'm trying to isolate their bad sectors, but I don't know how. I've read many guides which essentially go like this;
1) Run 'smartctl -t short/long /dev/sdX' to find LBA_of_first_error values.
2) Translate this value from hexadecimal to decimal.
3) Locate these sectors inside the partitions.
4) Fill these sectors with 'dd if=/dev/zero of=/dev/sdXY seek=$sector.
5) Run 'smartctl -t short/long /dev/sdX' again to find if there are other errors and if those sectors have been "cut out" of the partitions.

NOTE: I don't have any partition on this disk, so I've skipeed the part about locating the bad sector on partition.

% sudo smartctl -a /dev/sdd
smartctl 6.5 2016-05-07 r4318 [x86_64-linux-4.11.6-1-ARCH] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     Western Digital Caviar Blue Serial ATA
Device Model:     WDC WD3200AAJS-22B4A0
Serial Number:    WD-WCAT10863186
LU WWN Device Id: 5 0014ee 156674dc0
Firmware Version: 01.03A01
User Capacity:    320,072,933,376 bytes [320 GB]
Sector Size:      512 bytes logical/physical
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ATA8-ACS (minor revision not indicated)
SATA Version is:  SATA 2.5, 3.0 Gb/s
Local Time is:    Mon Jul 10 17:52:41 2017 EEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x82)	Offline data collection activity
					was completed without error.
					Auto Offline Data Collection: Enabled.
Self-test execution status:      (   0)	The previous self-test routine completed
					without error or no self-test has ever 
					been run.
Total time to complete Offline 
data collection: 		( 6000) seconds.
Offline data collection
capabilities: 			 (0x7b) SMART execute Offline immediate.
					Auto Offline data collection on/off support.
					Suspend Offline collection upon new
					command.
					Offline surface scan supported.
					Self-test supported.
					Conveyance Self-test supported.
					Selective Self-test supported.
SMART capabilities:            (0x0003)	Saves SMART data before entering
					power-saving mode.
					Supports SMART auto save timer.
Error logging capability:        (0x01)	Error logging supported.
					General Purpose Logging supported.
Short self-test routine 
recommended polling time: 	 (   2) minutes.
Extended self-test routine
recommended polling time: 	 (  73) minutes.
Conveyance self-test routine
recommended polling time: 	 (   5) minutes.
SCT capabilities: 	       (0x303f)	SCT Status supported.
					SCT Error Recovery Control supported.
					SCT Feature Control supported.
					SCT Data Table supported.

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   189   051    Pre-fail  Always       -       117
  3 Spin_Up_Time            0x0027   177   154   021    Pre-fail  Always       -       2108
  4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always       -       156
  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   100   100   000    Old_age   Always       -       50
 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       -       153
192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       140
193 Load_Cycle_Count        0x0032   200   200   000    Old_age   Always       -       156
194 Temperature_Celsius     0x0022   110   105   000    Old_age   Always       -       33
196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always       -       7
198 Offline_Uncorrectable   0x0030   200   200   000    Old_age   Offline      -       7
199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always       -       0
200 Multi_Zone_Error_Rate   0x0008   200   200   000    Old_age   Offline      -       2

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Short offline       Completed: read failure       90%        33         110120431

SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.

I've converted LBA_of_first_error=110120431 from hex to dec 4564583473 and then failed to zero the disk:

LC_ALL=C sudo dd if=/dev/zero of=/dev/sdd bs=512 count=1 seek=4564583473                                                                       :(
dd: /dev/sdd: cannot seek: Invalid argument
0+0 records in
0+0 records out
0 bytes copied, 0.000204172 s, 0.0 kB/s

Tried again with bs=1:

% LC_ALL=C sudo dd if=/dev/zero of=/dev/sdd bs=1 count=1 seek=4564583473                                                                       :(
1+0 records in
1+0 records out
1 byte copied, 0.0130282 s, 0.1 kB/s

dd went fine, but nothing has been solved:

% sudo smartctl -t short /dev/sdd                                                                                                                :(
smartctl 6.5 2016-05-07 r4318 [x86_64-linux-4.11.6-1-ARCH] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===
Sending command: "Execute SMART Short self-test routine immediately in off-line mode".
Drive command "Execute SMART Short self-test routine immediately in off-line mode" successful.
Testing has begun.
Please wait 2 minutes for test to complete.
Test will complete after Mon Jul 10 20:46:38 2017

Use smartctl -X to abort test.

% sudo smartctl -a /dev/sdd
smartctl 6.5 2016-05-07 r4318 [x86_64-linux-4.11.6-1-ARCH] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     Western Digital Caviar Blue Serial ATA
Device Model:     WDC WD3200AAJS-22B4A0
Serial Number:    WD-WCAT10863186
LU WWN Device Id: 5 0014ee 156674dc0
Firmware Version: 01.03A01
User Capacity:    320,072,933,376 bytes [320 GB]
Sector Size:      512 bytes logical/physical
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ATA8-ACS (minor revision not indicated)
SATA Version is:  SATA 2.5, 3.0 Gb/s
Local Time is:    Mon Jul 10 20:58:51 2017 EEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x85)	Offline data collection activity
					was aborted by an interrupting command from host.
					Auto Offline Data Collection: Enabled.
Self-test execution status:      ( 121)	The previous self-test completed having
					the read element of the test failed.
Total time to complete Offline 
data collection: 		( 6000) seconds.
Offline data collection
capabilities: 			 (0x7b) SMART execute Offline immediate.
					Auto Offline data collection on/off support.
					Suspend Offline collection upon new
					command.
					Offline surface scan supported.
					Self-test supported.
					Conveyance Self-test supported.
					Selective Self-test supported.
SMART capabilities:            (0x0003)	Saves SMART data before entering
					power-saving mode.
					Supports SMART auto save timer.
Error logging capability:        (0x01)	Error logging supported.
					General Purpose Logging supported.
Short self-test routine 
recommended polling time: 	 (   2) minutes.
Extended self-test routine
recommended polling time: 	 (  73) minutes.
Conveyance self-test routine
recommended polling time: 	 (   5) minutes.
SCT capabilities: 	       (0x303f)	SCT Status supported.
					SCT Error Recovery Control supported.
					SCT Feature Control supported.
					SCT Data Table supported.

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   189   051    Pre-fail  Always       -       117
  3 Spin_Up_Time            0x0027   177   154   021    Pre-fail  Always       -       2108
  4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always       -       156
  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   100   100   000    Old_age   Always       -       53
 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       -       153
192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       140
193 Load_Cycle_Count        0x0032   200   200   000    Old_age   Always       -       156
194 Temperature_Celsius     0x0022   109   105   000    Old_age   Always       -       34
196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always       -       6
198 Offline_Uncorrectable   0x0030   200   200   000    Old_age   Offline      -       7
199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always       -       0
200 Multi_Zone_Error_Rate   0x0008   200   200   000    Old_age   Offline      -       2

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Short offline       Completed: read failure       90%        52         110120431
# 2  Short offline       Completed: read failure       90%        52         110120431
# 3  Extended offline    Completed: read failure       90%        50         110120431
# 4  Short offline       Completed: read failure       90%        33         110120431

SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.

I've also tried without converting from hex to dec, without success:

% LC_ALL=C sudo dd if=/dev/zero of=/dev/sdd bs=1 count=1 seek=110120431                                                                        :(
1+0 records in
1+0 records out
1 byte copied, 0.0247385 s, 0.0 kB/s

% sudo smartctl -t short /dev/sdd                                      
smartctl 6.5 2016-05-07 r4318 [x86_64-linux-4.11.6-1-ARCH] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF OFFLINE IMMEDIATE AND SELF-TEST SECTION ===
Sending command: "Execute SMART Short self-test routine immediately in off-line mode".
Drive command "Execute SMART Short self-test routine immediately in off-line mode" successful.
Testing has begun.
Please wait 2 minutes for test to complete.
Test will complete after Mon Jul 10 21:01:17 2017

Use smartctl -X to abort test.

% sudo smartctl -a /dev/sdd                                      
smartctl 6.5 2016-05-07 r4318 [x86_64-linux-4.11.6-1-ARCH] (local build)
Copyright (C) 2002-16, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Model Family:     Western Digital Caviar Blue Serial ATA
Device Model:     WDC WD3200AAJS-22B4A0
Serial Number:    WD-WCAT10863186
LU WWN Device Id: 5 0014ee 156674dc0
Firmware Version: 01.03A01
User Capacity:    320,072,933,376 bytes [320 GB]
Sector Size:      512 bytes logical/physical
Device is:        In smartctl database [for details use: -P show]
ATA Version is:   ATA8-ACS (minor revision not indicated)
SATA Version is:  SATA 2.5, 3.0 Gb/s
Local Time is:    Mon Jul 10 22:25:35 2017 EEST
SMART support is: Available - device has SMART capability.
SMART support is: Enabled

=== START OF READ SMART DATA SECTION ===
SMART overall-health self-assessment test result: PASSED

General SMART Values:
Offline data collection status:  (0x82)	Offline data collection activity
					was completed without error.
					Auto Offline Data Collection: Enabled.
Self-test execution status:      ( 121)	The previous self-test completed having
					the read element of the test failed.
Total time to complete Offline 
data collection: 		( 6000) seconds.
Offline data collection
capabilities: 			 (0x7b) SMART execute Offline immediate.
					Auto Offline data collection on/off support.
					Suspend Offline collection upon new
					command.
					Offline surface scan supported.
					Self-test supported.
					Conveyance Self-test supported.
					Selective Self-test supported.
SMART capabilities:            (0x0003)	Saves SMART data before entering
					power-saving mode.
					Supports SMART auto save timer.
Error logging capability:        (0x01)	Error logging supported.
					General Purpose Logging supported.
Short self-test routine 
recommended polling time: 	 (   2) minutes.
Extended self-test routine
recommended polling time: 	 (  73) minutes.
Conveyance self-test routine
recommended polling time: 	 (   5) minutes.
SCT capabilities: 	       (0x303f)	SCT Status supported.
					SCT Error Recovery Control supported.
					SCT Feature Control supported.
					SCT Data Table supported.

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   189   051    Pre-fail  Always       -       117
  3 Spin_Up_Time            0x0027   177   154   021    Pre-fail  Always       -       2108
  4 Start_Stop_Count        0x0032   100   100   000    Old_age   Always       -       156
  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   100   100   000    Old_age   Always       -       54
 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       -       153
192 Power-Off_Retract_Count 0x0032   200   200   000    Old_age   Always       -       140
193 Load_Cycle_Count        0x0032   200   200   000    Old_age   Always       -       156
194 Temperature_Celsius     0x0022   108   105   000    Old_age   Always       -       35
196 Reallocated_Event_Count 0x0032   200   200   000    Old_age   Always       -       0
197 Current_Pending_Sector  0x0032   200   200   000    Old_age   Always       -       6
198 Offline_Uncorrectable   0x0030   200   200   000    Old_age   Offline      -       6
199 UDMA_CRC_Error_Count    0x0032   200   200   000    Old_age   Always       -       0
200 Multi_Zone_Error_Rate   0x0008   200   200   000    Old_age   Offline      -       2

SMART Error Log Version: 1
No Errors Logged

SMART Self-test log structure revision number 1
Num  Test_Description    Status                  Remaining  LifeTime(hours)  LBA_of_first_error
# 1  Short offline       Completed: read failure       90%        53         110120431
# 2  Short offline       Completed: read failure       90%        52         110120431
# 3  Short offline       Completed: read failure       90%        52         110120431
# 4  Extended offline    Completed: read failure       90%        50         110120431
# 5  Short offline       Completed: read failure       90%        33         110120431

SMART Selective self-test log data structure revision number 1
 SPAN  MIN_LBA  MAX_LBA  CURRENT_TEST_STATUS
    1        0        0  Not_testing
    2        0        0  Not_testing
    3        0        0  Not_testing
    4        0        0  Not_testing
    5        0        0  Not_testing
Selective self-test flags (0x0):
  After scanning selected spans, do NOT read-scan remainder of disk.
If Selective self-test is pending on power-up, resume after 0 minute delay.

Offline

#2 2017-07-10 21:24:03

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: Can't fix disk with smart error

You probably want 'dd if=/dev/zero of=/dev/sdd bs=512 count=1 seek=110120431'. The number might be off by one sector but it should be something like that. As far as I know smartctl will report the first lba with errors in decimal form not hexadecimal.

That said, if you don't have data on the disk just run badblocks in the write-read mode and recheck for errors, if you still find some that disk is toast.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#3 2017-07-10 21:44:09

mpan
Member
Registered: 2012-08-01
Posts: 1,675
Website

Re: Can't fix disk with smart error

buntolo:
It can’t be 4564583473 — it would mean 2337066738176 bytes, over 2TB. It seems like the value is given in decimal base already. 110120431 makes much more sense, as it indicates somewhere around ~56GB.

However… I don’t see anything to “fix”. I don’t see what could be fixed and how, but your SMART data is perfect and indicates no errors at all. Reallocated_Sector_Ct is 0, which means that the drive has not a single bad sector yet. Also the HDD seems young, like fresh from factory: for current WDs raw values in Start_Stop_Count, Power_On_Hours, Spin_Retry_Count, Power_Cycle_Count and Power-Off_Retract_Count are exactly what they state, in the most obvious units. Raw_Read_Error_Rate is meaningless alone — only delta from the previous value per time is useful, but it is quite normal for it to grow slowly over time even for the healthiest disk. Some may argue that the temperature (33°C) is bit too low, possibly a sign of some fan accidently blowing air at the drive, but I’ve seen no consistent data that supports that idea¹.

Except for what R00KIE has said about badblocks, check your power cables and see dmesg for any signs of the drive being powered down for any reason during the test. If this will not help, you may try asking at HDD Guru Forums.

Note, however, that if there is a bad sector, there is nothing you can do about it except discarding the device. There is no magical command that will fix it by writing some value to that sector. The firmware already manages bad sectors for you and silently, transparently relocates them if needed. If any is detected outside of the HDD it indicates that the drive is so damaged that the firmware has reached its own capacity in preventing them from being visible to the outside world. Some vendors — don’t remember if WD is among them — deliver their tools (proprietary, most propably requiring Microsoft® Windows®) that can do some voo-doo and it may help, but this is primarily meant for the cases of the firmware itself malfunctioning or various rare situations².
____
¹ Google’s is a good initial research, but hardly a complete one, considering that they have used only some limited subset of drives.
² Which I will not list in detail for the simple reason: my precise knowledge ends at this point. Basically these are things related to problems with head alignment, low-level errors on the drive that prevent proper synchronizing et cetera.

Last edited by mpan (2017-07-10 21:57:14)

Offline

#4 2017-07-10 22:07:19

buntolo
Member
Registered: 2011-10-11
Posts: 202

Re: Can't fix disk with smart error

I just want to reallocate the bad sector in order to be discarded.
This disk is pretty old, it's like 12 years old, so it's strange that it appears as new. The errors can't be at ~50 hours of life.

I've already tried to use '% LC_ALL=C sudo dd if=/dev/zero of=/dev/sdd bs=1 count=1 seek=110120431'.

Badblocks takes ages on a raspberry, I've one raspberry using badblocks for 4/5 days on a 2tb disk and another raspberry zeroing a 1.5tb drive.

I've no data on this disk, would be better zeroing the whole driver instead of scanning the whole drive for bad blocks and then writing them only?

Offline

#5 2017-07-11 01:27:24

tom.ty89
Member
Registered: 2012-11-15
Posts: 897

Re: Can't fix disk with smart error

Read what R00KIE said carefully and stop using bs=1, that makes no sense at all. bs= should be set to the logical block size of your drive (mostly 512, can be checked with fdisk -l), since your are counting logical blocks (you know that LBA stands for Logical Block Address, do you?)

The value is unlikely hex because there is almost no reason for smartctl not to print it in dec anyway.

seek=110120431 is correct because you want to you want to seek from LBA 0 to LBA 110120430, which is of 110120431 blocks, and count=1 would cover LBA 110120431, which is where the first error is. FWIW seek= / count= are relative values that are related to bs=. If bs=1, count=1 means read/write 1 byte, for example.

P.S. I am uncertain if filling it with zero is supposed to produce your expected effect though.

Last edited by tom.ty89 (2017-07-11 01:31:00)

Offline

#6 2017-07-11 09:09:01

buntolo
Member
Registered: 2011-10-11
Posts: 202

Re: Can't fix disk with smart error

Fact is, with bs=512 it doesn't work and one of the suggestions I've found on the web was using bs=1 and it worked apparently.

% LC_ALL=C sudo dd if=/dev/zero of=/dev/sdd bs=512 count=1 seek=110120431
dd: error writing '/dev/sdd': Input/output error
1+0 records in
0+0 records out
0 bytes copied, 3.26115 s, 0.0 kB/s

% LC_ALL=C sudo dd if=/dev/zero of=/dev/sdd bs=1 count=1 seek=110120431
1+0 records in
1+0 records out
1 byte copied, 0.010133 s, 0.1 kB/s

Anyway after another 'smartctl -t short /dev/sdd' I still have the same error, so I don't know how to cut out this sector or whatever it is.

I'm following mostly the smartmontools wiki: https://www.smartmontools.org/wiki/BadBlockHowto

Last edited by buntolo (2017-07-11 09:21:51)

Offline

#7 2017-07-11 10:01:05

tom.ty89
Member
Registered: 2012-11-15
Posts: 897

Re: Can't fix disk with smart error

Really? Because I/O error look exactly right to me, since the logical block you are trying to zero-fill (fwiw, it's still ordinary write...) is a bad sector. That's why I was sort of confused on why you are trying to do that...

I guess what you are really trying to do is to trigger some block remapping/relocating mechanism in the controller so that LBA would be remapped to a healthy/reserved physical sector. No idea how that should be done, but (attempt to) write to it once is definitely not enough (otherwise you may not even be aware of the bad sector...)

P.S. I am amazed that you would consider some random successful write as "worked". Please get to know the program you use (by reading its manual / documentation) or get to understand what you are doing / working on instead of blindly following guide/tutorial on random website which might either be total garbage or talking about a whole different case.

Last edited by tom.ty89 (2017-07-11 10:09:45)

Offline

#8 2017-07-11 10:08:26

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: Can't fix disk with smart error

buntolo wrote:

I just want to reallocate the bad sector in order to be discarded.
This disk is pretty old, it's like 12 years old, so it's strange that it appears as new. The errors can't be at ~50 hours of life.

According to your disk it has been on for 55 hours, the errors are logged with the power on time the disk is reporting at the time the error occurs.

buntolo wrote:

Badblocks takes ages on a raspberry, I've one raspberry using badblocks for 4/5 days on a 2tb disk and another raspberry zeroing a 1.5tb drive.

For large disks it's better to use a proper computer with a usb3 port and usb3 adapter or connect the disk directly via sata. That said we don't support ARM boards here.

buntolo wrote:

I've no data on this disk, would be better zeroing the whole driver instead of scanning the whole drive for bad blocks and then writing them only?

Would be much easier, even better is using badblocks as I've said before, if you get read or compare errors then throw that disk away.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#9 2017-07-11 11:58:51

buntolo
Member
Registered: 2011-10-11
Posts: 202

Re: Can't fix disk with smart error

Are you suggesting that I should follow this wiki entry? https://wiki.archlinux.org/index.php/Ba … m_Creation

tom.ty89 wrote:

Really? Because I/O error look exactly right to me, since the logical block you are trying to zero-fill (fwiw, it's still ordinary write...) is a bad sector. That's why I was sort of confused on why you are trying to do that...

I'm trying to write on purpose on the bad sector to trigger its reallocation. Using bs=512 I get that I/O error and 0 records/bytes out, while using bs=1 I get no I/O errors and 1 record/byte out. I thought, but I wasn't sure as I didn't find any reference that this way reallocation should be triggered, but it didn't. For what I've understood, using bs=1 on a bs=X disk, I'll write zeros X time (512 times in my case).

My main reference is the wiki for smartmontools, the toolset containing smartctl, I can't think about anything better.
I'm following the archwiki for finding badblocks, but it's awfully slow, even on a laptop via USB it took 105 or 170 hours, I don't remember.

I spent hours, like 10 hours minimum, googling and reading manuals and stuffs about badblocks and smartctl, but I can't find the answers I'm looking for. For example, manuals explain only command options, but not the output, I didn't find yet any clear explanation for every voice in smartctl output. This is incomplete: https://www.smartmontools.org/wiki/FAQ# … doesitmean

R00KIE wrote:

According to your disk it has been on for 55 hours, the errors are logged with the power on time the disk is reporting at the time the error occurs.

Ok, It's definitely wrong, I've read this but I don't understand if it has been reset in my case: https://www.smartmontools.org/wiki/FAQ# … italWDdisk

Offline

#10 2017-07-11 12:47:17

tom.ty89
Member
Registered: 2012-11-15
Posts: 897

Re: Can't fix disk with smart error

buntolo wrote:

For what I've understood, using bs=1 on a bs=X disk, I'll write zeros X time (512 times in my case).

You are not making any sense. Please at least `man dd`.

Say you use

dd if=/dev/zero of=/dev/sdX bs=1 seek=512 count=1

on a disk with logical block size of 512 bytes:

seek=512 will make it skip 1 logical block of the target before it starts writing (i.e. skip LBA 0 and write LBA 1 of sdX), because with bs=1, 512 means 512 x 1 byte = 512 bytes.

count=1 would make it (over)write the first single byte, also because of bs=1, of LBA 1 with zero, while the content of the remaining 511 bytes would remain the unchanged; although behind the scene the whole block is rewritten since logical block is the atomic unit of a drive.

Last edited by tom.ty89 (2017-07-11 12:48:26)

Offline

#11 2017-07-11 14:00:31

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: Can't fix disk with smart error

buntolo wrote:
R00KIE wrote:

According to your disk it has been on for 55 hours, the errors are logged with the power on time the disk is reporting at the time the error occurs.

Ok, It's definitely wrong, I've read this but I don't understand if it has been reset in my case: https://www.smartmontools.org/wiki/FAQ# … italWDdisk

That seems to imply the value that is stored in the logs can be wrong but attribute 9 is always right and yours is definitely around 50 power on hours.


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#12 2017-07-11 14:50:07

buntolo
Member
Registered: 2011-10-11
Posts: 202

Re: Can't fix disk with smart error

1) I've 3 faulty drives and my goal is to make them usable for non-critical files (download folder for torrentbox, data scrapyard, steam/music/movies holder).
Now I'm trying to make non-usable the bad sector on this WD 320GB, but following the smartmontools wiki instruction I'm failing.

2) Is there a reason for this or anything I can do?

3) Is following archwiki instructions for badblocks (https://wiki.archlinux.org/index.php/Ba … m_Creation) the only option left?

4)

R00KIE wrote:

That seems to imply the value that is stored in the logs can be wrong but attribute 9 is always right and yours is definitely around 50 power on hours.

I'm floored. I bought this disk when I built my first custom desktop PC in 2005 and I've used Windows XP, 7, Ubuntu, debian and archlinux on this disk, I spent several hundreds hours using this disk, so I've searched reasons for which attribute 9 may be changed or corrupted. Do you have any clue?

5)

tom.ty89 wrote:

Say you use

dd if=/dev/zero of=/dev/sdX bs=1 seek=512 count=1

on a disk with logical block size of 512 bytes:

seek=512 will make it skip 1 logical block of the target before it starts writing (i.e. skip LBA 0 and write LBA 1 of sdX), because with bs=1, 512 means 512 x 1 byte = 512 bytes.

count=1 would make it (over)write the first single byte, also because of bs=1, of LBA 1 with zero, while the content of the remaining 511 bytes would remain the unchanged; although behind the scene the whole block is rewritten since logical block is the atomic unit of a drive.

I wrote it badly, I forgot to put count in the sentence, I was following this thread: https://askubuntu.com/questions/388997/ … 12-count-1

Anyway I've read manuals as I've already explained in my previous post, in this case my opinion is that dd manual is pretty poor and scarce in informations: http://man7.org/linux/man-pages/man1/dd.1.html

DESCRIPTION

       [...]

       bs=BYTES
              read and write up to BYTES bytes at a time

       [...]

       count=N
              copy only N input blocks

So in my opinion there's no explanation for the encountered error I/O and the behaviours using other settings.

Offline

#13 2017-07-11 16:17:33

R00KIE
Forum Fellow
From: Between a computer and a chair
Registered: 2008-09-14
Posts: 4,734

Re: Can't fix disk with smart error

No idea why the power on hours attribute would not be correct, maybe it wraps around after some time.

Just let badblocks do its job, that said if you know the disks are bad and they are starting to go then you can be sure you po.. cat video collection is not going to last very long on those disks.

I know what you are trying to do, and it works if the problem sectors experienced some transient problem but if the disk is starting to go then it will not help and it will save you time and trouble to just bite the bullet and get new disks (or flash drives depending on how much space you need - even crap slow flash drives can pass as usable once you put them in a raid array, the bonus here is no noise and no need to wait for them to spin up).


R00KIE
Tm90aGluZyB0byBzZWUgaGVyZSwgbW92ZSBhbG9uZy4K

Offline

#14 2017-07-11 16:53:27

buntolo
Member
Registered: 2011-10-11
Posts: 202

Re: Can't fix disk with smart error

R00KIE wrote:

No idea why the power on hours attribute would not be correct, maybe it wraps around after some time.

Just let badblocks do its job, that said if you know the disks are bad and they are starting to go then you can be sure you po.. cat video collection is not going to last very long on those disks.

I know what you are trying to do, and it works if the problem sectors experienced some transient problem but if the disk is starting to go then it will not help and it will save you time and trouble to just bite the bullet and get new disks (or flash drives depending on how much space you need - even crap slow flash drives can pass as usable once you put them in a raid array, the bonus here is no noise and no need to wait for them to spin up).

I use youp*** for non-cat videos, I hate buffering in certain situations.

I'll go with badblocks then, I'm looking around for new drives, but I've bought a new (used) PC and being unempolyed I don't have money to throw away. I'll buy 2xNAS HDDs one day, but it may take months.
The 1.5TB is an used hdd I've bought exactly for the await of new NAS HDDs, but it near-death with 4500 reallocated sectors.

Question: how do I get how many spare/replacement sectors a drive has?

Offline

#15 2017-07-11 20:42:30

tom.ty89
Member
Registered: 2012-11-15
Posts: 897

Re: Can't fix disk with smart error

buntolo wrote:

Anyway I've read manuals as I've already explained in my previous post, in this case my opinion is that dd manual is pretty poor and scarce in informations: http://man7.org/linux/man-pages/man1/dd.1.html

DESCRIPTION

       [...]

       bs=BYTES
              read and write up to BYTES bytes at a time

       [...]

       count=N
              copy only N input blocks

Well because you are using dd in GNU coreutils. GNU prefers their `info` instead of `man` so yeah it's not surprising that the man pages suck. I did say manual / docs instead of man pages though tongue

These are probably better choices:
http://www.gnu.org/software/coreutils/m … invocation
https://www.mankier.com/1p/dd

buntolo wrote:

So in my opinion there's no explanation for the encountered error I/O and the behaviours using other settings.

I bail.

Offline

Board footer

Powered by FluxBB