MHDD program - detailed instructions for use. Low level repair. Repairing a hard drive with MHDD Mhdd how to use on a laptop

I bought a new hard drive (HDD) or there is a suspicion that your old HDD is no longer the same - I strongly recommend checking it for bads.

Bad, bads, bad sector, bad block- (from English “ bad” – bad) – bad, unreadable, unreliable, unreliable file, disk sector.

  • Mhdd official website (in Russian)
  • Download the latest iso image (version 4.6 at the time of writing) mhdd32ver4.6iso

I will give step-by-step instructions for testing HDD using an example program MHDD. The program, with proper skill and experience, gives a chance to correct some bads, out of ignorance it is better not to try to fix anything !!!. But checking the health of the disk is quite simple and painless, and I’ll write about it.

How does scanning work?

  1. MHDD sends a command VERIFY SECTORS with number LBA(sector number) and sector number as parameters
  2. The hoarder raises the flag BUSY (disk locked)
  3. MHDD start timer (the timer measures the disk lock time, i.e. when it was BUSY or in Russian - busy!)
  4. After the drive has executed the command, it lowers the flag BUSY
  5. MHDD calculates the time spent by the drive and displays the corresponding block on the screen ( tabular part on the right ). If an error occurs ( bad block), the program outputs the corresponding letter that describes the error.

MHDD repeats steps 1-5 until the end sector.

How to understand the scan results?

The presence of red >500ms) blocks on a completely healthy drive is not allowed. I sound the alarm when green blocks appear (< 150ms ). You can try to fix these blocks by erasing the entire surface of the disk (naturally, all data will be lost) and, if this does not help, you can do conclusions(the drive is no longer reliable enough).

Letter-character blocks indicate the presence of BAD blocks on the surface.

Decryption of mhdd errors:

  • UNC(Uncorrectable Data Error) - Failed to correct the data with redundant code, the block was declared unreadable. It can be either a result of a violation of the data checksum or a result of physical damage to the HDD;
  • ABRT(Aborted Command) - hdd rejected the command as a result of a malfunction, or the command is not supported by this HDD (possibly a password is set, an outdated or too new model ...).
  • IDNF(ID Not Found) – Sector not identified. Usually talks about the destruction of the microcode or the format of the lower level of the HDD. For serviceable hard drives, this error occurs when trying to access a non-existent address (the problem is that modern sector screws do not always have headers);
  • AMNF(Address Mark Not Found) - it is impossible to read the sector, usually as a result of a serious hardware problem (for example, on HDD Toshiba, Maxtor - indicates a malfunction of the magnetic heads);
  • T0NF(Track 0 Not Found) - it is impossible to recalibrate to the starting cylinder of the working area. On modern HDDs, it indicates a malfunction of the microcode or magnetic heads;
  • BBK(Bad Block Detected) - A bad block has been found. Error is deprecated;

You can learn more about these errors in the description of the ATA standard at www.t13.org (but finding the right document there is a tedious task).

Use this software "as is". MHDD is a very powerful and at the same time very dangerous program. No one can be held responsible for any harm caused by the MHDD program.

About the MHDD project

MHDD is a small but powerful freeware program that is designed to work with drives at the lowest level (as far as possible).
The first version was released in 2000 by me, Dmitry Postrigan. It was able to scan the surface of an IDE drive in CHS mode. My main goal is to develop drive diagnostic software that people can trust.

Now MHDD is much more than diagnostics. You can do anything with MHDD: diagnose drives, read/write arbitrary sectors, manage the SMART system, password system, noise management system, and change the size of the drive. And that's not all, since MHDD has a so-called ATA / SCSI terminal, which allows you to send any command to a drive with a SCSI, IDE or Serial ATA interface. Moreover, you can write scripts, thus creating your own procedures.

What is inside MHDD

mhdd.exe Executable program mhdd.hlp This file is used by the SMART command help system cfg/mhdd.cfg In this file, MHDD stores the configuration

During the first run, the program will create a file log/mhdd.log. This is the main log file. All your actions and test results will be written to this file.

How it works

Let's imagine how the MSDOS operating system works when it needs to read any sector from the drive. MSDOS will simply "ask" the BIOS to do this. Then, the BIOS looks up in its tables the port addresses of the desired drive, performs the necessary checks, and then starts communicating with the drive. After everything is finished, the BIOS returns the result to the operating system.

