SourceForge project page Download files Get support
mod32patch provides a Linux/Unix utility that can clear Reallocated and Current Pending Sectors on Western Digital Hard Disks
It may be used in conjunction with mod2patch
that facilitates data recovery from failing WD hard disks.
A power off/on cycle to the hard disk may be required for the new settings to take effect.
mod32patch
is an independent project, unrelated in any way to
Western Digital Corp. or Christophe Bothamy.
WARNING : THIS SOFTWARE IS EXPERIMENTAL AND NOT WELL TESTED. IT MIGHT VOID YOUR WARRANTY WITH WESTERN DIGITAL.
USE AT YOUR OWN RISK!
IF YOU ARE UNSURE, GET HELP FROM FRANC OR ANY OF THE GURUS IN HDDGURU.COM.
Based on my discussion with Franc, offsets 0x54-0x67 and 0x84 onwards should be zeroed to clear the Reallocated/Current Pending Sectors.
# mod32patch -r /dev/sda
# mod32patch -w /dev/sda
# mod32patch -u /dev/sda
mod32patch should be compatible with all recent Western Digital HDD driven by a real SATA controller.
Compatibility with SATA-to-USB adapters has not been tested.
Since mod32patch uses SMART ATA commands to manipulate the record,
it should work if SMART information can be read from your hard disk.
The Mod 32h does not appear to be a real time non-power-on setting. It is unlikely that the hard disk needs to be power-cycled to use the new default setting. If the changes do not take effect, try power OFF and then ON the hard disk.
Source code and releases can be found on the SourceForge project pages.
After downloading the tarball, for example the 1.0 release (mod32patch-1.0.tar.gz), uncompress it :
$ tar zxvf mod32patch-1.0.tar.gzChange to the source directory, and compile the code :
$ cd mod32patch-1.0 $ makeYou should get the mod32patch executable :
$ ls mod32patch mod32patch $ ./mod32patch -V mod32patch v1.0And run it with root permissions to get or set the value :
$ sudo ./mod32patch -r /dev/sdaYou can optionally install the mod32patch utility to the /sbin directory
$ sudo make installPlease note that you only need to run mod32patch once on each WD Hard Disk as the setting change is permanent.
This utility is brought to you by KHONG How Yu.
It was modified from Christophe Bothamy's idle3-tools project.
Low level ATA I/O is done using the sgio.c file of the hdparm project.
The mod32patch project is released under the GNU GPL v3.
This utility would not have been possible without Franc Zabkar (fzabkar).
Christophe Bothamy for developing the idle3-tools.