Page 1 of 1

Initialize HFS+ disk image from OS X command line?

Posted: Wed Aug 09, 2017 12:20 pm
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?

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

Posted: Wed Aug 09, 2017 12:59 pm
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)?

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

Posted: Wed Aug 09, 2017 1:19 pm
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.

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

Posted: Wed Aug 09, 2017 1:33 pm
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.