Re: Copy a multi partition CD/DVD?
- From: dempson@xxxxxxxxxxxxx (David Empson)
- Date: Wed, 13 Apr 2011 18:41:30 +1200
Justin <justin@xxxxxxxxxxxxxxxxxxxxxx> wrote:
I have a DVD here with two sessions, one for PCs and one for Mac. I
need to make an exact duplicate with both partitions.
I figure I'll use the dd command to make an ISO and then burn the ISO
using Disk Utility.
dd if=/dev/disk1 of=~/DVDimage.iso bs=2k
Here is what diskutil -list gets me.
/dev/disk1
0: CD_partition_scheme *492.2 MB disk1
1: Apple_partition_scheme 428.6 MB disk1s1
2: Apple_partition_map 32.3 KB disk1s1s1
3: Apple_HFS Sales_Demo 153.8MB disk1s1s2
Will that work, resulting in an ISO complete with the partitions OSX
doesn't see?
Probably not.
Mac OS X appears to create a virtual file system for mounted CDs and
DVDs, which doesn't match what is actually on the disk. The
"CD_partition_scheme" in the list above doesn't exist on the CD.
If I examine a hybrid CD using "hexdump -C /dev/disk1", it shows some
additional data wrapped around the Apple partition map, and the ISO 9660
directory is at the wrong offset.
If I examine the disk again using "hexdump -C /dev/rdisk1s1", it shows
what I expected to see: Apple driver descriptor map at the start of the
disc, partition map at 512 bytes, and ISO 9660 directory at 32768 bytes.
You would probably have to copy /dev/rdisk1s1 rather than copying
/dev/disk1.
You can create a valid disk image of a hybrid CD using Disk Utility.
Select the icon of the entire CD (leftmost icon, not the indented one),
and click on the New Image button. Choose "DVD/CD Master" as the image
format, and it will save a .cdr file (which you can rename as .iso).
I normally use Toast to copy hybrid CDs and it just works.
Some background:
A hybrid CD/DVD doesn't normally use separate sessions for Mac and
Windows content. There is a single session containing two file systems,
which are interleaved in a complex way.
The Apple Partition Map scheme is based around a block size of 512 bytes
(so a CD's 2048 byte physical sector is treated as 4 logical sectors).
Block 0 of the physical disk contains a driver descriptor map (normally
unused on a CD), and the partition map starts in block 1, with one block
required for each partition (including the partition table itself).
Windows uses ISO 9660 on CDs. DVDs might be ISO 9660 or UDF. (I haven't
looked into UDF in detail.)
ISO 9660 starts its file system 32768 bytes into the disk, which
corresponds to logical block 64 of a disk using Apple Partition Map. To
accomodate ISO 9660 on a hybrid CD/DVD, the APM partition table is
specified as being 2 blocks, and there is an unassigned area starting at
block 3 until the end of the ISO 9660 area. The rest of the disk is a
standard HFS/HFS+ file system, in a single partition.
ISO 9660 has the ability to reference files located anywhere on the
CD/DVD, so it is possible for the ISO 9660 file system to reference
files within the HFS/HFS+ volume, resulting in a shared file that only
needs to be included once on the CD.
This feature also allows for multi-session ISO 9660 CDs which
effectively update the previous session with a new one. On a
multi-session ISO 9660 CD, the directory is read from the last session,
ignoring all earlier ones. That directory may refer back to files
located in earlier sessions, so it is possible to "update" an ISO 9660
CD without having to rewrite all of its content in the new session, just
an updated directory and any new or replaced files.
If you write a multi-session CD with HFS/HFS+, then you end up with what
looks like a partitioned disk, with each session appearing as a separate
logical volume. HFS/HFS+ can't share files between sessions/partitions,
so you have to write everything again to "update" a CD.
--
David Empson
dempson@xxxxxxxxxxxxx
.
- Follow-Ups:
- Re: Copy a multi partition CD/DVD?
- From: Justin
- Re: Copy a multi partition CD/DVD?
- From: Jolly Roger
- Re: Copy a multi partition CD/DVD?
- References:
- Copy a multi partition CD/DVD?
- From: Justin
- Copy a multi partition CD/DVD?
- Prev by Date: Copy a multi partition CD/DVD?
- Next by Date: Re: Running binaries for other architectures on Darwin
- Previous by thread: Copy a multi partition CD/DVD?
- Next by thread: Re: Copy a multi partition CD/DVD?
- Index(es):
Relevant Pages
|