Let's look at the diagram. Here is how a normal DOS program works with the drive:

MSDOS BIOS program IDE/SATA controller Drive

And now let's pay attention to how MHDD works:

MHDD Controller IDE/SATA Drive

Main difference: MHDD does not use BIOS features and interrupts. Thus, you don't even need to define the drive in BIOS Setup. You can even turn on the drive after MSDOS and MHDD have booted, because MHDD works directly with the drive's registers and does not pay attention to such "little things" as, for example, partitions, file systems and BIOS restrictions.

Attention:
Never run MHDD from a drive that is on the same physical IDE channel (cable) to which (cable, channel) the drive under test is connected. You will have significant data corruption on both drives! In this regard, by default, MHDD does not work with the PRIMARY channel, since most users have MHDD there. To unlock the Primary channel, start MHDD, then exit, then edit the MHDD.CFG file. Or use the command line switch /ENABLEPRIMARY.

MHDD uses a DOS ASPI driver to access SCSI devices. If you do not plan to work with SCSI drives, then you do not need any drivers.

Hardware requirements and supported hardware

Platform:

  • Intel Pentium processor or better
  • 4 megabytes of RAM
  • DR-DOS, MSDOS version 6.22 and higher
  • Any boot device (USB, CDROM, FDD, HDD)
  • Keyboard

