1

I have a disk image file containing multiple file systems, such as HFS (Journaled) in addition to Joliet or UDF. I want to mount whatever non-HFS file system is there. First, I attach the image without mounting:

$ hdiutil attach -nomount path/to/image.iso

/dev/disk3 Apple_partition_scheme
/dev/disk3s1 Apple_partition_map
/dev/disk3s2 Apple_HFS

Then, the man page for mount seems to say that I can mount non-HFS file systems like this:

$ mount -a -t nohfs /dev/disk3s2 /tmp

But the response is

mount: exec /System/Library/Filesystems/nohfs.fs/Contents/Resources/mount_nohfs for /private/tmp: No such file or directory

which sounds like it just doesn't understand the documented "no" prefix for filesystem types that you don't want to mount. Is there any way to make this work, or must I know what specific file system I want to mount?

(This motivation for this question involved building CDs for software distribution. That might not be of interest here. But people on StackOverflow suggested that there might be more expertise on the mount command on this site.)

1 Answer 1

2

You should parse the output of hdiutil, and mount the filesystems you're interested in - because you can't do what you're trying to do with mount.

The first few lines of the man page show supported syntax:

 mount [-adfruvw] [-t lfs | external_type]
 mount [-dfruvw] special | node
 mount [-dfruvw] [-o options] [-t lfs | external_type] special node

Notice for -a, there are no options to specify a node path, which makes your command invalid syntax.

(Also, I'd suggest testing with a proper image file - one that is an actual CD image. Your image is a hard-disk type, with an Apple Partition Map, and no non-HFS partitions. In Disk Utility, choose New -> Blank Image and note all the selections carefully. You want "CD/DVD"; you can then edit the partition map after you've created it; say, to change to two partitions.)

3
  • Thanks for the note about the -a flag, I guess that's right. As for your parenthetical note, it's not an image made from a CD, but it's an image that can be burned to a CD. It's a single partition with multiple file systems, created with hdiutil makehybrid.
    – JWWalker
    Commented Jan 9, 2012 at 8:02
  • Hrm. I'm very surprised that an image generated by makehybrid would have an apple partition map. Commented Jan 9, 2012 at 8:31
  • I guess it depends on the image used as the source of makehybrid.
    – JWWalker
    Commented Jan 9, 2012 at 17:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .