Initialize HFS+ disk image from OS X command line?

About SheepShaver, a PPC Mac emulator for Windows, MacOS X, and Linux that can run System 7.5.3 to MacOS 9.0.4.

Moderators: Cat_7, Ronald P. Regensburg, ClockWise

Post Reply
emendelson
Forum All-Star
Posts: 1231
Joined: Tue Oct 14, 2008 12:12 am

Initialize HFS+ disk image from OS X command line?

Post by emendelson »

I know how to create an HFS+ disk image in OS X using hdiutil. Is there a way to initialize the disk from the command line, so that OS 9 under SheepShaver will NOT display the "Initialize disk" dialog when the disk is first mounted?
User avatar
Ronald P. Regensburg
Expert User
Posts: 6357
Joined: Thu Feb 09, 2006 10:24 pm
Location: Amsterdam, Netherlands

Re: Initialize HFS+ disk image from OS X command line?

Post by Ronald P. Regensburg »

Doesn't hdiutil create compressed image files by default? Did you make sure the image will be read/write (-type UDRW)?
emendelson
Forum All-Star
Posts: 1231
Joined: Tue Oct 14, 2008 12:12 am

Re: Initialize HFS+ disk image from OS X command line?

Post by emendelson »

The image is certainly r/w, because I can initialize it in SheepShaver and write files to it. What I'm trying to avoid is this step described in the setup guide, when SheepShaver first tries to add a disk.
During startup, the system will encounter the newly created volume and will offer to initialize it. Give the volume an appropriate name (for instance MacOS9HD) and (for Mac OS 8.1 or later) choose Mac OS Extended for the format. Click to proceed with initializing the volume.
Here the wiki is describing the disk created in order to install Mac OS, but the same dialog appears for any newly-created disk, and that dialog is what I'm trying to avoid if possible, because it tends to terrify non-expert users.
emendelson
Forum All-Star
Posts: 1231
Joined: Tue Oct 14, 2008 12:12 am

Re: Initialize HFS+ disk image from OS X command line?

Post by emendelson »

Apologies for wasting bandwidth. I found the answer to my own question by searching the forum for the correct command. What I needed to add was:

-layout SPUD -type UDIF -nospotlight

and that caused the disk to be created and to appear on the desktop without the initialization prompt.
Post Reply