IDE/SATA controllers:

  • Any integrated into the northbridge (port addresses: 0x1Fx for the primary link,
    0x17x for secondary channel)
  • PCI UDMA controllers (auto-detected): HPT, Silicon Image, Promise (not all), ITE,
    ATI, maybe others. Even some RAID controllers are supported (in this case
    MHDD works with each physical drive separately)
  • UDMA/RAID controllers integrated into the motherboard as a separate chip Drives:
    • Any IDE or Serial ATA with a capacity of at least 600 megabytes. LBA Mode
      fully supported, however, I removed the CHS code from MHDD in versions 3.x
    • Any IDE or Serial-ATA with a capacity not exceeding 8388607 terabytes. LBA48 mode
      fully supported
    • Any SCSI drive with a sector size between 512 and 528 bytes

    Diagnosable IDE Drive must be switched to MASTER mode. All SLAVE devices must be switched off.

    Other devices

    • Any SCSI removable media device such as CDROM, tape. The maximum supported sector size is 4096 bytes

    Downloading the MHDD installation package

    You need to decide which package you need: a CD image, a floppy disk image, or just an archive. You can burn a CD image using any software that supports burning ISO images. Your CD will be bootable.

    First start. Important information

    Some people think that MHDD is a very complex program. They assumed that MHDD should be very simple, but when they ran it for the first time without reading the documentation, they were disappointed. MHDD is very difficult and dangerous program. MHDD is much easier to master for those who are familiar with the internal structure of drives.

    It is very important to understand that you will have to spend several hours, and possibly days, before you get meaningful results from MHDD. I strongly recommend that you try to test a few drives without defects before you start working with defective ones.

    At the first start the program will create a new file ./cfg/mhdd.cfg. The IDE Primary channel is disabled by default.

    You will see a drive selection menu. Choose any device you want. You can call up this menu at any time by pressing SHIFT+F3.

    Now you can click F1 and use any MHDD commands. Please, be extremely careful when working with MHDD the first few times.

    I would suggest starting with the EID, SCAN, STOP, CX, and TOF commands. Some of them are assigned keyboard shortcuts, for example F4 for the SCAN command.

    Take a look at registers. Any IDE or Serial ATA device should report DRIVE READY and DRIVE SEEK COMPLETE, so you should see the DRDY and DRSC flags. The BUSY flag indicates that the drive is performing some operation (such as reading or writing). Some flags such as WRITE FAULT and TRACK 0 NOT FOUND are deprecated and you should never see them. The INDEX flag is also deprecated, however, it may occasionally flash. The DATA REQUEST (DREQ) flag indicates that the drive is requesting a data transfer.

    If you notice the ERROR (ERR) flag, look at the error register. You will be able to determine the type of error that occurred. See ATA/ATAPI standard for more information about commands and registers.

    Using MHDD Commands

    Surface scanning

    Scanning of any device is possible only if it can be determined by the ID or EID commands (or by pressing F2). To scan, type SCAN and press ENTER, or use F4. You will see a menu where you can change some settings. By default, the start sector is zero (start sector). The end sector is equal to the maximum possible (the end of the disk). All functions destructive to user data (Remap, Erase Delays) are disabled by default.

    Press F4 again to start scanning. MHDD scans drives in blocks. For IDE/SATA drives, one block is equal to 255 sectors (130560 bytes).

    How scanning works

    1. MHDD sends a VERIFY SECTORS command with the LBA number (sector number) and sector number as parameters 2. The drive raises the BUSY flag 3. MHDD starts a timer 4. After the drive has executed the command, it lowers the BUSY flag 5. MHDD calculates the spent accumulator time and displays the corresponding block on the screen. If an error (bad block) is encountered, the program displays the corresponding letter that describes the error.

    MHDD repeats steps 1-5 until the end sector. If you need a scan log, you can find it in the log/mhdd.log file.

    If the scan reveals errors, the first thing to do is to copy all the data from the drive. Then you need to perform a full surface erase using the ERASE command, which erases every sector on your drive. The drive will recalculate the ECC fields for each sector. This helps to get rid of the so-called "soft-bad" blocks. If erasing does not help, run the scan with the REMAP option enabled.

    If you see that each block contains an error, do not try to erase the drive or scan with the REMAP option enabled. Most likely, the drive's service area is damaged, and this cannot be fixed with standard MHDD commands.

    Viewing SMART Attributes

    You can dial SMART ATT or click F8 to view attributes. What do they mean?

    Perhaps the most important attribute for a modern drive is the "Reallocated Sectors Count" (Raw value). This value tells you how many remapped sectors are on the disk. A normal drive has a raw value of zero. If you see a value greater than 50, the drive has a problem. This may mean a defective power supply, vibration, overheating, or simply a defective drive.

    Take a look at attribute 194 - temperature. Good values ​​lie between 20 and 40 degrees. Some drives do not report temperature.

    The UDMA CRC error rate attribute indicates the number of errors that occur when data is transmitted over the IDE/SATA cable. The normal raw value of this attribute is zero. If you see a different value, you need to urgently replace the cable. Also, overclocking greatly affects the number of errors of this type.

    Other attributes are usually not as important. See ATA/ATAPI standard for more information about SMART attributes and tests.

    Drive identification commands

    Try Commands ID And EID to view information about your drive. See ATA/ATAPI standard for more information.

    Erase groups of sectors or an entire disk

    You can use the ERASE command. If your drive is recognized in BIOS Setup (or POST), MHDD will attempt to use BIOS functions to erase the drive in UDMA mode. If you don't want MHDD to try to use the BIOS, use the /DISABLEBIOS option.

    Reducing storage capacity

    Use the HPA command to limit the size of the drive. The program will ask for a new number of available sectors. To remove the restrictions set, use the NHPA command. Cycle the drive off and on before using the NHPA command. In accordance with ATA/ATAPI standard, you can change the volume of the drive only once per drive cycle.

    Password protection management

    Use the PWD command to lock the drive with a USER password. In accordance with ATA/ATAPI standard, you need to power cycle the drive for the changes to take effect.

    MHDD has two commands for unlocking drives: UNLOCK and DISPWD. UNLOCK unlocks the drive until the first shutdown. In order to disable the password system, you must first use the UNLOCK command and then the DISPWD command (the password must be known).

    The master password is set by the manufacturer and can be used to unlock.

    Reading sectors to a file

    You can read just a few sectors or an entire disk into a file or a set of files. Try the TOF command. The program skips bad sectors. If you plan to create an image larger than 1 gigabyte, it is better to use the ATOF command, as it can automatically “cut” images.

    Writing sectors from a file to disk

    Use the FF command to write sectors to disk. You will be asked to enter the number of the first sector to be recorded and the number of sectors to be recorded in a row.

    Drive Noise Control

    Almost all modern drives support Acoustic Management.
    You can reduce the noise generated when the heads are moved by reducing the speed of their movement. Use the AAM command for customization.

    Drive Configuration

    Using the CONFIG command, you can view and change the configuration of the drive, for example, maximum UDMA mode, support for Security systems, SMART, AAM, HPA, support for LBA48 mode. It is also possible to change the disk size. Some manufacturers reduce the size of the disk by changing the configuration, you have the opportunity to restore the original volume.

    Batch run commands

    You can write a very simple batch file (see the example in the BATCH directory) where you describe whatever you want to do. Press F5 when you want to run such a file for execution.

    ATA/SCSI terminal, scripts

    Please take a look at the SCRIPTS directory. There you will find several examples with a detailed description of how it works. Use a dot followed by a filename to run the script. For example, to run the test script that comes with MHDD, type:

    MHDD>.test

    Other commands

    Click F1. You will see a summary of all MHDD commands. For more detailed information, please use the MAN command.

    Command line options

    /NOPINGPONG Disable some sounds /DISABLEBIOS Disable erasing (ERASE) via BIOS /DISABLESCSI Disable SCSI module /ENABLEPRIMARY Connect Primary IDE/SATA channel /RO This key is used to run MHDD on write-protected media. It disables attempts to create temporary files and also disables logging.

    © 2005 Dmitry Postrigan

