MHDD Program

MHDD – small but powerful free program, designed to work with hard drives at the lowest level (bypassing the BIOS). It can diagnose drives, read and write random sectors, manage the SMART system, and much more.

The program distribution can be found on the developer’s website http://www.ihdd.ru. You can download MHDD as a CD image (mhdd32verx.x.iso file) or a self-extracting floppy image. On the same site is a new version documentation for the program. By default, the program works with a hard drive connected to the Secondary IDE channel as the first device (Master). She can also work with SATA drives or SCSI. The MHDD program has many functions. Here are just a few steps.

Get disk information.

Scanning the disk surface.

Saving a disk image to a file.

These operations are united by the fact that they are not associated with writing data to the disk being checked, that is, they are non-destructive. There is no point in doing anything else with the disk from which the user intends to recover information. The main task is only to assess the situation, and not to check the disk, which is the main purpose of the MHDD program.

1. Burn the program to a CD, and then boot your computer from it. The drive selection menu will appear on the screen (Fig. 2.6). Select the drive you want to examine and enter its number from the list. You can call this menu at any time by pressing Shift+F3.

Rice. 2.6. Disc selection

2. After specifying the drive (for example, 3), press Enter. The program is ready to work with this hard drive. At the top of the screen are registers, or flags. Any IDE or SATA device must display a “DRIVE READY” and “DRIVE SEEK COMPLETE” message, that is, the DRDY and DRSC flags must be highlighted. The BUSY flag signals that the drive is performing some operation, such as reading or writing.

You can get help about commands at any time by pressing the F1 key. Nevertheless, many people prefer to print out the list of commands in advance and place this sheet of paper next to the computer - it’s more convenient.

All commands are entered from the keyboard; case does not matter. Entering any command is completed by pressing the Enter key. To cancel or interrupt the execution of a command, use the Esc key.

3. To obtain disk information, enter the ID command. Another command, EID, displays more detailed information (Figure 2.7).

Rice. 2.7. Disk information

4. To scan the surface, press F4 or enter the SCAN command and press Enter. A menu will appear where you can change some settings. By default, the starting sector number is zero (start sector). The ending sector number is equal to the maximum possible (end of the disk). All functions that can change or destroy data on the disk (Remap, Erase Delays) are disabled by default. To start scanning, press F4 again.

MHDD scans drives in blocks. For IDE/SATA drives, one block is equal to 255 sectors (130,560 bytes). As you scan, a map of blocks is built on the screen (Fig. 2.8). To the right of it is a “legend”. The shorter the block access time, the better. If problems arise when accessing a block, the time increases; if an error occurs, the corresponding symbol is displayed on the map.

Rice. 2.8. Surface scanning

Everything that is listed in the legend below the question mark (exceeding the permissible access time) is different variants of unreadable blocks. The interpretation of these errors is as follows:

UNC – Uncorrectable Error, uncorrectable error;

ABRT – Abort, command rejected;

IDNF – Sector ID Not found, sector identifier not found;

AMNF – Address Mark Not Found, address tag not found;

T0NF – Track 0 Not Found, it is impossible to find the zero track;

BBK – Bad BlocK, a “bad” block without specifying a reason.

The main thing here is to understand that all these are the results of physical defects inside the HDA. It is important to decide how to save data, not how to repair the hard drive. The caution when scanning is not to get carried away with diagnostics. However, the appearance of the map may suggest some conclusions.

Regularly repeating blocks with increased access time are the result of positioning the heads on the next cylinder. This is completely normal.

Randomly scattered blocks with various types of defects are a sign of general degradation of the drive. Plates, bearings or heads are worn. Perhaps the hard drive was “beaten” or overheated.

A “spot” in the middle of which there are completely unreadable blocks surrounded by blocks with increased access time is a sign of an increasing defect on the wafer. We urgently need to extract the image.

Strictly and regularly repeating identical groups of inaccessible blocks is a sign of a faulty head. If you wish, you can even calculate this head based on the physical geometry of the disk. If the surface of the plate served by this head contains the most important data, the hard drive must be repaired under special conditions. Perhaps the plate is not completely scratched yet.

