KILogo KI2Logo


Imaging and Restoring Hard Drives using MAME's CHDMAN Utility


What You Will Need:


Capability to navigate your hard drive from within DOS or a Windows command prompt.
ST9150AG Killer Instinct hard drive or MAME CHD image file (info only).
ST9420AG Killer Instinct 2 hard drive or MAME CHD image file (info only).
Appropriate hardware adapters: IDE to 44-Pin Laptop Adapter, CompactFlash card reader, USB adapters work just fine.
CHDMAN v140 - MAME's CHDMAN Utility for Windows Operating Systems (CHD v4 Support)
CHDMAN v146 - MAME's CHDMAN Utility for Windows Operating Systems (CHD v5 Support)

Typically this page is updated only on "decade" MAME releases - ie: v140, v150, etc.
Otherwise, constantly keeping up with MAME interim releases becomes a part-time occupation. :)

Due to a re-write of CHDMAN starting with MAME v145u1, the command syntax has changed.
The new LZMA compression algorithms have brought SIGNIFICANT reductions in hard drive image sizes.

This page has been updated to reflect those changes.

Always attempt to create/restore images using the same version of CHDMAN the images were created with.
CHDMAN is always under development, so be aware some older images and versions of CHDMAN may be incompatible/outdated.
As long as your CHD files match the MAME and CHDMAN release version, you will be fine.



Who Can Benefit From This Information?


You have an arcade game with a hard drive and would like to back up the data to protect your investment.
You have a personal hard drive (operating system or otherwise) that you would like to back up using free software.

CHDMAN is a free alternative to Ghost and other commercial image-based data backup programs.

You want to restore your saved hard drive image to another hard drive or compatible device (CompactFlash card, etc.)
You want to submit an arcade hard drive image to MAME developers without having to ship your hardware away.



WARNINGS and DISCLAIMERS

Mistakes made while using the following procedures
can result in total data loss, erased/un-bootable Operating System
drives, deleted partitions, etc.

A single typographical error can lead to a catastrophic loss of data.

If you are inexperienced or uncomfortable with this disclaimer,
please purchase a Killer Instinct hard drive replacement kit or
contact me or another technically-savvy individual about backing up
and/or restoring your data for you.

Windows, by its very design, will attempt to be user friendly,
but do not EVER allow it to format or partition/modify your
original/source hard drive during this process or it will be
absolutely ruined.

Init and Convert Disk Wizard

Disk Not Formatted

Initialize Disk

Do You Want To Format?



Before You Begin: Get Organized!


1.) I highly recommend reading these instructions from start to finish before beginning. Do not "jump in."
2.) If you are creating/restoring hard drive image files, use short paths such as "c:\ki" or "e:\hdimages".
3.) If creating a hard drive image, note/record the size (in Megabytes/Gigabytes) of the original hard drive.
4.) Ensure your destination drive has the available space required to create the hard drive image file.
5.) Copy the CHDMAN executable file into your chosen destination folder (for future version control).




Using CHDMAN to Create A Hard Drive Image (Physical Disk to a File)



1.) Disconnect / Remove any hard drives or flash memory cards that may cause confusion.
2.) Connect the source hard drive to your PC. The easiest way is via USB to IDE (or SATA) adapters.
3.) Click "Start" > Run, and enter "diskmgmt.msc". This opens the Windows Disk Management Service interface.
4.) Using the size of your source hard drive, find it within the Disk Manager.
5.) Record the Disk Number that Windows has assigned the drive.

Your "C" drive will usually be Disk 1, and in this example my KI 2 drive was assigned Disk 3.


Windows Disk Management Interface

Make note of the Disk number Windows has assigned your source hard drive. Leave Disk Management open.

(If Killer Instinct 2 is a 420.8MB drive why does Windows show it as a 402MB drive? Either ignore it, or learn all about it.)

NOTE: Many hard drives (including Killer Instinct) will not be assigned a drive letter in Windows.
They will be shown as unknown, unallocated, not initialized, or RAW. This is NORMAL and only means
that Windows does not recogize the drive's filesystem.


Open a DOS/Windows command window: Click "Start" > Run, and enter "cmd".


In Vista/Windows 7:
"Start" > "All Programs" > "Accessories" > Right-Click "Command Prompt" and select 'Run as Administrator'.

Change to the directory with your CHDMAN executable file. This tutorial will use "C:\KI".


C:\KI Directory
This image shows our "KI" directory listing with the CHDMAN executable present.
Depending on the version of CHDMAN, the CHDMAN file size may differ...(v140 shown)


CHDMAN Command Listing CHDMAN Command Listing
Type only the name of the executable to see all of the commands CHDMAN is capable of.


v140: To create the KI2 hard drive image, type:
chdman -createhd \\.\PHYSICALDRIVE3 kinst2.chd

CHDMAN KI2 Drive Image Complete
This process took the contents of PHYSICALDRIVE3 and wrote it to a file named kinst2.chd.


The PHYSICALDRIVE attribute requires the disk number you recorded earlier from Windows Disk Management.
If your source disk number was 5, you would have substituted "\\.\PHYSICALDRIVE5" in the example above.

v146+: To create the KI2 hard drive image, type:
chdman createhd -o kinst2.chd -i \\.\PHYSICALDRIVE3

CHDMAN KI2 Drive Image Complete
NOTE: If you get the error about CHS values, you MUST provide them. You can usually find
this information printed on the top of the drive, otherwise, look it up on the drive manufacturer's website.
KI2 Drive - CHS Info

Congratulations!
You have successfully backed up a physical hard drive to an image file.

It would be a good idea to burn this file to a CD or DVD
so you always have a backup copy available.



Using CHDMAN to Write/Restore an Image to a Physical Hard Drive (File to Physical Disk)



As you might expect, restoring an image file (*.CHD) to a physical drive is essentially
the opposite of creating an hard drive image.

1.) Your destination drive must be at least the same size as the original source drive you imaged.
2.) You should always attempt to image the identical make/model hard drive as the source drive
before attempting to use CompactFlash or alternate sized hard drives.
3.) If the manufacturer has implemented copy protection algorithms in their boot ROMs, imaged drives
will almost always fail. They may reset randomly, crash while running, or not even boot up.
4.) If Step #2 works for you, it is likely that alternate media will work as well.
5.) Some arcade machines will require modified boot ROMs to function 100%. KI 2 is a perfect example.



This example uses a CompactFlash memory card as the destination drive.


1.) Disconnect / Remove any hard drives or flash memory cards that may cause confusion.
2.) Connect the destination hard drive to your PC. The easiest way is via USB to IDE (or SATA) adapters.
3.) Click "Start" > Run, and enter "diskmgmt.msc". This opens the Windows Disk Management Service interface.
4.) Using the size of your destination hard drive, find it within the Disk Manager.
5.) Record the Disk Number that Windows has assigned the drive.

In this example my 512MB CompactFlash card was assigned Disk 0.


Windows Disk Management Interface

Make note of the Disk number Windows has assigned your CompactFlash card. Leave Disk Management open.

(If the CompactFlash card is 512MB, why does Windows show it as a 481MB drive? Either ignore it, or learn all about it.)


Open a DOS/Windows command window: Click "Start" > Run, and enter "cmd".


In Vista/Windows 7:
"Start" > "All Programs" > "Accessories" > Right-Click "Command Prompt" and select 'Run as Administrator'.

Change to the directory with your CHDMAN executable file. This tutorial will use "c:\ki".


CHDMAN Info Output on KI2 Image File
Here is a directory listing of our KI folder with kinst2.chd image file and the CHDMAN executables.
The "-info" switch will report the CHD image file's specifications.

v140 - To restore the KI2 image file to your destination physical disk, type:
chdman -extract kinst2.chd \\.\PHYSICALDRIVE0

KI2 Image Successfully Restored

v146+ - To restore the KI2 image file to your destination physical disk, type:
chdman extracthd -i kinst2.chd -o \\.\PHYSICALDRIVE0 -f

KI2 Image Successfully Restored
This process extracted the kinst2.chd image to the destination device (PHYSICALDRIVE0).
(The "-f" switch tells CHDMAN to forcefully overwrite any existing data/partitions.)

The PHYSICALDRIVE attribute requires the disk number you recorded earlier from Windows Disk Management.
If your destination disk number was 3, you would have substituted "\\.\PHYSICALDRIVE3" in the example above.



If imaging is successful, Windows may ask if you want to
format your drive. Do NOT allow this operation on your newly imaged drive!


Error Writing Hunk
CHDMAN v145 and lower: If you receive a "error writing hunk" message, this is due to
data and/or partitions existing on the hard drive. At this point, however, you have obliterated them with CHDMAN.

From Windows Disk Management (Action -> Rescan Disks), or disconnect and re-connect your drive or CF adapter.
Re-try the same extract operation and it should complete successfully. If you clean the drive using DISKPART
prior to imaging, you will not see this message.

In CHDMAN v145u1 and newer, you will be required to add '-f' to FORCE the overwrite of the existing data/partitions.

ALWAYS RE-VERIFY THE PHYSICALDRIVE NUMBER WHEN RE-ATTACHING DRIVES!


Safely Remove Your Drive!
Always "Safely Remove" your USB device from Windows!
(Right Click the USB icon in your taskbar, select 'Safely Remove Hardware')


Congratulations!
You have successfully restored an image file to a physical device.


Questions about anything on this site? E-mail me: Admin

Valid XHTML 1.0 Strict