SourceForge project page Download files Get support
mod2patch provides a Linux/Unix utility that
can patch MOD02 Record 27 Offset 2 on Western Digital Hard Disks
It may be used in conjunction with mod32patch
that clears the Reallocated Sector Count and Current Pending Sector.
A power off/on cycle to the hard disk is required for the new settings to take effect.
mod2patch
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, it appears that MOD02 Record 27 Offset 2 needs to be patched to 0 to speed up data recovery from a Western Digital Hard Disk that is failing.
# mod2patch -g /dev/sda
# mod2patch -s 0 /dev/sda
mod2patch 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 mod2patch uses SMART ATA commands to manipulate the record,
it should work if SMART information can be read from your hard disk.
The Mod 02h appears to be a power-on only setting. That means that the hard disk needs to be powered OFF and then ON to use the new default setting.
Source code and releases can be found on the SourceForge project pages.
After downloading the tarball, for example the 1.0 release (mod2patch-1.0.tar.gz), uncompress it :
$ tar zxvf mod2patch-1.0.tar.gzChange to the source directory, and compile the code :
$ cd mod2patch-1.0 $ makeYou should get the mod2patch executable :
$ ls mod2patch mod2patch $ ./mod2patch -V mod2patch v1.0And run it with root permissions to get or set the value :
$ sudo ./mod2patch -g /dev/sdaYou can optionally install the mod2patch utility to the /sbin directory
$ sudo make installPlease note that you only need to run mod2patch 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 mod2patch 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.