View Single Post
  #2   (View Single Post)  
Old 5th May 2022
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
Join Date: May 2008
Location: USA
Posts: 7,723

Let's start with the filesystem.
Originally Posted by ripe View Post
fsck -y
The `-y` option will produce data loss to resolve any filesystem metadata issues. Files will be deleted.
# 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:

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