In this article, ABC PC publishes the official documentation for the utility for testing hard drives MHDD. All rights of this MHDD documentation belong to the author of the program Dmitry Postrigan. Thanks to this MHDD documentation, you will be able to test the hard drive yourself, perform low-level formatting, erase hard drive sector groups, manage the SMART area of ​​the hard drive, and much more.

What is inside MHDD

    mhdd.exe- executable program

    mhdd.hlp- this file is used by the help system for SMART commands

    cfg/mhdd.cfg- in this file MHDD stores the configuration

During the first run, the program will create a file log/mhdd.log. This is the main log file. All your actions and test results will be written to this file.

How MHD works

Let's imagine how the MSDOS operating system works when it needs to read any sector from the drive. MSDOS will simply "ask" the BIOS to do this. Then, the BIOS looks up in its tables the port addresses of the desired drive, performs the necessary checks, and then starts communicating with the drive. After everything is finished, the BIOS returns the result to the operating system.

Let's look at the diagram. Here is how a normal DOS program works with the drive:

Program<--->MSDOS<--->BIOS<--->IDE/SATA controller<--->Storage device

And now let's pay attention to how MHDD works:

MHDD<--->IDE/SATA controller<--->Storage device

Main difference: MHDD does not use BIOS features and interrupts. Thus, you don't even need to define the drive in BIOS Setup. You can even turn on the drive after MSDOS and MHDD have booted, because MHDD works directly with the drive's registers and does not pay attention to such "little things" as, for example, partitions, file systems and BIOS restrictions.

Attention: Never run MHDD from a drive that is on the same physical IDE channel (cable) to which (cable, channel) the drive under test is connected. You will have significant data corruption on both drives! In this regard, by default, MHDD does not work with the channel PRIMARY, since most users have MHDD there. To unlock the Primary channel, start MHDD, then exit, then edit the file MHDD.CFG. Or use the command line switch /ENABLEPRIMARY.

MHDD uses a DOS ASPI driver to access SCSI devices. If you do not plan to work with SCSI drives, then you do not need any drivers.

First launch of MHDD. Important information

Some people think that MHDD is a very complex program. They assumed that MHDD should be very simple, but when they ran it for the first time without reading the documentation, they were disappointed. MHDD is a very complex and dangerous program. MHDD is much easier to master for those who are familiar with the internal structure of drives.

It is very important to understand that you will have to spend several hours, and possibly days, before you get meaningful results from MHDD. I strongly recommend that you try to test a few drives without defects before you start working with defective ones.

The first time you run the program, it will create a new file. ./cfg/mhdd.cfg. Channel IDE Primary disabled by default.

You will see a drive selection menu. Choose any device you want. You can call up this menu at any time by pressing SHIFT+F3.

Now you can click F1 and use any MHDD commands. Please be extremely careful when working with MHDD for the first few times.

I would advise you to start acquaintance with the commands EID, SCAN, STOP, CX and TOF. Some of them are assigned keyboard shortcuts, for example F4 for the team SCAN.

Take a look at the registers. Any IDE or Serial ATA device should report DRIVE READY And DRIVE SEEK COMPLETE so you should see the flags DRDY And DRSC. Flag BUSY signals that the drive is performing some operation (for example, reading or writing). Some flags like WRITE FAULT And TRACK 0 NOT FOUND are obsolete, you should never see them. Flag INDEX is also deprecated, however, it can sometimes flash. Flag DATA REQUEST (DREQ) means the drive is requesting a data transfer.

