9 Replies Latest reply: Jan 11, 2011 11:51 AM by Dean
Dean Level 1 Level 1 (5 points)
I'm trying to use terminal to convert an ISO file to an IMG file. The conversion appears to run but I cannot find the output file.
The command I'm using is;

hdiutil convert -format UDRW -o /convert/newfile/output.img /convert/source.iso

I assume the output.img file should be in the /convert/newfile/ directory.

Mac OS X (10.6.6)
  • Dean Level 1 Level 1 (5 points)
    I tried it from root to see if that made a difference.

    hdiutil convert -format UDRW -o /monday/monkey.img /test101.iso

    I can see a monkey.img.dmg being created in the monday directory. Once the command finishes the file disappears.

    I'm I using the command incorrectly. Why is the output file disappearing?
  • MrHoffman Level 6 Level 6 (13,295 points)
    If you're within the realm of what Spotlight indexes, then:

    $ mdfind -name source
    $ mdfind "kMDItemFSName == 'source'c"

    The first is a name search, the second is (also) a name search, and that trailing C is the case-blind switch.

    And when in doubt, get out the Big (slow) Hammer and go look for it everywhere:

    $ sudo find / -iname source -print


    And FWIW, I'd tend to use the construction shown in the man page:

    $ hdiutil convert source.type -format UDRW -o destination.type


    And have a look at the -verbose or -debug switches on the hdiutil command, to get more details.
  • Dean Level 1 Level 1 (5 points)
    Thanks for the start.

    I did a search for the name of the destination file. Did not find it. I changed the name of the destination.img file to something unique so i would not get a long list of files.

    I tried the quick search and the more complete one.

    Next i tried verbose, and debug

    Amongst all the lines of data, interestingly verbose came back with


    CNDIFDiskImage::convertProbe: format is WRDU
    CNDIFDiskImage::convertProbe: format not recognized.

    at the end was the following two lines


    DIDiskImageConvertWithDiskImage: converter returned 22
    hdiutil: convert: result: 22
  • MrHoffman Level 6 Level 6 (13,295 points)
    Whatever you're trying to convert doesn't have a recognized format.

    There are about a gazillion different things lumped together and called an "ISO", so that's not a huge surprise.

    It's not obvious what format that WRDU might be after some concerted searching, and given how spam-filled and increasingly useless Google is getting. What do you think that disk image is?
  • Dean Level 1 Level 1 (5 points)
    i tried runing a convert on a dmg file.

    hdiutil convert /testfile.dmg -format UDRW -o /dest/newfile.img

    and it works. Not sure exactly what that says. But it appears to imply the iso files I'm trying to convert to img files will not convert.
  • Linc Davis Level 10 Level 10 (173,635 points)
    The arguments are in the wrong order. Also, you probably should be using relative paths; e.g.,
    hdiutil convert source.iso -format UDRW -o output
  • Dean Level 1 Level 1 (5 points)
    It's a small install of linux for a PPC. About 100megs insize. Was trying to see if i could create an install on a FW or USB drive
  • MrHoffman Level 6 Level 6 (13,295 points)
    It's a small install of linux for a PPC. About 100megs insize. Was trying to see if i could create an install on a FW or USB drive


    FWIW, I've used [dd and diskutil|http://labs.hoffmanlabs.com/node/1213] for something similar; for getting Linux and BSD and firewall disk images over onto CF cards and other removable media, for use with embedded devices.

    (This was intended to be a reply to the OP.)
  • Dean Level 1 Level 1 (5 points)
    Thank you for your help so far. I'm enjoying digging into this. Also I visited the link you provided and congrats on the site. It looks well put together, and easy to navigate.