Home / windows overview / How to run mhdd from under windows. Hard drive recovery. Drive identification commands

How to run mhdd from under windows. Hard drive recovery. Drive identification commands

Copyright and Disclaimer of Warranties

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

Warranty Disclaimer:
Use it 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 MHDD program.

About the MHDD project

MHDD is small but powerful free program, which 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 you 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, control system noise characteristics, as well as change the size of the drive.

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

Where to get MHDD

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

The documentation is constantly updated, so it is only available at the current address.

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 in its tables for port addresses. 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 doesn't pay attention to "little things" like 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 north bridge(port addresses: 0x1Fx for primary channel, 0x17x for secondary channel)
  • PCI UDMA controllers (detected automatically): 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 the motherboard as a separate chip

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 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. Visit the site 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 think that MHDD is a very complex program. They assumed that MHDD should be very simple, but when they launched it for the first time without reading the documentation, disappointment came. MHDD is very difficult and dangerous program. MHDD is much easier to master for those who are familiar with the internal structure of drives. If you want to get the relevant knowledge, you can get started with 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 strongly recommend that you try to test a few drives without defects before you start working with defective ones.

On first launch, the program will create new file./cfg/mhdd.cfg. The IDE Primary channel is disabled by default. If you really want to "turn on" it - please, .

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 always 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.

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.

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 for launch 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 answers can be found here:

Disk boot failure, insert system disk and press enter. An inscription that sends legions of goosebumps down your back, each one the size of HDD. 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 work with MHDD is 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. Need to change BIOS settings. 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. For this interface typical 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 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 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 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 up and down 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. Other times, it dies immediately after the reboot - 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. Alphabetic 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).

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 form: 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 program to analyze the disk by.

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 independently test the hard drive, perform low-level formatting, erasing hard disk sector groups, manage hard disk SMART area 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 doesn't pay attention to "little things" like 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.

Quite often, you can pay attention to the fact that users are afraid and do not know how to work with the MHDD program correctly. It is for this reason that it is worth considering a few practical recommendations on how to use this program and where its functions can come in handy.

Today, MHDD is the most popular free utility, designed for low-level diagnostics of various hard drives. It should be noted that the program was developed by a domestic specialist Dmitry Postrigan. Using this utility, users can carry out a full diagnostic of the mechanical part of the drive, view all kinds of SMART attributes, and also engage in so-called low-level formatting, fixing bad sectors. In addition, the program also contains a large number of other functions, but mostly specialists and ordinary users download it specifically for these procedures.

What is this program?

Since the utility is free, you can download it directly from the official website. MHDD is based on operating system DOS, and at the same time on the author's website you can download not only the utility itself, but also images of a bootable floppy disk or CD. In addition, there is also detailed documentation of the authorship of the developer himself, as well as answers to questions that most often arise from users of this program.

MHDD is a fairly powerful tool with which you can not only restore a failed drive, but also “finish off” it, so you need to use it wisely and always understand what exactly you can achieve by performing certain actions. The author himself says that MHDD is an extremely powerful, and therefore potentially dangerous program, and no one can be held responsible for any damage that its use will incur while working with a computer. First of all, this warning applies to any information that you store on the tested hard drive, because before you run any utilities, you must correctly understand what exactly they can do with this device and what consequences may be due to using certain commands. In particular, for this reason, it is recommended that you first completely copy all the data from your media to some other hard drive or flash drive.

How does this program work?

It should be said right away that during its operation, MHDD does not use any BIOS functions or interrupts. Thus, the drive does not even have to be detected by your BIOS Setup, and it will be possible to turn on the device after the program itself and MSDOS are activated, because the utility functions directly with the hard disk registers and in no way reacts to any trifles like file systems, partitions, and restrictions from the BIOS of your computer.

It is worth noting that certain faulty devices, when you try to determine them in the BIOS, create a system hang, as a result of which you simply cannot boot. Also, do not forget that the BIOS, which is used in large numbers motherboards old-style, cannot correctly determine the parameters of the hard drive if its volume is more than 130 GB. If this situation applies to you, then in this case, in the Standard BIOS Setup section, you will need to disable the function of determining the drive that you are going to test using this program.