If you notice the flag ERROR (ERR), look at the error register. You will be able to determine the type of error that occurred. See ATA/ATAPI standard for more information about commands and registers.

Using MHDD Commands

Surface scanning in MHDD

Scanning of any device is possible only if it can be defined by commands ID or EID(or by pressing F2). To scan, type SCAN and press ENTER, or use F4. You will see a menu where you can change some settings. By default, the start sector is zero (start sector). The end sector is equal to the maximum possible (the end of the disk). All functions destructive to user data ( Remap, Erase Delays) are disabled by default.

Click F4 again to start the scan. MHDD scans drives in blocks. For IDE/SATA drives, one block is equal to 255 sectors (130560 bytes).

How scanning works

    MHDD sends a command VERIFY SECTORS with number LBA(sector number) and sector number as parameters

    The hoarder raises the flag BUSY

    HDD start timer

    After the drive has executed the command, it lowers the flag BUSY

    MHDD calculates the time spent by the drive and displays the corresponding block on the screen. If an error occurs ( bad block), the program outputs the corresponding letter that describes the error.

    MHDD repeats steps 1-5 until the end sector. If you need a scan protocol - you can always find it in the file log/mhdd.log.

If the scan reveals errors, the first thing to do is to copy all the data from the drive. Then you need to perform a complete erasure of the surface using the command ERASE, which erases every sector on your drive. The drive will recalculate the fields ECC for each sector. This helps to get rid of the so-called " soft bad» blocks. If erasing didn't help, start scanning with the option enabled REMAP.

If you see that each block contains an error, do not try to erase the drive or scan with the option enabled. REMAP. Most likely, the drive's service area is damaged, and this cannot be fixed with standard MHDD commands.

Viewing SMART Attributes in MHDD

You can dial SMART ATT or click F8 to view attributes. What do they mean?

Perhaps the most important attribute for a modern drive is " Reallocated Sectors Count" (meaning Raw). This value tells you how many remapped sectors are on the disk. The normal drive has raw value equal to zero. If you see a value greater than 50, the drive has a problem. This may mean a defective power supply, vibration, overheating, or simply a defective drive.

Take a look at the attribute 194 - temperature. Good values ​​lie between 20 and 40 degrees. Some drives do not report temperature.

Attribute UDMA CRC error rate means the number of errors that occur when transmitting data over IDE/SATA cable. The normal raw value of this attribute is zero. If you see a different value, you need to urgently replace the cable. Also, overclocking greatly affects the number of errors of this type.

Other attributes are usually not as important. See ATA/ATAPI standard for more information about attributes and tests SMART.

Drive identification commands in MHDD

Try Commands ID And EID to view information about your drive.

See ATA/ATAPI standard for more information.

Erase groups of sectors or an entire disk in MHDD

You can use the command ERASE. If your drive is recognized in BIOS Setup (or POST), MHDD will attempt to use the BIOS functions to erase the drive in UDMA. If you don't want MHDD to try to use the BIOS, use the /DISABLEBIOS.

Reducing the amount of storage in MHDD

Use command HPA to limit storage capacity. The program will ask for a new number of available sectors. To remove the restrictions, use the command NHPA. Perform a power cycle of the drive before using the command NHPA. In accordance with ATA/ATAPI standard, you can change the volume of the drive only once per drive cycle.

Password protection management in MHDD

Use command PWD to lock the drive with a user (USER) password. In accordance with ATA/ATAPI standard, you need to power cycle the drive for the changes to take effect.

MHDD has two commands to unlock drives: UNLOCK And DISPWD. UNLOCK unlocks the drive until the first shutdown. In order to disable the password system, you must first use the command UNLOCK, and replace the command DISPWD(password must be known).

The master password is set by the manufacturer and can be used to unlock.

Read sectors to file in MHDD

You can read just a few sectors or an entire disk into a file or a set of files. Try the command TOF. The program skips bad sectors. If you plan to create an image larger than 1 gigabyte, it is better to use the command ATOF, as it can automatically "cut" images.

Write sectors from file to disk in MHDD

Use command FF to write sectors to disk. You will be asked to enter the number of the first sector to be recorded and the number of sectors to be recorded in a row.

Drive noise management in MHDD

Almost all modern drives support acoustic management. You can reduce the noise generated when the heads are moved by reducing the speed of their movement. Use command AAM for settings.

