User Tools

Site Tools


Create DMG in Linux (e.g., backup installer DVD)

1. Mount HFS dvd

#assumes /dev/hdc is the CD/DVD drive
#assumes dvd is hfsplus filesystem, kernel supports HFS+ and any required utility is installed

mount -t hfsplus /dev/hdc /mnt/cdrom

2. Create empty image file and format

#Assumes 590M filesize and dmg format (may create .iso format)
dd if=/dev/zero of=/path/to/output.dmg bs=1 count=0 seek=590M 
mkfs.hfsplus -v 'Description of DMG file' output.dmg

3. Mount empty image

mount -o loop /path/to/output /mnt/tmp

4. Copy contents

cp -R /mnt/cdrom/* /mnt/tmp

5. Unmount

umount /mnt/tmp
umount /mnt/cdrom


#assumes command is executed from within the directory that contains the updated files
mkisofs -r -o /path/to/output.iso
linux/dmg.txt · Last modified: 2013/03/22 22:05 (external edit)