Jan 15, '04 10:14:00AM • Contributed by: avramd
I've always know this could be done with dd, but never knew the exact options to give it. I still don't know the nuances of filesystems and disk structures, but I ran into this hint that claimed to have the right parameters. The problem is that it didn't tell you what to use for "/path/to/InputFile," and the answer is enough of a nuance that I decided to share it.
The "input file" in this case needs to be the Unix device file for the CD drive that the CD is in, so you need to determine what that actually is. Furthermore, the CD must not be mounted when you do this, and getting the CD in the drive without OS X mounting it is also not necessarily obvious.
This is not rocket science for the Unix seasoned, but I figured it was worth sharing.
Here's the process...
- To determine the path to the CD's device file, insert the CD, and let OS X mount it to your desktop.
- In Terminal, run the following command, and take a look at the result:
Somewhere in there you'll see the CD. Look at the beginning of that line, under "Filesystem" -- that is the name of the device file. Select and copy it. You have to be logged in as an administrator, and provide your password, to do this.
Spinnaker% df -k /Volumes/* Filesystem 1K-blocks Used Avail Capacity Mounted on /dev/disk1s0 659122 659122 0 100% /Volumes/Data_DRNA_100a /dev/disk0s3 58474008 49279888 8938120 85% / Spinnaker%
- Unmount the CD's volume (without ejecting it :-) like this:
You should see it disappear from the desktop. Now dd can access the device file.
Spinnaker% sudo umount /dev/disk1s0 Password: Spinnaker%
- Run the actual dd command, using the device file as the "/path/to/InputFile". This puts it in your home directory, but you can put it wherever you want:
Note the distinct lack of feedback on whether anything is happening at all, save for your CD spinning up, and this command taking a good 10 minutes to complete before you get your prompt back.
Spinnaker% dd if=/dev/disk1s0 of=$HOME/outfile.iso bs=2048 Spinnaker%
But but this is how you fill in the "input file" variable in the above referenced hint, and it does create an image file that both OS X and VPC can mount, and VPC will pretend it's an actual CD.