Drive configuration in MHDD

With the help of the command CONFIG you can view and change the drive configuration, such as maximum mode UDMA, system support Security, SMART, AAM, HPA, mode support LBA48. It is also possible to change the disk size. Some manufacturers reduce the size of the disk by changing the configuration, you have the opportunity to restore the original volume.

Batch run commands in MHDD

You can write a very simple batch file (see the example in the directory BATCH) where you describe everything you want to accomplish. Click F5 when you want to run such a file for execution.

Other commands in MHDD

Click F1. You will see a summary of all MHDD commands. For more detailed information, please use the command MAN.

Command line options for MHDD

    /NOPINGPONG Disable some sounds

    /DISABLEBIOS Disable erasing (ERASE) via BIOS

    /DISABLESCSI Disable SCSI module

    /ENABLEPRIMARY Connect Primary IDE/SATA channel

    /RO This key is used to run MHDD on write-protected media. It disables attempts to create temporary files and also disables logging.

All options are closed.

MHDD is a program known for its power, designed to interact with drives at low levels. The program was created fourteen years ago by Dmitry Postrigan, and since then using MHDD has become much easier.

MHDD is capable of scanning the surface of a drive that has an IDE interface in CHS mode. The creator dreamed of personal diagnostic equipment that inspires confidence in users.

Today, the capabilities of the MHDD program are not limited to diagnostics. When using the MHDD utility, you can:

  • read;
  • Record arbitrary sectors;
  • Manage the SMART system, the password system, the system that controls the noise characteristics;
  • You can even change the format of the drive.

On the site http://www.ihdd.ru you can find a copy of MHDD. You can download the program for use in different forms: archived and in the form of a floppy disk with a self-extracting function.

Log/mhdd.log— the main log file created at the first launch of the program to be installed. It will record the actions you perform in the future.

For the MHDD program to read information from some element located on the drive, you need to send a request to the BIOS. And the BIOS starts searching for the ports of the required drive, checks the data, and exchanges them with the drive. The data is then returned to the operating system.

You cannot run MHDD from a drive that is on an IDE cable to which the tested drive will be connected. There will be data corruption on both sides. Therefore, the program does not interact with PRIMARY. If you need to unlock the PRIMARY channel, you need to start MHDD, exit, edit the MHDD.CFG file. (command term with ENABLEPRIMARY key).

The program has certain requirements for the operation of the software:

  • To the processor: Intel Pentium or the latest developments in the world of computers;
  • RAM at least 4 megabytes;
  • MSDOS must be at least version 6.22;
  • Boot device required (USB, HDD, CDROM, FDD).

Requirements for IDE/SATA controllers:

  • Must have northbridge integration; PCI UDMA have automatic detection; certain RAID controllers are supported; in the form of a microcircuit, there are UDMA / RAID controllers.
  • Drive requirements: IDE or Serial ATA, greater than 600 megabytes, but not more than 8388607 terabytes; a SCSI drive that has a sector size limited to 512 and 528 bytes.
  • Switch the drive under diagnostics to MASTER mode.
  • You can scan the device if the process is supervised by ID or EID commands (the F2 key is responsible). Type SCAN, press ENTER (F4 key). You can change the settings in the menu.
  • You can view the attributes by pressing SMART ATT (F8 key). You can find out the number of remapped sectors. A value greater than 50 should alert. You can look at the attribute showing temperature values. The UDMA CRC error rate will show how many errors there are when data is transmitted over the cable.
  • The HPA team is able to limit the cumulative volume.
  • The PWD command locks the drive by setting a password.
  • Using the AAM command, you can adjust the noise characteristics.
  • CONFIG allows you to change the configuration.

If you want to see the help for using MHDD, dedicated to all the commands of the program, press F1. If this program did not help, try the Victoria disk software analysis program.

Disk boot failure, insert system disk and press enter. An inscription that sends legions of goosebumps down your spine, each one the size of a hard drive. According to the law of meanness, this happens when nothing portends trouble. But do not rush to frantically restart the system - this is a game of Russian roulette. It is better to boot from another medium and take up a thorough check. A proven tool - MHDD - will help in this.

Introduction

If SMART shows problems, most often this means one thing: the disk is about to start to crumble, and even unnecessary OS loading can affect. The next thing to understand is the software "bads" or hardware ones on it. If there are not so many hardware ones, then you can still try to bring the disk back to life.

