DaemonForums  

Go Back   DaemonForums > Miscellaneous > General Hardware

General Hardware General hardware related questions.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 5th May 2022
ripe's Avatar
ripe ripe is offline
Package Pilot
 
Join Date: Feb 2013
Location: France
Posts: 175
Default wdok: uncorrectable data error reading

Hi,
My hdd seems to have problems. I was listing to music on Internet and recording it with aucat when the system stop to respond and I have to do a manual reboot.
At the reboot, the system check and I have this message:
Code:
The following file system had an unexpected inconsistency:
ffs: 70dd...........(/home)
Automatic file system check failed; help!
Enter pathname of shell or Return for sh:
I hit enter and type:
Code:
fsck -y
and some messages like this appear:
Code:
wdok: uncorrectable data error reading fsbn 24053952 of 24053952-24053983 (wd0 bn 5394480032; cn 9224 tn 208 sn 48), retrying
...
Cannot read: BLK 24053952
Continue? yes
fsck finish his job and I have to reboot.

I think I wrote on a bad sector and this stop system.
Trying this method https://caoua.org/alex/obsd/badsect.html seems to not help.e
Code:
# umount /dev/wd0k   
umount: /home: Device busy

if=/dev/rwd0k skip=24053952 of=/dev/null count=1
1+0 records in
1+0 records out
512 bytes transferred in 0.016 secs (31810 bytes/sec)

e# dd if=/dev/zero of=/dev/rwd0k seek=24053952 count=1 
dd: /dev/rwd0k: Device busy

Any idea?
Thanks
Attached Files
File Type: txt dmesg_05_05_2022.txt (6.8 KB, 17 views)

Last edited by ripe; 5th May 2022 at 10:41 AM. Reason: Bad typo
Reply With Quote
  #2   (View Single Post)  
Old 5th May 2022
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

Let's start with the filesystem.
Quote:
Originally Posted by ripe View Post
Code:
fsck -y
The `-y` option will produce data loss to resolve any filesystem metadata issues. Files will be deleted.
Quote:
Code:
# umount /dev/wd0k   
umount: /home: Device busy
You cannot unmount a filesystem if it is in use. A common accidental "use" is a shell's working directory. So if, for example, you have a terminal window running a shell sitting at `/home/ripe` your unmount command will produce this error message. You can, of course, force an unmount with -f, per the unmount(8) man page.

Your `dd` command failed because /home was still mounted and in use.

Now, as to your problem hard drive:

Quote:
Code:
wdok: uncorrectable data error reading fsbn 24053952 of 24053952-24053983 (wd0 bn 5394480032; cn 9224 tn 208 sn 48), retrying
...
Cannot read: BLK 24053952
Continue? yes
...
I think I wrote on a bad sector and this stop system.
Writing to a bad sector doesn't usually cause any obvious problem at the moment of writing. While it may not write successfully, the drive doesn't report any sort of error at that moment. It's attempting to read the bad sector after writing to it when problems are noticeable.

There are two types of read failures that occur with mechanical/magnetic hard drives: correctable read failures which are considered temporary, and uncorrectable read failures which are considered permanent. Each attempt to retry a correctable read error impacts drive performance, as your Maxtor 7200 rpm drive must wait 8.33 msec between each read attempt of the same failing sector.

Once a drive has identified uncorrectable bad sectors, writing to those sector addresses after identification will cause the drive to relocate the new data to "spare" locations elsewhere on the drive. Until there are no more spare sectors available for reallocation.

The drive's electronics can report its error history through its S.M.A.R.T. logs, which can be read with the smartctl(8) utiity included with the `smartmontools` package. The utility can do drive testing as well as reporting, but IIRC it does not provide any bad sector reallocation services.

Last edited by jggimi; 5th May 2022 at 11:45 AM. Reason: clarity
Reply With Quote
  #3   (View Single Post)  
Old 5th May 2022
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

OpenBSD also has a badsect(8) tool, which may be used to reserve known bad sectors which cannot be reallocated by drive electronics, as the tool predates drive electronics that manage spare sectors.

Replacing a failing drive is usually a better option.
Reply With Quote
  #4   (View Single Post)  
Old 5th May 2022
ripe's Avatar
ripe ripe is offline
Package Pilot
 
Join Date: Feb 2013
Location: France
Posts: 175
Default

Ok thank you jggimi, I will look error with smartctl, as I need to umount the wd0k before.
What I dont understand it is why I still have my system stopping and not responding after those "uncorrectable data error reading" I mean I suppose I have enough space to relocate date (i think)? Why crashing just for not reading block that can be tagged "uncorrectable data error"?
Reply With Quote
  #5   (View Single Post)  
Old 5th May 2022
ripe's Avatar
ripe ripe is offline
Package Pilot
 
Join Date: Feb 2013
Location: France
Posts: 175
Default

I think the best is to replace my failing drive as you said.
Reply With Quote
  #6   (View Single Post)  
Old 5th May 2022
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

"Not responding" is not the same as "crashing." And I will guess that your system is not responding because you are having a series of temporary, recoverable read errors. Each of these recoverable read errors follows this basic process:
  1. Drive attempts to read a sector and cannot do so successfully.
  2. Drive waits until the platters rotate the sector by the head again (8.33 milliseconds).
  3. Drive attempts to read the sector and cannot do so successfully
  4. Drive waits until the platters rotate, 8.33 milliseconds again.
  5. Drive attempts to read again.
  6. <repeat dozens or even hundreds of times>
If, eventually, the sector is read successfully, the drive sends the data to the OS, and the failure is considered "temporary and correctable." But it may have taken a very long time to successfully read one sector. Then, repeat this process for the next sector.


When sectors fail, they often do so in groups, as most physical problems that cause sector failure occur over areas that comprise multiple sectors.
Reply With Quote
  #7   (View Single Post)  
Old 5th May 2022
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

Oh, one more thing about performance: it's not only temporary read errors that cause delay. New permanent uncorrectable read errors will also cause performance issues, as each such sector will not be determined to be bad until after many, many attempts to read have failed.
Reply With Quote
  #8   (View Single Post)  
Old 5th May 2022
jggimi's Avatar
jggimi jggimi is online now
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,977
Default

I recall using a utility to test and re-write sectors to force reallocation on drives that had begun to produce bad sectors. After use, I reformatted and restored the affected partitions, and then scheduled a disk drive replacement at my convenience.

The utility is called badblocks(8) and it is included in the `e2fsprogs` package.
Reply With Quote
  #9   (View Single Post)  
Old 5th May 2022
ripe's Avatar
ripe ripe is offline
Package Pilot
 
Join Date: Feb 2013
Location: France
Posts: 175
Default

Yes it is not a crash and I guess too it is trying to read a sector, because I reboot it manually (pushing start button of PC).
Ok jggimi, thank you very much. The best is to change the drive, I will do it as soon as I get time to do it.
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Eggdrop tcl error - Error: error reading "sock7" koustab OpenBSD Packages and Ports 1 22nd August 2021 11:34 PM
Reading TV data girarde OpenBSD Packages and Ports 1 29th December 2017 06:51 PM
Preferred Reading divadgnol67 OpenBSD General 6 18th February 2012 03:12 PM
Reading paging files. Mr-Biscuit Off-Topic 5 8th June 2009 07:22 PM
Intesting reading on recent X11 changes vermaden General software and network 4 14th May 2009 03:39 AM


All times are GMT. The time now is 08:50 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick