Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: CHDMAN CHD Extraction Help  (Read 17578 times)

0 Members and 1 Guest are viewing this topic.

DudeRegular

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 279
  • Last login:October 03, 2024, 08:39:39 am
  • I have no idea what I am doing
CHDMAN CHD Extraction Help
« on: October 14, 2016, 12:02:33 am »
I have been talking to one of the guys who has been editing NFL Blitz primarily for the N64 roms. They have rosters and other mods and changes implemented well in that version. I figure it may be cool to give this a shot on my NFL Blitz 2000 Gold cabinet with some changes too.

http://nflblitzfans.com/index.php?topic=548.msg1106#new

He is looking at the hard drive as the location of the files we would want to modify with his tool. I grabbed an old IDE drive, used CHDMAN and the Blitz2k.chd to make a backup drive for my cab. Installed it, game played, and the files validated in the service menu.

Now we run into the problem of how to look at individual files on the hard drive or in the chd file. When I connect the blitz hard drive to my pc it shows up as not initialized and unallocated space (no partitions). This is somewhat expected as I saw the same behavior when I made a rush the rock drive for that cab. Windows doesn't read the data/partitions on these drives. The drive works when connected to the blitz cab.  I have tried using CHDMAN (example:  chdman extracthd -i blitz2k.chd -o blitz2k.raw) and extracting the chd to .raw and .img, but have been unable to find a program that would open/mount the output successfully (winimage, poweriso, osfmount). I read some folks were using a hex editor to modify certain raw/img extractions from CHD files and modifying the header to make it an ISO. I did not make it that far yet.

Any suggestions or ideas?

ed12

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3972
  • Last login:March 31, 2018, 03:44:39 pm
  • it is what it is..."Nobody Said It Was Easy"....
Re: CHDMAN CHD Extraction Help
« Reply #1 on: October 14, 2016, 12:14:49 am »
the step u forgot
is clearly listed in the chdman.txt usage


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')


I have ^^^ the steps
simple
with drive still hooked up to copy machine
in windows7 or ?
go to run type
diskmgmt.msc
look at all of the drives
and or windows may pop open a windows saying drive  # XXX
is not yet active (set to active y/n) y
enter
bang windows knows it

ed

Shipping something from the U.S. to Canada for repair/exchange?  Please use USPS to avoid (additional?/excessive?) shipping charges.  PM me if you have any questions.

DudeRegular

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 279
  • Last login:October 03, 2024, 08:39:39 am
  • I have no idea what I am doing
Re: CHDMAN CHD Extraction Help
« Reply #2 on: October 14, 2016, 12:23:28 am »
To clarify, I have already successfully created a backup hard drive using the process you pasted. I am now looking to access/modify individual files that exist on that drive (or in the image) but I do not see a method to do so. Unless I am misreading the info you posted. I followed those very instructions to get my backup drive in place. That way I don't botch my good working original drive.

ed12

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 3972
  • Last login:March 31, 2018, 03:44:39 pm
  • it is what it is..."Nobody Said It Was Easy"....
Re: CHDMAN CHD Extraction Help
« Reply #3 on: October 14, 2016, 12:42:43 am »
ok good.
with the new drive hooked up (2-10) what ever windows assigns it
u should be able to go look into the drive through explorer .
so right click go to root of drive and peek at the tree
at least that is how it works for me (win -7 32 or win-xp 32)
and edit away
oh ya never close out diskmgmt just min it
when u are done then close out

ed
« Last Edit: October 14, 2016, 12:44:53 am by ed12 »
Shipping something from the U.S. to Canada for repair/exchange?  Please use USPS to avoid (additional?/excessive?) shipping charges.  PM me if you have any questions.

DudeRegular

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 279
  • Last login:October 03, 2024, 08:39:39 am
  • I have no idea what I am doing
Re: CHDMAN CHD Extraction Help
« Reply #4 on: October 14, 2016, 08:05:22 am »
So with Disk Management open, it auto pops up the you must initialize box. I don't see a way to actually look at the drive through explorer as it shows as unallocated space rather than a partitioned disk.

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9269
  • Last login:Yesterday at 10:17:06 am
  • ...
Re: CHDMAN CHD Extraction Help
« Reply #5 on: October 14, 2016, 09:19:14 am »
I'm not well versed in this stuff, but from last time I messed with a CHD:

Quote
All I did was throw chdman from the latest mame build (.170) and the hydro chd into a folder along with this batch file.
Code: [Select]
chdman extracthd -i hydro.chd -o hydro.img
pause
The pause is just so I can see what the options are if it's not working.

Then I used 7zip to explore the img file.
IIRC 7zip allowed me to drag and drop files from the img file to the desktop.
I'm not sure if the reverse is possible.

« Last Edit: October 14, 2016, 09:23:36 am by BadMouth »

DudeRegular

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 279
  • Last login:October 03, 2024, 08:39:39 am
  • I have no idea what I am doing
Re: CHDMAN CHD Extraction Help
« Reply #6 on: October 14, 2016, 10:47:51 am »
I'm not well versed in this stuff, but from last time I messed with a CHD:

Quote
All I did was throw chdman from the latest mame build (.170) and the hydro chd into a folder along with this batch file.
Code: [Select]
chdman extracthd -i hydro.chd -o hydro.img
pause
The pause is just so I can see what the options are if it's not working.



Then I used 7zip to explore the img file.
IIRC 7zip allowed me to drag and drop files from the img file to the desktop.
I'm not sure if the reverse is possible.


I tried something very similar, but maybe not that exact way. I had my output as .raw, .zip, and .img. I do not think I tried 7zip with the .img file though. I will give that a shot tonight. Is Hydro thunder a pc based setup or a board and hdd style? Not sure if that would have any impact or not, just thinking about possible differences.
« Last Edit: October 14, 2016, 05:13:35 pm by DudeRegular »

BadMouth

  • Trade Count: (+6)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 9269
  • Last login:Yesterday at 10:17:06 am
  • ...
Re: CHDMAN CHD Extraction Help
« Reply #7 on: October 14, 2016, 12:01:35 pm »
Hydro Thunder is PC based.  It's above my skill level, but I was poking around comparing it to the Midway Arcade Treasures release to see if maybe we could restore analog controls to the MAT version.  (turns out that there is a separate good PC release with working analog controls anyway)
Sometimes a blind squirrel finds a nut, but not in this case.

If the original structure is outside a windows or DOS environment, that's waaaay out of my league.

You might try asking over on http://www.mameworld.info/ubbthreads/postlist.php?Cat=&Board=mamechat
MAMEDevs who work on this stuff post over there.


DudeRegular

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 279
  • Last login:October 03, 2024, 08:39:39 am
  • I have no idea what I am doing
Re: CHDMAN CHD Extraction Help
« Reply #8 on: October 14, 2016, 06:46:55 pm »
Tried your method Badmouth. No luck with the blitz2k.chd, but it does work with the hydro.chd file. There must be something different about this one. I get an error in 7zip Can not open file blitz2k.img as archive. Will keep at it.