I think you have heard of products like MHDD and Victoria. They are indispensable for low-level hard disk work and will help you accomplish great feats of recovery and diagnostics. About Victoria, now it's time to deal with the second - archaic, but still mega-useful utility.

MHDD is a small but powerful freeware program that is designed to work with drives at the lowest level (as far as possible). The first version was released by Dmitry Postrigan in 2000. It could scan the surface of an IDE drive in CHS mode. Now MHDD is much more than diagnostics. With MHDD, you can do anything: diagnose drives, read and write arbitrary sectors, manage the SMART system, password system, noise management system, and change the size of the drive.

Despite the fact that working with MHDD is also possible through installed Windows, I highly recommend burning the image to a USB flash drive or an external (or second boot) drive and booting bare DOS from there. Believe me, in a hardware issue it is better to exclude as much as possible all the links in the chain that can lead to glitches or computer freezes during operation.

Oh those interfaces

Not every interface can be correctly recognized by the program.

SATA interface. There is a possibility that the disk will not be detected in MHDD. The reason may be the operating mode of the SATA controller (IDE and AHCI) in the BIOS. MHDD, alas, does not support AHCI mode. BIOS settings need to be changed. Worst of all, not all motherboards now support this mode. The only way out can be to use a machine with a suitable motherboard or to refuse MHDD.

IDE interface. This interface is characterized by the distribution of devices on the loop - master / slave. By default, MHDD hides all devices in slave mode. There are two ways to fix this. The first is to change the location of the hard drive (switch the jumper to master) and check that the settings in the BIOS match. The second way is to try changing the disk number to 2 or 4 in MHDD. And don't forget about the mhdd.cfg configuration file, which is in the CFG folder. In this case, the PRIMARY_ENABLED=TRUE parameter is important.

SCSI interface. The SCSI controller driver may not be detected.

USB interface. It is theoretically possible to connect a disk via USB using an additional driver and program settings. The driver emulates the mode of operation via SCSI. It is also necessary to disable all unnecessary USB drives. The target disk must be connected before MHDD can be loaded. You will need to write in config.sys: device=X:\USBASPI.SYS /w /v , where X:\ is the path to the disk.

So, I take one of the broken disks off the shelf (I usually stick a broken label on them) and now I will try to resurrect it to show you how it works in practice. I had a WDC screw WD7500BPVX-60JC3T0 on my hands with a vinaigrette instead of the system and all the files on it.

Since the situation is so sad, I can format the disk inside and out with a clear conscience, which greatly simplifies my task. But first, let's deal with a little theory and recovery plan.

getting ready

Initially, the disk must be initialized by the program, which is quite logical. After that, a surface scan is performed, which gives an understanding of the current state of affairs: MHDD will show the state of the hard surface. Then you will need to format the disk and check again. Usually at this stage, the soft-bads disappear, and only the hard ones remain. Then it will be possible to execute the REMAP procedure in order to reassign the bad blocks to the service area.

The main problem is that the service area is not rubber, and even after all the operations you need to look after the disk. If bad blocks continue to appear, then the disk, no matter how hard you try, is no longer a tenant. But in more successful cases, this method should help. As practice shows, after a remap, a disk can work for a very long time and even outlive its neighbors in the basket. At other times, he dies immediately after the reboot - here it’s just as lucky, and it’s almost impossible to predict the effect.

Don't kill

Ditching a disk is much easier than restoring it. For example, everyone knows (or should know) that disconnecting the cable during operation leads to sad consequences. We also strongly discourage you from thoughtlessly switching flags and executing commands in MHDD. Read the documentation carefully and don't start doing something if you don't fully understand what it can lead to.

Well, you can get down to business! First, create a bootable flash drive. For this I recommend - full instructions and DOS itself is. When the media is ready, all that remains is to throw MHDD into its root, so as not to once again climb directories from the command line.

In order for the disk connected to the first channel to be accurately displayed, you need to edit the mhdd.cfg config, which is located in the CFG folder.

PRIMARY_ENABLED=TRUE

As I said, scanning of any device is possible only if it is determined by the ID or EID commands (or by pressing F2).


Scanning

To scan, type SCAN and press ENTER or use F4. A menu will appear from which you can change some of the settings. By default, the start sector is zero (start sector). The end sector is equal to the maximum possible (the end of the disk). All functions destructive to user data (Remap, Erase Delays) are disabled by default.


Let's go through the scan options.

  • Start LBA- the initial sector for scanning, by default 0, that is, the beginning of the disk.
  • End LBA- sector of the end of the scan, by default the end of the disk. Sometimes it is more convenient to scan not the entire surface (especially when the disk volume exceeds several terabytes), but only the work area where the OS is located. For example, disk C is 50 GB, then the target area will be 2 * 50 * 1024 * 1024 = 104 857 600th sector. You can calculate it easier: (volume * 2) * 1,000,000, total 100,000,000.
  • Remap marks the sector as bad in a special service area, after which the disk does not access it.
  • timeout- delay time for reading a sector, after which the check proceeds to the next sector.
  • Spindown after scan- stop the hard disk after scanning.
  • Loop test/repair- to carry out scanning or checking cyclically.
  • Erase Delays- erase sectors in which read delays are detected.

Press F4 again to start the scan. MHDD scans drives in blocks. For IDE/SATA drives, one block is equal to 255 sectors (130,560 bytes).


Here's how scanning works:

  1. MHDD sends a VERIFY SECTORS command with LBA number (sector number) and sector number as parameters.
  2. The drive raises the BUSY flag.
  3. MHDD starts a timer.
  4. After the drive has executed the command, it omits the BUSY flag.
  5. MHDD calculates the time spent by the drive and displays the corresponding block on the screen. If an error (bad block) is encountered, the program outputs a letter that describes the error.

MHDD repeats steps 1-5 until the end sector. If a scan log is needed, it can always be found in the log/mhdd.log file. During the scan, you can see many rectangles of different colors. So that you are not too scared, I give an excerpt from the help:

The presence of red (>500 ms) blocks on a completely healthy drive is unacceptable. If they are, it is necessary to erase (erase) the entire surface of the disk and, if this does not help, get rid of delays, we can conclude that this drive is no longer reliable enough. Letter-character blocks like x , S , etc. are not allowed: they indicate the presence of bad blocks on the surface.

The first thing to be done is to completely clear the surface with the erase command. If this does not help, then scan with the EraseWaits option enabled. If the bad blocks have not disappeared, you should run scan with the Remap option enabled.

Restoring

If the scan reveals errors, the first thing to do is to copy all the data from the drive (if you need them, of course). In my case it was irrelevant. Then you need to completely clear the surface using the ERASE command, which erases each sector on the drive.


The drive will recalculate the ECC fields for each sector. This helps to get rid of the so-called soft-bad blocks. If erasing does not help, run a scan with the REMAP option enabled.


If you see that each block contains an error, do not try to erase the drive or scan with the REMAP option enabled. Most likely, the drive's service area is damaged, and this cannot be fixed with standard MHDD commands.

The attentive reader, looking at the pictures of the disk scan, probably whistled and shook his head in dismay. Yes, my disk, while I was writing the article, died completely. The number of hardware bads exceeded all allowable limits, and by the time the last lines of the article were stuffed, it was already crunching like a Belarus tractor. This is by the way that if the disk starts to crumble, then you cannot trust it, especially if hardware bads appear. Remap can help when the disk has not yet begun to actively crumble, but defects have appeared on the surface. In any case, even if you managed to fix it, use such a disk only for non-critical data and in no case as the main one.

What do the indicators indicate?

  • BUSY- the drive is busy and does not respond to commands;
  • WRFT- write error;
  • DREQ- the drive wants to exchange data with the outside world;
  • ERR- an error occurred as a result of some operation.

When ERR lights up, look at the top right of the screen: the type of the last error will be displayed there:

  • AMNF- Address Mark Not Found - access to a specific sector failed. Most likely means that the sector is corrupted. However, immediately after turning on the drive, just the opposite is true - it indicates the absence of problems and reports the successful completion of internal diagnostics;
  • T0NF- Track 0 Not Found - zero track not found;
  • ABRT- Abort, the command is rejected;
  • IDNF- Sector ID Not found;
  • UNCR- Uncorrectable Error, an error not corrected by the ECC code. Most likely, in this place there is a logical bad block.

Two more indicators may appear at the top: PWD signals the set hardware password, HPA appears if the drive size has been changed using the HPA command (usually used to hide bad blocks at the end of the disk).