Mon, 14 Aug 2006

Create ISO CD/DVD image (.iso) with Mac OS X Tiger (10.4)

Posted by Ben Mon, 14 Aug 2006 19:46:00 GMT

1. Insert CD/DVD source

2. Fire up a Terminal, you can then determine the device that is you CD/DVD drive using the following command:

$ drutil status
 Vendor   Product           Rev 
 MATSHITA DVD-R   UJ-835E   GAND

           Type: DVD-ROM              Name: /dev/disk1
      Cur Write:    8x DVD          Sessions: 1
      Max Write:    8x DVD            Tracks: 1
   Overwritable:   00:00:00         blocks:        0 /   0.00MB /   0.00MiB
     Space Free:   00:00:00         blocks:        0 /   0.00MB /   0.00MiB
     Space Used:  364:08:27         blocks:  1638627 /   3.36GB /   3.13GiB
    Writability: 
      Book Type: DVD-ROM

3. Umount the disk with the following command:

$ diskutil unmountDisk /dev/disk1
Disk /dev/disk1 unmounted

4. Create the ISO file with the dd utility (may take some time):

$ dd if=/dev/disk1 of=file.iso bs=2048

5. Test the ISO image by mounting the new file (or open with Finder):

$ hdid file.iso

6. The ISO image can then be burnt to a blank CD/DVD.

Trackbacks

Use the following link to trackback from your own site:
http://www.slashdotdash.net/articles/trackback/94

Comments

Leave a response

  1. Pete <primeone@aci.on.ca> 5 months later:

    I tried your script in Terminal but when I got to creating the iso file I was deied permission on my own computer. Do you know why that may have happened?

  2. Nathan 6 months later:

    Pete, you need to create the ISO file in a directory in which you have write access. Under OS X this is by default your home directory and everything inside it. This is basic Unix stuff, and I’d recommend you spend a few minutes with a Unix command line primer before you use a command like dd which has the potential to write garbage all over your hard drive. That said, here’s what you need to know for this application.

    Either switch to a writable directory before invoking dd, using the cd command, or specify a writable directory within the arguments to dd.

    You may use the cd command alone to switch to your Home directory, or you may specify a directory such as your Desktop folder:

    cd ~/Desktop 

    If you would rather specify the path to a writable directory when you invoke dd, it’s just a matter of placing the path before the output filename, like in this example:

    $ dd if=/dev/disk1 of=~/Desktop/file.iso bs=2048

    which would place the ISO file on the desktop. Hope this helps.

  3. painless 6 months later:

    such a simple way to solve a trivial problem. works great.

  4. Frank 6 months later:

    Can the iso then be opened with, say, Daemon Tools of Win32? Or, more importantly, in Ubuntu?

  5. Ben 6 months later:

    Can the iso then be opened with, say, Daemon Tools of Win32? Or, more importantly, in Ubuntu?

    It should create a standard ISO file that can be mounted via either of those, I think the commnd below should do the trick under Linux:

    mount file.iso -t iso9660 -o ro,loop /mnt/<mount point>
    
  6. Chill 6 months later:

    Hi followed your instructions and have successfully created the iso file but im unable to mount it, have tried it on two different audio cds now with no luck. below is the verbose output from hdid

    power-mac-g5:~ Chill$ hdid ~/Desktop/bunasocail.iso -verbose 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 0, CDARTDiskImage DIDiskImageInstantiatorProbe: interface 1, score 0, CDiskCopy42DiskImage DIDiskImageInstantiatorProbe: interface 2, score 0, CNDIFDiskImage DIDiskImageInstantiatorProbe: interface 3, score -1000, CUDIFDiskImage CRawDiskImage: data fork length 0×000000000E40DF80 (239132544) 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. DIHLDiskImageAttach() returned 106 {type = immutable, count = 0, capacity = 0, pairs = ( )} hdid: attach failed – not recognized
  7. Ben 6 months later:

    @Chill

    This is because mount only works on filesystems and Audio CDs do not have filesystems; they just have data.

  8. Sean 6 months later:

    I’ve got 22 “iso images” generated using this technque, not from audio discs, all were mounted as filesystems, none of which appear mountable.

    My shell history shows:

    35  12:10   drutil status
    36 12:10 diskutil unmountDisk /dev/disk2
    37 12:11 dd if=/dev/disk2 of=disc07of19.iso bs=2048
    38 12:20 diskutil eject /dev/disk2

    but hdid says:

    hdid disc07of19.iso -verbose
    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 0, CDARTDiskImage
    DIDiskImageInstantiatorProbe: interface 1, score 0, CDiskCopy42DiskImage
    DIDiskImageInstantiatorProbe: interface 2, score 0, CNDIFDiskImage
    DIDiskImageInstantiatorProbe: interface 3, score -1000, CUDIFDiskImage
    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: selecting CRawDiskImage
    DIDiskImageNewWithBackingStore: CRawDiskImage
    DIDiskImageNewWithBackingStore: instantiator returned 0
    DI_kextWaitQuiet: about to call IOServiceWaitQuiet…
    DI_kextWaitQuiet: IOServiceWaitQuiet took 0.000006 seconds
    DIHLDiskImageAttach() returned 108
    {type = immutable, count = 0, capacity = 0, pairs = (
    )}
    hdid: attach failed – no mountable file systems

    A bit of a shame. Anyone got any ideas how I might recover data from those images?
  9. Sean 6 months later:

    OK, more on the problem. When these CDs are inserted the device mounted is /dev/disk2s0 so using dd to capture the disk2s0 image rather than the disk2 image leaves me with a mountable .iso image.

    Now I need to find out the difference between the disk2 and disk2s0 so I can retrieve the data from images previously captured.

    Anyone have any advice for me?

  10. Chibo 7 months later:

    try to use /dev/disk2s0 or /dev/disk2/s1 instead in dd ls /dev/disk2* and you will see the sessions, for example dd if=/dev/disk2s0 of=filename.iso bs=2048

  11. Alja 7 months later:

    Thanks, no problems helped me a lot.

  12. Joe 8 months later:

    I tried this but the iso was unreadable. It was an iso of WinXP to use in Parallels.

  13. Carlos Po 8 months later:

    Very well

  14. pellucidity 8 months later:

    I concur, for CDs you want to take the slice (/dev/disk3s0 for me) rather than the whole raw image. For DVDs I found that the whole disc did the trick.

  15. kfox@gfsnet.org 9 months later:

    Hi i got it to work but how do i controll whats in the .iso image?

  16. eex 9 months later:

    Why use the terminal when you have this tool:

    http://www.utilsforge.com/fastiso/

  17. Mr2007 9 months later:

    Because they want $24.99 for that tool, and the terminal includes dd and many other apps of free.

  18. Justin 9 months later:

    Hi mate, I’m new to Mac (though not new to unix), your solution is very smart and makes good use of whats already on board, thank you!

    I can tell I am going to enjoy seamlessly switching between MacOS & UNIX!

    Justin

  19. शंतनु (Shantanoo) 9 months later:

    My favorite:
    - install darwinports
    - install cdrtools from ports with sudo port install cdrtools
    - use mkisofs to create iso image. e.g. mkisofs -o isofile -J -r -R directory
       Creates isofile containing the data inside directory
    For more information checkout man pages of respective commands.

  20. Kenny 10 months later:

    Hi, i tried your thing and i can seem to locate the iso file. is this not a permanent iso creation like stored in the cashe or is there a specific place im not looking. also in when i check the file after i am done creating it says ~$ hdid file.iso hdid: attach failed – not recognized

    whats up with that? little help please thanks

  21. Jack 10 months later:

    I am also having trouble with this method.

    I’m just trying to make an image of my Brood War cd so I dont need the disk with me.

    After I run the commands and try to mount the image it just gives me an error and will not mount. Any idea what im doing wrong, and is there some free software to do this?

    webboy9579@gmail.com www.myspace.com/mrousley

  22. Dave 10 months later:

    I couldn’t get the tip to work on my system, maybe it was the CD?

    The following worked for me:

    • Put CD in drive, Open Application/Disk Utility
    • Select the cd from the list on the left
    • click on file -> disk image from disk2c0 (nameofcd)

    This creates a .dmg, now we have to convert it to an .iso:

    • run “hdiutil convert disk2s0.dmg -format UDTO -o file”
    • rename .cdr file to .iso
    • mount to test image

    all done.

  23. Rees Clissold 10 months later:

    - Dave:

    In Disk Utility, you can create .cdr files anyway, without the need to convert from dmg. You just need to select “CD/DVD Master” as the type.

    - Everyone else:

    This is a great tip on using DD – it’s certainly one of the more useful Unix utilities. Potential users should be warned, however, that it’s very easy to mess up your hard disk with this utility and it’s not to be played with if you don’t do your homework first!

  24. An 11 months later:

    Guys

    I have did the script from Terminal of Ben, it worked for DVD but not CD. Dave’s solution works with CD.

    Thank you all. Cheers

  25. Darkman 11 months later:

    You saved me EEX with fastISO. This solution for some reason did not work with my parallels and I needed to load XP pro but my disk was producing an error. Used the program and worked like a charm. Now I can install my accounting software upgrade which does not work with VISTA.

  26. win-idiot..... 12 months later:

    win idiot as me knows dd to do the raw copy.. hiahia

  27. Julia 12 months later:

    $ dd if=/dev/disk1 of=file.iso bs=2048

    has to be replaced by

    $ dd if=/dev/disk1s0 of=file.iso bs=2048

    when using certain disks.

    Find out when by using the command

    df -h

  28. benjk about 1 year later:

    It doesn’t work.

    wasted some 2+ hours and 30+ CDs trying out every method I could find on various websites, including the ones described on this page.

    It is appalling that Apple doesn’t support ISO writing and if I was an average IT manager in a company considering the purchase of Macs, I would quite probably block any decision in favour of Macs on this ground alone.

    ISO is a widely adopted international standard, Apple should absolutely have no second thoughts whatsoever to support the creation of ISO images under MacOS X.

    This is one of those things that gives us Mac users a bad name, especially when we try to explain how easy things are on a Mac and then how few people would need to do a thing that it can’t do easily or can’t do at all.

    Somebody smack the product manager at Apple who is responsible for making Disk Utility a piece of crippleware, thanks.

  29. ergophobe about 1 year later:

    benjk,

    If you were an average IT manager, you would would have used 1 CD-RW instead of wasting 30+ CD-R’s experimenting.

    Of course, you also would have been able to get it working because dd is a widely adopted international standard *nix tool for creating images of disks.

    I will agree that Apple should be spanked for not providing proper CD burning/imaging tools.

  30. invariablyAFK about 1 year later:

    Disk Utility can make standard ISOs by simply selecting “DVD/CD Master” .. Apple stupidly adds the extension .cdr but you can rename the file to end in .iso and it will work as a standard ISO. Disk Util is not crippled, its just trying to be too user friendly.

    This method is still useful if you need to image in the command line or via a quick apple script / automator workflow.

  31. 1337 about 1 year later:

    Disk Util works for me…

  32. macca about 1 year later:

    You dumb alleged AIT manager!!!

    Microsh1t does not include ANY free tool for creating ISO, you have to buy a 3rd party tool. The same is true for Apple.. go spend some money on Toast or another prog for the Mac or stick with MS which i’m sure you understand equally well!

  33. chris about 1 year later:

    when I try to make the image in disk utility, I get a message that says input/output error

  34. vdub2.slow@yahoo.com about 1 year later:

    i have the iso.. how do i mount it so i dont have to use the dvd when i want to play age of empires 3. everytime i try it says please insert the dvd into the dvd drive or something like that.. please email me or something

  35. wildpalms about 1 year later:

    vdub2.slow@yahoo.com

    Just use Disk Utility to create a .dmg image of your AOE3 disk and double click that to mount.

  36. Voodoo Bob about 1 year later:

    You wasted 30+ CD-Rs trying to burn an ISO? Yeah right, retard.

    What’s so hard about dragging an ISO file into Disk Utility and clicking Burn?

    Corporate IT manager my ass. Maybe the “manager” part is right, though. Are you one of those people that refer to Apple, the company, as “Mac,” as if they were one and the same?

    Hey, maybe you can get a helmet or something for your problem…

  37. Voodoo Bob about 1 year later:

    Oh, sorry, I misread your crappy post. You wanted to CREATE an ISO! Yeah, because we all have to burn a CD-R each time we create an ISO! Right, guys?

    1. Select the disc in Disk Utility. 2. Create image > save as CD/DVD Master. 3. Change the filename extension (this one’s gonna be hard for you) to .ISO 4. No, that’s not 1S0, or 150…. it’s I-S-O. Think “I’m So Obvious” as the acronym. 5. Change the extension by clicking on the filename, waiting about 1 second, then selecting the end of the file. 6. Then, where it says ”.cdr,” change that to ”.iso.” (No period at the end.) 7. (Or quotes.) 8. Then, this is the hard part, click somewhere else outside the filename to commit changes. 9. Sit back in your leatherette chair, and congratulate your manager ass. 10. Whine in online forums about how “Mac” [sic] “is good for graphic design and stuff but that’s about it” and recap the story of how you wasted 3 days and killed two LaCie D2 drives trying to rename a folder. 11. Buy a helmet.

  38. MacBoy about 1 year later:

    This page was most helpful. :D

    Now I just need to know how to mount the ISO as a virtual CD. (usage for PCSX. I don’t like having to carry my PSX CDs with me. XD)

  39. Yenn about 1 year later:

    That’s the right and simple method :)

    Rees Clissold wrote:

    In Disk Utility, you can create .cdr files anyway, without the need to convert from dmg. You just need to select “CD/DVD Master” as the type.

    Sweet, thanks :)

    —-—-—-—-—-—-—-—-—-—-—-—-—-—-—-

    www.myspace.com/djyenn www.djyenn.com

  40. Noob about 1 year later:

    I was trying to back up my movie DVDs, but once I mount the image it says it can’t open it due to copy protection. Any way around it?

    It’s still hard to swallow how difficult the industry makes it for us to protect our own investment. It’s not like it was hard to copy stuff on the days of cassette and VHS tapes…

    Anyway, thanks in advance. The process itself worked flawlessly to me.

  41. Andrew http://www.uoregon.edu/~acook1/ about 1 year later:

    Help! I created and iso, but now I’m unable to eject the original dvd. drutil status seems to show what I originally saw. The dvd does not show up in the finder. The manual eject button also doesn’t work. I’d reboot, but I haven’t done so in over 2 months and I have 40 windows open. Do I have to remount the disk to eject the original DVD? Also, hdid gave the following error: hdid file.iso load_hdi: IOHDIXControllerArrivalCallback: timed out waiting for IOKit to finish matching. hdid: attach failed – not recognized

  42. Re:you Dumb about 1 year later:

    Re: macca about 1 year later: You dumb alleged AIT manager!!!

    Microsh1t does not include ANY free tool for creating ISO, you have to buy a 3rd party tool. The same is true for Apple.. go spend some money on Toast or another prog for the Mac or stick with MS which i’m sure you understand equally well!

    There are FREE ISO burners for Apple and Windows! http://www.download.com/ImageBurner/3000-2198_4-10741056.html?tag=lst-4

    http://www.download.com/Active-ISO-Burner/3000-2646_4-10612384.html?tag=lst-1

  43. Pfhortipfhy about 1 year later:

    @Ben: Is there a way to put a filesystem in an audio CD?

  44. Ben about 1 year later:

    @Pfhortipfhy: Sorry, can’t say I know how you’d do this.

  45. Tom about 1 year later:

    All right, I’ve gone through Disk Utility, created a disk image, tried changing the extension to .dmg, .iso, and .cdr, but when I try to play the game, it tells me to insert the disk. When I double click the file I’ve made, the folder of the cd appears on the desktop with the install files and all that good stuff, but somehow I’ve missed the step where everything connects. Please help, I’m not sure what I’m doing.

  46. doodoo about 1 year later:

    how do i delete the iso from my hard drive… takes up space.

  47. JetfighterNL about 1 year later:

    Thanks m8! Works perfect. I did not expect that from the terminal!

  48. JetfighterNL about 1 year later:

    @ doodoo

    Are you serieus?

  49. rretzbach about 1 year later:

    Using /dev/disk#s# as input file instead of just /dev/disk# worked. Otherwise I got the following error message: Macintosh% hdid cm2.iso hdid: attach failed – Keine aktivierbaren Dateisysteme (German for “no file systems to activate”)

    Thank you.

  50. Gamer about 1 year later:

    Using a Mac just got a whole lot less frustrating, thank you.

  51. nmiddleweek about 1 year later:

    Hello chaps,

    I’ve got a folder on my desktop call testcd.

    I want to create an ISO 9660 CD image of the folder contents into a .iso file.

    Is this possible using the DD command?

    From the examples above, you guys are creating a cd image of an unmounted disk in the drive. I’d like to create a CD image of the contents of a folder on my desktop that contents PDF’s…

    We’ve been doing this using OS9, AppleScript and Toast 5 but it sometimes fails. I’m upgrading the Mac to OSX and would like to use native utilities where possible..

    One of the key points is that the PDF files burnt to the CD image must retain the mac resource fork… At least I think I need that… I want the files to retain their preview icons when the CD is insert into a Mac.

    This is part of an automated process and once the .iso CD image has been created it is going to be burnt to CD on a Windows machine using CD Robotics hardware.

    If you need more info please ask…

    Thanks for anyone’s help!

    Nick

  52. nmiddleweek about 1 year later:

    After speaking to the guys at DropDMG http://c-command.com/dropdmg/ it has come to light that the .iso, .cdr or .img CD image must support the ISO filesystem in order for it to work on a Windows machine.

    It is possible to rename a .cdr to .iso take that .iso to Windows and burn a CD using the .iso image with Nero Burning software, BUT… because the mac created .iso doesn’t support the ISO filesystem the CD will never be able to be read on the Windows platform and only works on the Mac…

    So, apart from Toast, does anyone know of any utility that will allow me to create and ISO 9660 .iso CD image that support the ISO filesystem (in fact, I’ve just read that ISO 9660 means the ISO file system for CD-ROM). Ideally I’d like a nice quick mac os x command-line tool rather than having to mess about with AppleScript…

    ... unless of course someone has some AppleScript to control Toast 8 complete with error traps using try, end try…? :-)

    Cheers and thanks for your help…

    Nick

  53. nmiddleweek about 1 year later:

    Here’s the answer…

    From a mac terminal session… type

    hdiutil makehybrid -o ~/Desktop/[outfile] ~/Desktop/[source]

    [source] can be a folder! or an exiting CD image…

    For more details read the apple man pages: http://developer.apple.com/DOCUMENTATION/Darwin/Reference/ManPages/man1/hdiutil.1.html

    and read these forums…

    http://www.macosxhints.com/comment.php?mode=view&;cid=89781&query=disk%20utility%209660 http://www.macosxhints.com/comment.php?mode=view&;cid=89782 http://www.macosxhints.com/comment.php?mode=view&;cid=89783

    Hope that helps someone!

  54. john madsen about 1 year later:

    Works in leopard just fine making a iso right now cool osx86 here i come

    Thanks

  55. Caleb Schreyer about 1 year later:

    Does this work the same in 10.5

  56. tree about 1 year later:

    hello,

    i’m trying to make the iso file for an audio cd. under disc utility, the ‘new -> disc image from(select device)’ is shown as grey and i can not select it. is there anyway to solve it?

    regards.

  57. Jeff about 1 year later:

    Super.

    And thanks @Rees Clissold for the info on using Disk Utility.

  58. Jose about 1 year later:

    i didn’t read all of the posts so sorry for any doubles… i did it exactly as described but i get an error message

    dd: /dev/disk2: Input/output error
    945+0 records in
    945+0 records out
    1935360 bytes transferred in 26.486537 secs (73070 bytes/sec)

    i get the same input/output error when i use disk utility… what am i doing wrong? thanks

  59. chort about 1 year later:

    Does anyone have a solution for ripping and then burning multi-session disks? I can grab the MacOS session off the CD and create a disk image from that, but the original CD I’m trying to copy has a Windows session too and that is invisible from OS X. In Disk Utility I can’t create a new disk image from the root CD, I can only create a disk image from the Session.

    I tried the dd method, but that ended up with an unreadable disk image. Any ideas?

Comments