Unable to open DMG files - "Corrupt Image"

11,674

Found this online. Here is the link: https://www.youtube.com/watch?v=TggCS8q5yGE

Here are the commands:

hdiutil attach -nomount -noverify -noautofsck -readwrite /volumes/"name of your image"

fsck_hfs -drfy /dev/diskxsx  (x is your disk number)

hdiutil detach /dev/diskxsx  (x is your disk number)
Share:
11,674

Related videos on Youtube

Mahesh Cheliya
Author by

Mahesh Cheliya

I have 5+ years of experience in the iPhone app development. I'll always do my best to develop a high-quality app.

Updated on September 18, 2022

Comments

  • Mahesh Cheliya
    Mahesh Cheliya over 1 year

    I created a DMG file using Disk utility in Recovery Mode (File -> New Image -> Image from Folder).

    Corrupt Image dmg

    I tried all the possible options from this question:

    • extracting DMG using 7Zip - not working
    • converting it to another format like ISO - not converting
    • opening DMG using Disk Drill - not opening
    • opening DMG using Data Rescue - not opening

    Is there any way to extract the data from the corrupted DMG file?

    • Gordon Davisson
      Gordon Davisson over 5 years
      Do you have any idea what might've happened to it? What all has happened to it between when you created it and now?
    • Mahesh Cheliya
      Mahesh Cheliya over 5 years
      @GordonDavisson when i created image, Macbook display "Operation Successfully", that time i not got any error or any warning message. I created saveral .dmg files like this, small files are opening without any issue, but Big size (Approx more than 2 GB) file is not opening.
    • harrymc
      harrymc over 5 years
      Does that happen if you create and open the file when you Start up in safe mode ?
    • Mahesh Cheliya
      Mahesh Cheliya over 5 years
      @harrymc yes, if i try to open file in safe mode, it is display above message
    • harrymc
      harrymc about 5 years
      Try using Disk Utility by dragging the damaged DMG file onto its window, click the file and select “Repair Disk” in the First Aid tab. You could also try the free utility Disk Drill, recommended in such cases.
    • Mahesh Cheliya
      Mahesh Cheliya about 5 years
      Hi @harrymc, I already tried it early and I also mentioned it in question. But unfortunately, I was not able to recover that file.
    • harrymc
      harrymc about 5 years
      The DMG might be too damaged.
    • Mahesh Cheliya
      Mahesh Cheliya about 5 years
      @harrymc I don't know why apple system generated corrupt dmg file because small files are open without any issue but large file gives an error message, and interestingly, I generated all files the same way.
    • harrymc
      harrymc about 5 years
      How much large? Don't you have a reason-code associated with the error? Try also temporarily to disable checksum verification by the command defaults write com.apple.frameworks.diskimages skip-verify -bool true (undo if it doesn't help).
    • Mahesh Cheliya
      Mahesh Cheliya about 5 years
      It's approx. more than 3 GB file. Let me try to use this command
    • Mahesh Cheliya
      Mahesh Cheliya about 5 years
      I tried the skip-verify command, but it doesn't work.
    • harrymc
      harrymc about 5 years
      It's then not a checksum problem. If size matters, then this relates probably to your method of creating the DMG.
  • Mahesh Cheliya
    Mahesh Cheliya over 5 years
    Thanks for your answer! I tried first command but it gives this error "hdiutil: attach failed - Operation not permitted"
  • var firstName
    var firstName over 5 years
    Use the term sudo before the command in order to elevate permissions
  • Mahesh Cheliya
    Mahesh Cheliya over 5 years
    'sudo' not working