A useful feature is acoustic noise control (Acoustic Management). The noise, of course, does not bother the user. However, the noise level produced when the heads move is reduced by reducing the speed at which they move. For a faulty hard drive, this may be a measure that can facilitate its operation.

1. Type the AAM command and press Enter. Here you can see the possible parameter values ​​supported by this hard drive.

2. Enter the value corresponding to the quietest operation and press Enter. This will help the hard drive a little, especially the head block, during further manipulations.

With these steps, the diagnostics ends and data recovery begins. The MHDD program is capable of copying individual sectors or an entire disk to a file or set of files. The program skips defective unreadable sectors.

The TOF command copies a specified range of sectors (by default, from sector zero to the last sector of this disk) into a single file. The image file size cannot exceed 2 GB. If the user decides to create a disk image larger than 2 GB, then it is better to use the ATOF command, since it can automatically divide the images into separate files.

1. Type the TOF command and press Enter. The Fast Disk Image Creator prompt will appear (Fig. 2.9).

2. Enter the starting sector number and press Enter.

3. Enter the last sector number and press Enter.

Rice. 2.9. Creating an image with the TOF command

4. Enter the path and name of the image file to be created. The name is arbitrary, and the file must be created on another physical disk.

5. To start copying, press the Enter key.

Once the copying is complete, you can disconnect the problematic disk and work not on it, but on the file - its sector-by-sector copy. This will protect the disk from further damage: if the hard drive starts to malfunction, every extra minute of operation can add new bad blocks to the platters or permanently damage the damaged head. The user should begin his communication with the problem disk with copying, and postpone diagnostics.

Which program to make the copy with is an open question. There is no definitive answer to this. MHDD program and very similar to it Victoria program create fewer problems when reading hard drives with numerous physical defects. Such problems may be the program itself or the entire computer freezing when trying to read some bad sectors. On the other side, R-Studio program somewhat more convenient, especially since you still need to extract data from the image using this program. Conclusion: you can try using several programs.

From the book Fedora 8 User Guide author

4.4.2. xsane program There is no need to perform any steps to configure the scanner in Fedora 8. Just connect the scanner to your computer and run the xsane utility (menu command Applications? Graphics). The xsane program will detect the scanner itself and after that you can start scanning by clicking

From the Linux for the User book author Kostromin Viktor Alekseevich

4.7.1. The tar program A reader accustomed to archivers like arj, which collect files into a single archive and immediately “compress” them, may have the question “Why use two programs?” The thing is that tar stands for Tape ARchiver, it does not compress data, but only combines

From book Windows Vista author Vavilov Sergey

10.2. rpm Program The name of this program (or command) is an abbreviation for Redhat Package Manager. This decoding is given in most books and manuals on Linux and seems to me more correct and logical, although in Chapter 6 “The Official Red Hat Linux Reference Guide" says: "The RPM Package Manager (RPM), is an open

From the book DIY Linux server author Kolisnichenko Denis Nikolaevich

12.2.3 The gv program The gv program (or ghostview) was developed by Johannes Plass and is designed to view PostScript and PDF files (Fig. 12.2). After launching it without specifying a file name, the main program window will be empty. To open a file, you need to click on

From the book Self-instruction manual for working on a computer author Kolisnichenko Denis Nikolaevich

13.3.2 The ftp program The ftp program is a user interface to the standard Internet file transfer protocol - File Transfer Protocol. The program allows you to transfer files to a remote computer and receive files from remote computer. However, by entering the ftp command, you

From the book Programming in Prolog for artificial intelligence author Bratko Ivan

Program A program is a sequence of machine instructions (a system of commands understandable to the processor) designed to perform a specific task. As a rule, the program is designed in the form of one or more executable files, which, after installation,

From the book The C Programming Language for personal computer author Bochkov S. O.

2.6.2. RPM Program Software installation on Red Hat and Mandrake distributions is done using the rpm program. RPM (red hat package manager) is the Red Hat package manager. Even though it has "Red Hat" in the name, it is entirely intended to operate as an open source package

