Take the 2-minute tour ×
Ask Different is a question and answer site for power users of Apple hardware and software. It's 100% free, no registration required.

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.)

share|improve this question

migrated from serverfault.com Jan 9 '12 at 5:25

This question came from our site for professional system and network administrators.

add comment

1 Answer 1

up vote 2 down vote accepted

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.)

share|improve this answer
    
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 Jan 9 '12 at 8:02
    
Hrm. I'm very surprised that an image generated by makehybrid would have an apple partition map. –  BeeDee Jan 9 '12 at 8:31
    
I guess it depends on the image used as the source of makehybrid. –  JWWalker Jan 9 '12 at 17:29
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.