NetBSD has some useful tools for dealing with Macintosh disk image files. You can use these to copy files out of or into a Disk Copy disk image, or create a new disk image that can be mounted and read by Disk Copy on a Mac.
hfsutils
package, a collection of tools for reading and manipulating Macintosh HFS volumes.mkhybrid
, a utility for creating disk images (especially CD-ROM images); available as a NetBSD package.vnd
, the vnode disk driver, which allows you to treat a file (e.g. a disk image) as if it were a real disk.vnconfig
, the utility for configuring and unconfiguring disk images for access through a vnd
device special file.If you're used to using Disk Copy on the Mac, you may find using these commands a little involved, but they get the job done.
vnconfig -v -c vnd0d MacDisk.img
hmount /dev/vnd0d
hls hcopy "Docs:ReadMe" /tmp/readme ...
humount vnconfig -v -u vnd0d
The easiest way to do this is to use mkhybrid
. Here we're
taking the directory tree starting at /tmp/mac/system
and copying
into a new HFS disk image at /tmp/test.img
.
mkhybrid -hfs -hfs-volid "My Mac Disk" -o /tmp/test.img /tmp/mac/system
You can copy the image file to a Mac, set the Type and Creator to rohd
and ddsk
, and double-click the file to mount it with Disk Copy.
du --block-size=1024 /tmp/mac/system
dd if=/dev/zero of=/tmp/test.img bs=1024 count=6511
(To create a 1.44 MB floppy image, use bs=512 and count=2880)
vnconfig -v -c vnd0d /tmp/test.img
mkhybrid -hfs /dev/rvnd0d
humount vnconfig -v -u vnd0d
The new image can now be copied to a Macintosh and mounted using DiskCopy.