From the Ubuntu 10 book. Quick Guide user author Kolisnichenko D. N.

Nero Express Software The best program for burning discs Burn discs using Windows not interested. Firstly, it’s boring, and secondly, you don’t have access to any recording settings, you can’t even specify the speed, let alone select the disc format or recording method. Here

From the book The C Language - A Guide for Beginners by Prata Steven

4.5.1. Program 1 First you need to choose a way to represent a position on the board. One of the most natural ways is to think of the position as a list of eight elements, each corresponding to one of the queens. Each such element will describe that field

From the book Anonymity and Security on the Internet. From the “teapot” to the user author Kolisnichenko Denis Nikolaevich

4.5.2. Program 2 In accordance with the representation of the board adopted in program 1, each decision looked like the queens were simply placed in successive verticals. No information would be lost if the X-coordinates were omitted. That's why

From the author's book

4.5.3. Program 3 Our third program for the eight queens problem is based on the following considerations. Each queen must be placed on a certain square, i.e. on some vertical, some horizontal, and also at the intersection of some two diagonals. For that,

From the author's book

Source Program A source program is a collection of the following elements: preprocessor directives, compiler instructions, declarations, and definitions. Preprocessor directives specify the actions of the preprocessor to transform program text

From the author's book

9.3. apt-get Let's say you have package.deb. When installing it, I discovered that it requires the lib.deb package, which you do not have installed. Well, you find the missing package on the Internet, install it using the method described in section. 9.2 (that is, using

From the author's book

20.3. The bum program Previously, Ubuntu had a Services program (in the System | Administration program group), which allows you to enable/disable system services. Modern versions of Ubuntu do not have such a program. But you can install the Boot-Up Manager program, which is even better than

From the author's book

Program Below is a short program that allows you to find out the character code number even if your machine does not use ASCII code. main() /* determines the character code number */( char ch; printf(" Please enter a character. "); scanf(" %c", &ch); /* input

From the author's book

P1.1. AVZ program AVZ program (Zaitsev Antivirus) is very useful utility, and has helped me out more than once since the days of Windows XP. Then I used Kaspersky anti-virus, which could not work in safe mode. It turned out like this - everything that the main antivirus missed, in

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

What's inside the 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 launch, the program will create a file log/mhdd.log. This is the main log file. All your actions and test results will be recorded in this file.

How does MHDD work?

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

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

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

Now let's take a look at how MHDD works:

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

Main difference: MHDD does not use BIOS functions or interrupts. This way, you don't even need to define the drive in BIOS Setup. You can even turn on the drive after MSDOS and MHDD have loaded, since MHDD works directly with the drive 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 located on the same physical IDE channel (cable) to which the drive under test is connected (cable, channel). 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 unblock the Primary channel, run MHDD, then exit, then edit the file MHDD.CFG. Or use the key command line /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 difficult 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 complex and dangerous program. MHDD is much easier to master for those who are familiar with internal device 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 highly recommend trying to test several drives without defects before you start working with faulty ones.

When launched for the first time, the program will create 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 the first few times.

I would advise you to start getting acquainted with the commands EID, SCAN, STOP, CX and TOF. Some of them have keyboard shortcuts assigned to them, e.g. F4 for the team SCAN.

Take a look at the registers. Any IDE or Serial ATA device must 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 outdated, however, it may blink sometimes. Flag DATA REQUEST (DREQ) means the drive is requesting to transfer data.

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

Using MHDD Commands

Surface scanning in MHDD

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

Click 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

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

    The drive raises the flag BUSY

    HDD starts 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 displays the corresponding letter that describes the error.

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

If the scan reveals errors, the first thing to do is copy all the data from the drive. Then you need to completely erase 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 get rid of the so-called “ soft-bad» blocks. If erasing does not 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 there are on the disk. A normal drive has raw value, equal to zero. If you see a value of more than 50, the drive has problems. This could 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 replace the cable immediately. Also, overclocking greatly affects the number of errors of this type.

Other attributes are usually not so important. Look ATA/ATAPI standard for getting additional information about attributes and tests SMART.

Drive identification commands in MHDD

Try the commands ID And EID to view information about your drive.

Look ATA/ATAPI standard for more information.

Erasing sector groups or an entire disk in MHDD

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

Reducing storage capacity in MHDD

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

Managing password protection in MHDD

Use the command P.W.D. to lock the drive using a user (USER) password. In accordance with ATA/ATAPI standard, you need to turn off and on the drive for the changes to take effect.

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

The master password is set by the manufacturer and can be used for unlocking.

Reading sectors to a file in MHDD

You can read just a few sectors or an entire disk into a file or 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, since it can automatically “cut” images.

Writing sectors from a file to disk in MHDD

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

Controlling drive noise characteristics in MHDD

Almost all modern drives support Acoustic Management. You can reduce the noise level made when the heads move by reducing the speed at which they move. Use the command A.A.M. for settings.

Drive configuration in MHDD

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

Batch running commands in MHDD

You can write very simple batch file(see example in the catalog 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 quick help for all MHDD commands. For more detailed information, please use the command MAN.

Command line options for MHDD

    /NOPINGPONG Mute some sounds

    /DISABLEBIOS Disable erasure (ERASE) through BIOS

    /DISABLESCSI Disable SCSI module

    /ENABLEPRIMARY Connect the 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.

Copyright and Disclaimer

You can distribute MHDD without restrictions. You may disassemble and examine the MHDD code for educational purposes without restriction. You cannot sell MHDD.

Disclaimer of Warranties:
Use this software"as it is". MHDD is 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 free program that is designed to work with storage devices at the lowest level (as possible). The first version was released in 2000 by me, Dmitry Postrigan. It was capable of scanning the surface of a drive with an IDE interface in CHS mode. My main goal is to develop diagnostic software for drives that people can trust.

Now MHDD is much more than a diagnosis. You can do anything you want with MHDD: diagnose drives, read/write random sectors, manage the SMART system, password system, noise management system, and also change the drive size.

If you have the opportunity to financially help the project, here are the wallet numbers of the author of MHDD in the Webmoney system: Z681153514525; R131877337643.

Where to get MHDD

Whenever you need a fresh copy of MHDD, please always use the site. You can download MHDD as a CD image, as a self-extracting floppy disk image, or as an archive.

Documentation is constantly updated and is therefore only available at the current address.

What's inside the MHDD

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

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

How it works

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

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

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

Now let's take a look at how MHDD works:

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

Main difference: MHDD does not use BIOS functions or 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 loaded, since 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 located on the same physical IDE channel (cable) to which the drive under test is connected (cable, channel). 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 unblock the Primary channel, run 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:

  • CPU Intel Pentium 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 channel, 0x17x for the secondary channel)
  • PCI UDMA controllers (automatically detected): HPT, Silicon Image, Promise (not all), ITE, ATI, possibly others. Even some RAID controllers are supported (in this case, MHDD works with each physical drive separately)
  • UDMA/RAID controllers integrated into motherboard in the form of a separate microcircuit

Drives:

  • Any IDE or Serial ATA with a capacity of at least 600 megabytes. LBA mode is fully supported, however, I removed the CHS code from MHDD in versions 3.x
  • Any IDE or Serial-ATA with a capacity of no more than 8388607 terabytes. LBA48 mode is fully supported
  • Any SCSI drive with a sector size from 512 to 528 bytes

Diagnosable IDE drive must be switched to MASTER mode. All SLAVE devices must be disabled.

Other devices

  • Any SCSI removable media device, for example, CDROM, tape. 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 image, or just an archive. Visit the website to download the appropriate package.

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 believe that MHDD is a very difficult 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. It is much easier for those who are familiar with the internal structure of drives to master MHDD. If you want to gain relevant knowledge, you can start exploring this site: http://t13.org.

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 highly recommend trying to test several drives without defects before you start working with faulty ones.

When you launch the program for the first time, it will create a new file./cfg/mhdd.cfg. The IDE Primary channel is disabled by default. If you really want to “turn it on”, please do so.

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 attentive when working with MHDD the first few times.

I would recommend starting with the EID, SCAN, STOP, CX and TOF commands. Some of them have keyboard shortcuts assigned to them, e.g. F4 for the SCAN command.

Take a look at registers. Any IDE or Serial ATA device must report DRIVE READY and DRIVE SEEK COMPLETE, so you should see the DRDY and DRSC flags. The BUSY flag signals that the drive is performing some operation (for example, 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 obsolete, however, it may occasionally blink. The DATA REQUEST (DREQ) flag indicates that the drive is requesting data transfer.

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

Using MHDD Commands

Surface scanning

Scanning any device is only possible if it can be identified using 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 starting sector is zero (start sector). The final sector is equal to the maximum possible (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 the VERIFY SECTORS command with the LBA number (sector number) and sector number as parameters 2. The drive raises the BUSY flag 3. MHDD starts the timer 4. After the drive has executed the command, it lowers the BUSY flag 5. MHDD calculates the elapsed time time drive 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 final sector. If you need a scan log, you can always find it in the log/mhdd.log file.

If the scan reveals errors, the first thing to do is copy all the data from the drive. You then 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 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 every block contains an error, do not attempt 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 there are on the disk. A normal drive has a raw value of zero. If you see a value of more than 50, the drive has problems. This could 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 means the number of errors that occur when transmitting data over an IDE/SATA cable. The normal raw value of this attribute is zero. If you see a different value, you need to replace the cable immediately. Also, overclocking greatly affects the number of errors of this type.

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

Drive identification commands

Try the commands ID And EID to view information about your drive.

Reading sectors into a file

You can read just a few sectors or an entire disk into a file or 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 “slice” the 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 record and the number of sectors to be recorded in a row.

Managing the noise characteristics of the drive

Almost all modern drives support Acoustic Management. You can reduce the noise level made when the heads move by reducing the speed at which they move. Use the AAM command to configure.

Drive configuration

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

Batch running commands

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

Other commands

Click F1. You will see quick help for all MHDD commands. For more detailed information, please use the MAN command.

Command Line Options

/NOPINGPONG Mute some sounds /DISABLEBIOS Disable erasure (ERASE) through BIOS /DISABLESCSI Disable SCSI module /ENABLEPRIMARY Connect the 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.

Frequently asked questions and answers

A list of frequently asked questions and their answers can be found at this address:

Before issuing this command, the UNLOCK command must be issued.

RPM Change spindle speed(this procedure is not guaranteed to work)

FF Write disk sectors. The data to be recorded is taken from the specified file

A.A.M. Configure the noise characteristics of the drive

MAKEBAD Generation of BAD blocks. Does not work on all drives

RANDOMBAD Generation of bad blocks, scattering them randomly across the surface

INIT Reset and recalibration

FDISK Make one partition for the entire disk. Only MBR changes

SMART / Control the SMART system and view attributes

STOP / Stop spindle

I/ Send ID commands, then INIT

ERASE Selectively erase sectors or completely erase a surface (low-level formatting)

To erase directly, bypassing the BIOS, you can disable the disk in the BIOS settings, or erase with the parameter /DISABLEBIOS.This parameter does not affect the erasing speed.

FASTERASE Surface erasing at maximum speed (password system is used)

TOF Reading disk sectors to a file

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 don’t rush to frantically restart the system - this is a game of Russian roulette. It's better to boot from another medium and do a thorough check. A proven tool will help with this - MHDD.

Introduction

If SMART shows problems, most often this means one thing: the disk is about to start crumbling, and even an extra OS load can have an effect. The next thing you need to understand is whether it is software or hardware. If there are not so many hardware ones, then you can still try to bring the disk back to life.

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

MHDD is a small but powerful free program that is designed to work with drives at the lowest level (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 a diagnosis. With MHDD you can do anything: diagnose drives, read and write random sectors, manage the SMART system, password system, noise management system, and also change the size of the drive.

Despite the fact that working with MHDD is possible through installed Windows, I highly recommend burning the image to a flash drive or external (or second bootable) drive and loading bare DOS from there. Believe me, in a hardware issue it is better to eliminate as much as possible all links in the chain that can lead to glitches or freezing of the computer 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. Needs to be changed BIOS settings. The worst thing is that nowadays not all motherboards support this mode. The only way out is to use a machine with a suitable motherboard or abandon 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 in MHDD to 2 or 4. Well, don’t forget about the configuration file mhdd.cfg, which is in the CFG folder. In this case, the parameter PRIMARY_ENABLED=TRUE is important.

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

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

So, I'm taking one of the broken disks off the shelf (I usually put the broken label on them) and now I'm going to try to resurrect it to show you how it works in practice. I ended up with a WDC WD7500BPVX-60JC3T0 screw 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 look at a little theory and recovery plan.

Getting ready

Initially, the disk must be initialized by the program, which is quite logical. After this, a surface scan is performed, which gives an understanding of the current state of affairs: MHDD will show the condition 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. Next, you can perform the REMAP procedure to reassign the bad blocks to the service area.

The main problem is that the service area is not rubber, and even after all operations the disk needs to be looked after. If bad blocks continue to appear, then the disk, no matter how hard you try, is no longer alive. But in more successful cases, this method should help. As practice shows, after a remap the disk can last a very long time and even outlive its neighbors in the basket. Other times he dies immediately after the reboot - it depends on your luck, and it is almost impossible to predict the effect.

Thou shalt not kill

It is much easier to destroy a disk than to restore it. For example, everyone knows (or should know) that disconnecting the cable during operation leads to dire 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 might lead to.

Well, we can get down to business! First, let's create bootable USB flash drive. For this I recommend - complete instructions and DOS itself is there. When the media is ready, all that remains is to drop MHDD into its root, so as not to once again climb through 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 already said, scanning any device is only possible if it is identified 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 starting sector is zero (start sector). The final sector is equal to the maximum possible (end of the disk). All functions destructive to user data (Remap, Erase Delays) are disabled by default.


Let's go through the scanning parameters.

  • Start LBA- the initial sector for scanning, by default 0, that is, the beginning of the disk.
  • End LBA- sector of scanning completion, 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 final area will be 2 * 50 * 1024 * 1024 = 104,857,600th sector. You can calculate it more simply: (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 drive after scanning.
  • Loop test/repair- carry out scanning or testing cyclically.
  • Erase Delays- erase sectors in which read delays are detected.

Press F4 again to start scanning. 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 the VERIFY SECTORS command with the LBA number (sector number) and sector number as parameters.
  2. The drive raises the BUSY flag.
  3. MHDD starts the timer.
  4. After the drive has completed the command, it lowers 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 displays a letter that describes the error.

MHDD repeats steps 1–5 until the final sector. If you need a scan log, it can always be found in the log/mhdd.log file. During scanning you can see many rectangles of different colors. So that you don’t get too scared, here is an excerpt from the certificate:

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

The first thing to be done is complete cleaning surfaces with the erase command. If this does not help, then scan with the EraseWaits option enabled. If the bad blocks still do not disappear, you should run scan with the Remap option enabled.

We restore

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


The drive will recalculate the ECC fields for each sector. This helps 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 every 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.

An attentive reader, looking at the pictures of the disk scan, probably whistled and shook his head sadly. Yes, my disk completely died while I was writing the article. The number of hardware bads has exceeded all permissible limits, and last lines article, it was already crunching like a Belarus tractor. By the way, if a disk starts to crumble, you can’t trust it, especially if hardware problems appear. Remap can help when the disc 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 signal?

  • BUSY- the drive is busy and does not respond to commands;
  • WRFT- recording 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 to the right top part 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 damaged. However, immediately after turning on the drive, just the opposite - it indicates the absence of problems and reports successful completion internal diagnostics;
  • T0NF- Track 0 Not Found - zero track was not found;
  • ABRT- Abort, command rejected;
  • IDNF- Sector ID Not found;
  • UNCR- Uncorrectable Error, an error not corrected by the ECC code. Most likely, there is a logical bad block in this place.

Two more indicators may appear at the top: PWD signals that a hardware password has been set, 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).