This page is a wiki. Please login or create an account to begin editing.


28 posts / 0 new
Last post
Carl's picture
Offline
Joined: 2009 Aug 2
Corrupted Disk Images

Is it possible to repair disk images? I have several that can't be mounted, no matter what program I use it says they're corrupted...

Comments

bertyboy's picture
Offline
Joined: 2009 Jun 14

Ouch.

Start by making a few copies of the "corrupted" image file.

Then try Disk Utility. drag the image file to the Devices pane and see if you can use any of the Disk Utility tools to fix the issue. This may only help where there was an issue while writing to the mounted disk image. It may not help if the image file has been corrupted "in transit".

Then try converting or resizing the disk image, this can be done without trying to mount it. Either in Disk Utility, or learn to use the OSX command line "hdiutil". This has saved my bacon more than once.

Then try Toast. This has saved my bacon more than a few times.

Then try DiskWarrior - allgedly it can fix minor issues with disk images. I've never used it for this.

Then try a utility like dmg2iso (shareware). Allegedly, if it finds corrupt files, it skips them and moves to the next file. Never used it.

Then pay someoe to recover what they can.

Usually if I get to Toast and it doesn't mount I stop and make / find another copy.
Toast 8 Titanium has a Recover feature for salvaging as much stuff from a scratched (physical) disc as it can, it copies what it can and reports on the files with issues. Not used it. Read about it here. Toast 7 doesn't have this.

Carl's picture
Offline
Joined: 2009 Aug 2

Thanks, but none of your ideas worked. Except paying someone, I haven't tried that but it seems like overkill. Unfortunately, since they're disk images and I don't have the original disks, that toast 8 trick probably won't work.

Interestingly, some of them can be mounted with toast 6. When I do so, they don't show up on the desktop but they do show up in the list in Disk Utility. I can't do anything with them there, though. "Repair" is grayed out and if I try to make a new disk image of them I get an error. Unfortunately, I don't have a newer version (only 6) so I can't try that.

bertyboy's picture
Offline
Joined: 2009 Jun 14

When you try the OSX hdiutil, with the verbose flag, what does it report ? It should give us an idea as to the root cause of the corruption. Remeber to turn off checksumming too.

ie. start with:

hdiutil attach hosed.dmg -readonly -noverify -verbose

where hosed.dmg is a copy of your doodgy file. You can also use -debug instead of -verbose for an even more descriptive output.

Carl's picture
Offline
Joined: 2009 Aug 2

I didn't actually try that before. I tried it now, and it's not very helpful. Here's what I got:

bertil-schickelgrubers-powerbook-g4-12:~ bertilschickelgruber$ hdiutil attach Applications/KDXClient1600-Mac/Downloads/Alias Underground/Alias Underground Install.img -readonly -noverify -verbose
hdiutil: attach: extra image argument "Underground/Alias" - "Applications/KDXClient1600-Mac/Downloads/Alias" already specified
Usage: hdiutil attach [options]
hdiutil attach -help

I'm guessing I did something wrong, but I'm not sure what. Puzzled

By the way, I entered it into the Terminal application. Was that correct?

bertyboy's picture
Offline
Joined: 2009 Jun 14

You did it correctly, but because of the spaces and other non-alphanumerics in the name of the disk image file, can you enclose the whole filename in double-quotes, ie.

hdiutil attach "Applications/KDXClient1600-Mac/Downloads/Alias Underground/Alias Underground Install.img" -readonly -noverify -verbose

I can see now that it may be an OS9 Disk Copy v6.3.3 image file. Is that right ? or is it earlier, ie. Disk Copy v4.2 ? Or is not even a Macintosh disk image ?

Can you also type:

file "Applications/KDXClient1600-Mac/Downloads/Alias Underground/Alias Underground Install.img"

OSX will make an attempt to determine the file type (from the file header). If we're lucky it'll say "Macintosh HFS data", if it's being difficult it'll say "VAX COFF executable" or just "data" - which isn't a bad thing.

Carl's picture
Offline
Joined: 2009 Aug 2

Initierar...
DIBackingStoreInstantiatorProbe: interface 0, score 1, CBSDBackingStore
DIBackingStoreInstantiatorProbe: interface 1, score -1000, CRAMBackingStore
DIBackingStoreInstantiatorProbe: interface 2, score -1000, CCarbonBackingStore
DIBackingStoreInstantiatorProbe: interface 3, score -1000, CDevBackingStore
DIBackingStoreInstantiatorProbe: interface 4, score -1000, CCURLBackingStore
DIBackingStoreInstantiatorProbe: interface 5, score -1000, CVectoredBackingStore
DIBackingStoreInstantiatorProbe: selecting CBSDBackingStore
Bifogar...
Error 2 (Det finns ingen sådan fil eller katalog).

That's not good, is it? I get the same thing with both commands. "Det finns ingen sådan fil eller katalog" means "There's no such file or catalog".

bertyboy's picture
Offline
Joined: 2009 Jun 14

Err, not good.

Usually when I have corrupt images I get a lot further. At least we know it thinks it's a BSD file system image, But that could just be a fail-safe.

Are the files important ?

Carl's picture
Offline
Joined: 2009 Aug 2

Well, it's a game... Tongue

So there's nothing else to do?

bertyboy's picture
Offline
Joined: 2009 Jun 14

Nothing that I know of.

What did you get from trying:

file "Applications/KDXClient1600-Mac/Downloads/Alias Underground/Alias Underground Install.img"

??

You could also try:

strings "Applications/KDXClient1600-Mac/Downloads/Alias Underground/Alias Underground Install.img" | head -10

in the OSX Terminal. It'll looks for strings (a sequence of 5 or more consecutive bytes of printable characters) from the start of the file. It'll print the first 10 it finds (head -10). Hopefully this will include the file header and some details about exactly what is in the file.

Carl's picture
Offline
Joined: 2009 Aug 2

It simply says cannot open...

Same thing happens with strings - can't open file ~ (No such file or directory).

bertyboy's picture
Offline
Joined: 2009 Jun 14

There must be a typo in the directories ir filename.

Can you drag the file into Terminal after typing the "file" bit and the "strings" bit ?

Carl's picture
Offline
Joined: 2009 Aug 2

Now I got something:

bertil-schickelgrubers-powerbook-g4-12:~ bertilschickelgruber$ file /Applications/KDXClient1600-Mac/Downloads/Alias\ Underground/Alias\ Underground\ Install.img
/Applications/KDXClient1600-Mac/Downloads/Alias Underground/Alias Underground Install.img: data
bertil-schickelgrubers-powerbook-g4-12:~ bertilschickelgruber$ strings /Applications/KDXClient1600-Mac/Downloads/Alias\ Underground/Alias\ Underground\ Install.img | head -10
Alias Underground Install
Alias Underground Install
M0.app
Desktop DB
BTFLDMGR
IAClasses.zip<~
scriptq
Icon
Info.plistT
bertil-schickelgrubers-powerbook-g4-12:~ bertilschickelgruber$

At least there's something in there...

Here's what I got with the other command, by drag-and-dropping the image rather than typing out the path:

bertil-schickelgrubers-powerbook-g4-12:~ bertilschickelgruber$ hdiutil attach /Applications/KDXClient1600-Mac/Downloads/Alias\ Underground/Alias\ Underground\ Install.img -readonly -noverify -verbose
Initierar...
DIBackingStoreInstantiatorProbe: interface 0, score 100, CBSDBackingStore
DIBackingStoreInstantiatorProbe: interface 1, score -1000, CRAMBackingStore
DIBackingStoreInstantiatorProbe: interface 2, score 100, CCarbonBackingStore
DIBackingStoreInstantiatorProbe: interface 3, score -1000, CDevBackingStore
DIBackingStoreInstantiatorProbe: interface 4, score -1000, CCURLBackingStore
DIBackingStoreInstantiatorProbe: interface 5, score -1000, CVectoredBackingStore
DIBackingStoreInstantiatorProbe: selecting CBSDBackingStore
DIFileEncodingInstantiatorProbe: interface 0, score -1000, CMacBinaryEncoding
DIFileEncodingInstantiatorProbe: interface 1, score -1000, CAppleSingleEncoding
DIFileEncodingInstantiatorProbe: interface 2, score -1000, CEncryptedEncoding
DIFileEncodingInstantiatorProbe: nothing to select.
DIFileEncodingInstantiatorProbe: interface 0, score -1000, CUDIFEncoding
DIFileEncodingInstantiatorProbe: nothing to select.
DIFileEncodingInstantiatorProbe: interface 0, score -1000, CSegmentedNDIFEncoding
DIFileEncodingInstantiatorProbe: interface 1, score -1000, CSegmentedUDIFEncoding
DIFileEncodingInstantiatorProbe: interface 2, score -1000, CSegmentedUDIFRawEncoding
DIFileEncodingInstantiatorProbe: nothing to select.
DIDiskImageInstantiatorProbe: interface 0, score -1000, CDARTDiskImage
DIDiskImageInstantiatorProbe: interface 1, score -1000, CDiskCopy42DiskImage
DIDiskImageInstantiatorProbe: interface 2, score 0, CNDIFDiskImage
DIDiskImageInstantiatorProbe: interface 3, score -1000, CUDIFDiskImage
CRawDiskImage: data fork length 0x0000000001404807 (20989959) not a multiple of 512.
DIDiskImageInstantiatorProbe: interface 5, score -100, CRawDiskImage
DIDiskImageInstantiatorProbe: interface 6, score -100, CShadowedDiskImage
DIDiskImageInstantiatorProbe: interface 7, score 0, CSparseDiskImage
DIDiskImageInstantiatorProbe: interface 8, score -1000, CCFPlugInDiskImage
DIDiskImageInstantiatorProbe: interface 9, score -100, CWrappedDiskImage
DIDiskImageInstantiatorProbe: nothing to select.
DIDiskImageNewWithBackingStore: probe fails to find appropriate CDiskImage class.
Bifogar...
Error 106 (känns inte igen).
Avslutar...
DIHLDiskImageAttach() returned 106
{type = immutable, count = 0, capacity = 0, pairs = (
)}
hdiutil: attach failed - känns inte igen
bertil-schickelgrubers-powerbook-g4-12:~ bertilschickelgruber$

Does any of this junk make sense to you..?

bertyboy's picture
Offline
Joined: 2009 Jun 14

Yeah, the "strings" result tells me
- that it's probably an OSX Disk Copy "Master" disk image, ie. a .cdr.
- that it may be a Disk Copy v6.3.3 uncompressed disk image (.img) - but the content says otherwise.
- that it's definitely not an OSX Disk Copy .dmg, either compressed ot uncompressed.
- and it's definitely not a Toast file.

I hadn't considered a sparse image, usually ends in .sparseimage, and I'm not sure if the zero score (all the rest are negative) is because it is a sparseimage, or because it's so much more flexible in determining that it's a sparseimage.

In the end it doesn't know what it is for sure and gives up. then it's into Swedish.

You could try again with the "-noautofsck" flag on the end. That will skip the filesystem check. I've never done that before, but it's not going to damage anything.

After that we could try converting the dodgy image file, in which it wouldn't have to try to mount it. I have no idea how far it would get. If we have any success with it, it MAY allow you to salvage some of the files.

Edit:
====
Oh yeah, and the data fork not being a multiple of the block size (512 bytes) tells me that the file may be incomplete. That shouldn't stop us salvaging some of the contents if we can mount / convert it.

Carl's picture
Offline
Joined: 2009 Aug 2

Here's what I get with the "-noautofsck" flag:

bertil-schickelgrubers-powerbook-g4-12:~ bertilschickelgruber$ hdiutil attach /Applications/KDXClient1600-Mac/Downloads/Alias\ Underground/Alias\ Underground\ Install.img -readonly -noverify -verbose -noautofsck
Initierar...
DIBackingStoreInstantiatorProbe: interface 0, score 100, CBSDBackingStore
DIBackingStoreInstantiatorProbe: interface 1, score -1000, CRAMBackingStore
DIBackingStoreInstantiatorProbe: interface 2, score 100, CCarbonBackingStore
DIBackingStoreInstantiatorProbe: interface 3, score -1000, CDevBackingStore
DIBackingStoreInstantiatorProbe: interface 4, score -1000, CCURLBackingStore
DIBackingStoreInstantiatorProbe: interface 5, score -1000, CVectoredBackingStore
DIBackingStoreInstantiatorProbe: selecting CBSDBackingStore
DIFileEncodingInstantiatorProbe: interface 0, score -1000, CMacBinaryEncoding
DIFileEncodingInstantiatorProbe: interface 1, score -1000, CAppleSingleEncoding
DIFileEncodingInstantiatorProbe: interface 2, score -1000, CEncryptedEncoding
DIFileEncodingInstantiatorProbe: nothing to select.
DIFileEncodingInstantiatorProbe: interface 0, score -1000, CUDIFEncoding
DIFileEncodingInstantiatorProbe: nothing to select.
DIFileEncodingInstantiatorProbe: interface 0, score -1000, CSegmentedNDIFEncoding
DIFileEncodingInstantiatorProbe: interface 1, score -1000, CSegmentedUDIFEncoding
DIFileEncodingInstantiatorProbe: interface 2, score -1000, CSegmentedUDIFRawEncoding
DIFileEncodingInstantiatorProbe: nothing to select.
DIDiskImageInstantiatorProbe: interface 0, score -1000, CDARTDiskImage
DIDiskImageInstantiatorProbe: interface 1, score -1000, CDiskCopy42DiskImage
DIDiskImageInstantiatorProbe: interface 2, score 0, CNDIFDiskImage
DIDiskImageInstantiatorProbe: interface 3, score -1000, CUDIFDiskImage
CRawDiskImage: data fork length 0x0000000001404807 (20989959) not a multiple of 512.
DIDiskImageInstantiatorProbe: interface 5, score -100, CRawDiskImage
DIDiskImageInstantiatorProbe: interface 6, score -100, CShadowedDiskImage
DIDiskImageInstantiatorProbe: interface 7, score 0, CSparseDiskImage
DIDiskImageInstantiatorProbe: interface 8, score -1000, CCFPlugInDiskImage
DIDiskImageInstantiatorProbe: interface 9, score -100, CWrappedDiskImage
DIDiskImageInstantiatorProbe: nothing to select.
DIDiskImageNewWithBackingStore: probe fails to find appropriate CDiskImage class.
Bifogar...
Error 106 (känns inte igen).
Avslutar...
DIHLDiskImageAttach() returned 106
{type = immutable, count = 0, capacity = 0, pairs = (
)}
hdiutil: attach failed - känns inte igen
bertil-schickelgrubers-powerbook-g4-12:~ bertilschickelgruber$

I also tried changing the end to .cdr and .sparseimage, but that didn't work.

By the way - "känns inte igen" means "can't be recognized".

Carl's picture
Offline
Joined: 2009 Aug 2

So is it possible to fix this somehow or is it damaged beyond repair?

bertyboy's picture
Offline
Joined: 2009 Jun 14

I think it's hosed, unless someone else has any ideas ?

SwedeBear's picture
Offline
Joined: 2009 Apr 18

Take into the dark side (Windows) and run ISO Buster, Nero or something like that on your .IMG
They are rather informative and I have to see anything on the Mac side to compete on that part but try the file under a Windows converter and see what it says.

Euryale's picture
Offline
Joined: 2009 Jul 22

---

Carl's picture
Offline
Joined: 2009 Aug 2

Unfortunately, I don't have windows. Maybe someone else could try? Are you sure you can use .IMG files in windows, though..?

Euryale's picture
Offline
Joined: 2009 Jul 22

I know the question is not directed to me but I'd like to answer it
Yes, .img files can be read in Windows
although there seems to be 2 kind or more of .img formats
example:
SoftMac .img disc image files cannot be read by Basilisk
but can be read by Sheepshaver and that's weird,

vMac img disc images (dsk) can be read by SoftMac and Sheepshaver
but cannot be read by Basilisk.

Sheepshaver can read all af them

vMac can read SoftMac and backwards
(which is helpful to transfer games directly after unstuffing them within softMac)

SwedeBear's picture
Offline
Joined: 2009 Apr 18

Just to confuse things a bit more: .IMG is also used for picture files ie images. :/

Could you up one of the corrupted .IMGs somewhere? I´m running those Win apps under VPC and I´ve managed to resurrect some hybrid disks from from PC game sites and I wouldn´t mind take a bash and see if it´s possible to get something useful out of it. At least another experience. Wink

Carl's picture
Offline
Joined: 2009 Aug 2

Here's a pretty small one: http://www.megaupload.com/?d=4UNX8JAC

I hope you can get it working.

SwedeBear's picture
Offline
Joined: 2009 Apr 18

Thanks! Jag tar och tittar lite närmare på den. Wink

Carl's picture
Offline
Joined: 2009 Aug 2

Schysst. Smile

SwedeBear's picture
Offline
Joined: 2009 Apr 18

@Carl: seems like it´s a no-go, unless you can make a re-download or something. ISO Buster shows the HFS structure but there´s nothing there. No app in Classic OS will touch the IMG. Disk Utility in Leopard find several errors in the file but can´t mount in order to examine further. No app will convert to a read-and-write format. Rädd att jag inte har så mycket mer att komma med. Tyvärr. Sad
Could take another turn with another image, if you want to.

Carl's picture
Offline
Joined: 2009 Aug 2

Damn. Unfortunately, a redownload is not possible. Guess I can throw these away now, though. Tack ändå.

bertyboy's picture
Offline
Joined: 2009 Jun 14

Happens to all of us. Usually before we get a chance to burn it to CD. Only happened to me once, then I learned to have a strict burning schedule, primarily to check the integrity of the files I had just downloaded.