If, after doing the above procedures, you still could not get rid of the freeze when determining the drive and starting your operating system, then the drive will already be connected after the program itself loads. Of course, such operations should be carried out quite carefully, and ideally, a specialized dual switch should be used in the power supply circuit of the drive, with which it will be possible to supply power through the +12 and +5 volt circuits.

The most important thing to remember is that the program should in no case be run on the drive that you are going to test. In this case, you should not even use drives connected to the same IDE cable that this device is connected to, because in the end you can cause serious damage to the data that is located on each hard drive. It is for this reason that under default settings, MHDD will not work with the PRIMARY channel, because the vast majority of users use it to allocate their hard drives. In addition, in order to ensure the safe operation of this program, it does not provide for the ability to work with those drives that are in SLAVE mode.

To unlock the PRIMARY channel, you must first run the program, then exit it and edit the created file called MHDD.CFG. Also you can use in command line key / ENABLEPRIMARY, which is a simpler solution to this issue. It will be most optimal to use a special 3.5-inch drive, flash drive, or some kind of disk to load this utility.

Preparatory settings

After you have completely completed all the preparatory activities, you can try to activate this utility. It should be said right away that it will be much easier to get used to this program for those people who are approximately familiar with the internal arrangement of modern hard drives. If you are running this utility for the first time, you should immediately understand that you will need to spend about a few hours or even days in order to start getting meaningful results from using it. It is for this reason that it is strongly recommended that you first test the drive, which definitely does not have any defects, before starting work with faulty devices.

How to scan a device?

To begin with, in the list that opens, you should select the device that you are going to scan. Once the device is selected, you can press the key F1 and start using any commands of this program you need. Once again, it is worth noting that in the process of working with the MHDD program, you should be as careful as possible, especially if you are working with the utility for the first time - once again check the correctness of the prescribed command, and also whether you really know how it should be used and what result it will give you in the end.

If you are currently still a novice user of this program, we recommend that you first familiarize yourself with commands such as scan,stop,EID, CX AND TOF. It is worth noting that some of them can be called by key combinations or simply assigned to certain hot keys. Thus, for example, using the F4 button, you can immediately start scanning the system for errors. Special attention should be paid to the registers, the status of which is constantly displayed at the top of the screen. Any SATA or IDE device must display DRIVE SEEK COMPLETE indicators during operation ( DRSC), as well as DRIVE READY ( DRDY).

Checkbox BUSY indicates that the drive is currently performing a certain operation (reading or writing any data). Some flags are like T0NF or WRFT are obsolete and therefore you should not see them while working with this utility. Also included is the flag INDX, however, in some situations, the program still displays it. When the checkbox is displayed DREQ you can determine that the disk is asking for permission to transfer some information.

If a check box appears while using this utility ERR, then in this case you should carefully analyze the error register, and at the same time you should understand what type of error can occur when working with a hard disk. See the documentation for this program to understand what commands can be used, how to work with registers, and to identify the main types of errors.

To view detailed information about your hard drive, you can use the commands ID And EID. With these commands, you can view detailed information about the operation of this drive, that is, its brand and serial number.

You can scan any hard drive only if it is determined using the above commands or after pressing the button F2. To carry out a full-fledged scanning procedure, you should press the command SCAN and press the button ENTER(default hot key F4). It is worth noting that a menu initially opens in which, if desired, it will be possible to change certain settings, since by default the initial sector is zero, while the final sector is equal to the maximum possible. Any functions that can be destructive to the information on the drive are initially disabled.

How is the scan performed?

The scanning procedure using MHDD is carried out in blocks, and if we are talking about SATA drives or IDE, then in them each block includes 255 sectors. The diagnostic procedure itself is carried out as follows:

  1. The program uses the command VERIFYSECTORS, marking it with the LBA number (number of a specific sector), as well as the number of sectors in the form of parameters.
  2. The drive raises the BUSY flag above.
  3. MHDD activates the timer.
  4. After the hard drive executes the command indicated to it, the BUSY flag will be omitted.
  5. MHDD determines the time it took the hard disk to complete the procedure, after which the corresponding block with the results is displayed on the screen. If any bad sectors have been identified, then in this case they will be marked with the corresponding letter.

It is worth noting that all steps are repeated until the utility has checked all sectors. If you want to get a detailed log of an ongoing scan, you can always easily find it in a file called log/mhdd.log. In the event that any errors were identified during this procedure, you should immediately copy all information from this drive to a new device.

After that, it will already be possible to carry out a full erasure of the surface using the command ERASE, which will completely wipe every sector of the device. In other words, low-level formatting is carried out, after which any attempts to restore information will no longer be possible, but which will allow you in some cases to return the drive to a working state.

In order to speed up this procedure, you can use the command with the option enabled EraseWaits, but it should be noted that only the block that contains one or more bad sectors will be erased. Due to this, you can completely eliminate all kinds of soft-bad blocks that are the result of damage to the surface of the device and often occur due to all sorts of power failures of your drive, its overheating, or too much vibration during operation.

If after erasing the hard drive did not start working normally, then in this case you should run a rescan, but with the REMAP function enabled. Thus, hard drives that were often read without failures in some areas are already beginning to detect a large number of all kinds of bad sectors and errors. This indicates that the surface was damaged, and this damage can no longer be repaired. Often, such hard drives turn out to be unsuitable for further use, and it is at least unsafe to store data on them.

How to analyze the results?

If red blocks were found during the diagnostic process, you should understand that such a situation is unacceptable for a completely healthy device. In the presence of such sectors, you should immediately carry out a full erasure of the entire surface of the disk, and if this did not help to cope with the problem, it remains only to conclude that the use of this device has become insufficiently reliable. All sorts of alphanumeric blocks, such as S or x are also invalid, as they indicate the presence of downed sectors.

If a letter appears during the scan W, then this indicates that the procedure is carried out with the EraseWaits mode enabled, and in this section a complete erasure of one block was carried out due to an error in reading some sector. Moreover, if this letter appears again and again in a certain area, this indicates the presence of a bad sector.

The appearance of blue blocks indicates that the function is enabled. REMAP, which was used in relation specifically to this section. The drive replaced the bad sector with a good one, previously placed in the spare area, as a result of which the problem will no longer appear here.

MHDD and working with passwords

The ATA / ATAPI standard provides for the possibility of using passwords on the drive, but in order to get a really correct password, the device will completely ignore any user attempts to read data or write to the hard drive. To lock the drive with a custom password, you should use the command PWD. In accordance with this standard, you will first need to reboot the operation of this hard drive in order for the changes you have made to take effect.

MHDD provides for the use of two commands that allow you to completely unlock your hard drive - these are DISPWD and UNLOCK. The latter is intended to unlock the ability to work with the drive exactly until it is turned off once. To completely deactivate the use of the password system, you should first activate this particular command, and then use DISPWD, but it’s worth saying right away that you must know the password for its further use for your own purposes. In addition, do not forget that hard drive manufacturers also use the so-called master passwords, with which you can also unlock your device.

Commands for Reading Sectors

You can read an entire disk or several specific sectors in specific file or the created set of files. First of all, you should use the TOF command, which deals with the complete skipping of bad sectors. If you are going to create images that will be more than 1 GB, then in this case you will already need to use the ATOF command, which allows you to automatically cut reviews.

If you want to write sectors from a file to disk, just use the FF command. You will be prompted to enter the number of the first sector to be written to, as well as the total number of sectors to be recorded in a row. These two commands are often required in order to carry out a full recovery of data from failed drives. Initially, a sector-by-sector image of a faulty device is created, after which it is transferred sector-by-sector to another, serviceable hard drive in the same way. Only then it will be possible to use specialized programs that allow you to recover various data.