Hdiutil: Difference between revisions

From OSDev.wiki
Jump to navigation Jump to search
[unchecked revision][unchecked revision]
Content added Content deleted
m (changed category)
 
(One intermediate revision by one other user not shown)
Line 28: Line 28:
-layout SPUD
-layout SPUD


I dont know if images created here are straight binary images that can be plugged into Bochs/VMWare etc...
I don't know if images created here are straight binary images that can be plugged into Bochs/VMWare etc...


* Example of creating and mounting an image:*
* Example of creating and mounting an image:*
Line 45: Line 45:
Use the name of the device file output in the previous step.
Use the name of the device file output in the previous step.


If you chose to not place your executable on a disk directly, you can use hdiutil burn ./floppy.dmg. If you try to use an ordinary burn, the boot image will be corrupt.
[[Category:Disk Image Utilities]]
[[Category:Disk Image Utilities]]

Latest revision as of 04:03, 5 April 2011

hdiutil is the program supplied by Apple to work with disk images

Support

hdiutil supports the following filesystem types:

  • HFS+
  • HFS+J
  • HFSX
  • HFS
  • MS-DOS
  • UFS

Creating Images

Create a DOS disk image:

hdiutil create -fs ms-dos -sectors 2880 floppy

(2880 sectors = 1.44mb floppy disk image)

If the image already exists, you must pass the -ov option or hdiutil will fail.

To create no apple partition image, use:

-layout NONE

To create an image with an apple partition layout, use:

-layout SPUD

I don't know if images created here are straight binary images that can be plugged into Bochs/VMWare etc...

  • Example of creating and mounting an image:*
hdiutil create -fs MS-DOS -sectors 2880 floppy

This will output floppy.dmg. Note that the MS-DOS argument is case sensitive.

hdid -nomount ./floppy.dmg

This will output the name of the device file created.

mkdir /Volumes/mnt
mount -t msdos /dev/disk2 /Volumes/mnt

Use the name of the device file output in the previous step.

If you chose to not place your executable on a disk directly, you can use hdiutil burn ./floppy.dmg. If you try to use an ordinary burn, the boot image will be corrupt.