Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

noire anqa

macrumors regular
Original poster
Aug 20, 2010
137
0
Hi there,

I'm getting weird behaviour with hdiutil, anyone know what this is about?

Code:
hdiutil attach -nobrowse ${SparsebundlePath}

Works.

Code:
hdiutil attach -nobrowse ${SparsebundlePath} -mountpoint ${MountPath}

Fails with error "hdiutil: attach failed - no mountable file systems".

Code:
sudo hdiutil attach -nobrowse ${SparsebundlePath} -mountpoint ${MountPath}

Works.
 

chown33

Moderator
Staff member
Aug 9, 2009
10,747
8,421
A sea of green
If "${MountPath}" doesn't exist, you'll need write permission to create it. What are the permissions on the directory where "${MountPath}" resides?


And you really should double-quote your parameter expansions. If one of them happens to have a space in the pathname, and you don't quote, you're hosed.
 

noire anqa

macrumors regular
Original poster
Aug 20, 2010
137
0
If "${MountPath}" doesn't exist, you'll need write permission to create it. What are the permissions on the directory where "${MountPath}" resides?


And you really should double-quote your parameter expansions. If one of them happens to have a space in the pathname, and you don't quote, you're hosed.

Hi chown, cheers for getting back to me.

Yeah I'm quoting in the actual script, I just omitted them above.

Mount path exists, it's owned by root, and the group is admin, permissions on mount path are 777, its parent dir is /

The user issuing the commands is in admin, but the permissions are 777 so it shouldn't matter right?
 

chown33

Moderator
Staff member
Aug 9, 2009
10,747
8,421
A sea of green
Code:
drwxrwx---@ 4 root  admin  - 136 15 May 19:15 /Virtual Machines/
	com.apple.FinderInfo	 32

The permissions on that directory are 770, not 777 as you said. As a result, only the root user or a member of admin group can write to it.

drwxrwx--- is 770.
drwxrwxrwx would be 777.

Furthermore, if that pathname is unquoted, it won't expand correctly due to the embedded blank. I realize you said that your real code was quoted, but without seeing real code, it's possible you missed something. One way to double-check is to change the name to Virtual-Machines, which doesn't need quoting. If that works, you have a quoting problem (or more precisely, a lack-of-quoting problem).
 

noire anqa

macrumors regular
Original poster
Aug 20, 2010
137
0
Thanks for all your help on this chown ..
Here's all the info i have on this - apologies for the drips and drabs of info previously.

I just don't get it! Any ideas?


Code:
Last login: Sun May 15 19:43:35 on ttys005

 [Personal@dhcp-91-074]~> sudo chown -R root:staff /Virtual\ Machines/ /.Virtual\ Machines/

 [Personal@dhcp-91-074]~> sudo chmod -R 777 /Virtual\ Machines/ /.Virtual\ Machines/

 [Personal@dhcp-91-074]~> ls -ldOe@ /Virtual\ Machines/
drwxrwxrwx@ 3 root  staff  - 102 15 May 19:22 /Virtual Machines/
	com.apple.FinderInfo	 32 

 [Personal@dhcp-91-074]~> ls -ldOe@ /.Virtual\ Machines/
drwxrwxrwx  6 root  staff  - 204 12 May 22:30 /.Virtual Machines/

 [Personal@dhcp-91-074]~> hdiutil attach -nobrowse /.Virtual\ Machines/Encrypted\ Virtual\ Machines.sparsebundle -mountpoint /Virtual\ Machines
hdiutil: attach failed - no mountable file systems

 [Personal@dhcp-91-074]~> sudo hdiutil attach -nobrowse /.Virtual\ Machines/Encrypted\ Virtual\ Machines.sparsebundle -mountpoint /Virtual\ Machines
/dev/disk7          	GUID_partition_scheme          	
/dev/disk7s1        	EFI                            	
/dev/disk7s2        	Apple_HFS                      	/Virtual Machines

 [Personal@dhcp-91-074]~> echo $USER
Personal

 [Personal@dhcp-91-074]~> groups $USER
staff com.apple.sharepoint.group.3 com.apple.access_screensharing _developer _lpoperator _lpadmin _appserveradm admin _appserverusr localaccounts everyone com.apple.sharepoint.group.2 com.apple.sharepoint.group.1 com.apple.access_ssh
 

chown33

Moderator
Staff member
Aug 9, 2009
10,747
8,421
A sea of green
Post the output of:
Code:
ls -laOe@ /.Virtual\ Machines/
and of:
Code:
mount
with no sparse-bundles attached.

Make sure there's no password or encryption on the disk image. If there is, you need to provide the key or password.

And post the code that shows how you unmount the sparse bundle.

Finally, consider using the -plist or -puppetstrings option of hdiutil to maybe get more detailed error information.
 
Last edited:

noire anqa

macrumors regular
Original poster
Aug 20, 2010
137
0
Code:
[Personal@Aquarius]~> ls -laOe@ /.Virtual\ Machines/
total 24
drwxrwxrwx   5 root  staff  -       170 17 May 13:00 .
drwxr-xr-x  35 root  admin  -      1258 15 May 16:59 ..
-rwxrwxrwx@  1 root  staff  hidden 6148 17 May 13:00 .DS_Store
	com.apple.FinderInfo	  32 
drwxrwxrwx@  6 root  staff  -       204 17 May 12:59 Encrypted Virtual Machines.sparsebundle
	com.apple.FinderInfo	  32 
-rwxrwxrwx   1 root  staff  -         8 13 May 12:00 Mount Status

 [Personal@Aquarius]~> mount
/dev/disk2 on / (hfs, local, journaled)
devfs on /dev (devfs, local, nobrowse)
map -hosts on /net (autofs, nosuid, automounted, nobrowse)
map auto_home on /home (autofs, automounted, nobrowse)
/dev/disk4s2 on /Users/Work (hfs, local, nodev, nosuid, journaled, nobrowse)
/dev/disk5s2 on /Users/University (hfs, local, nodev, nosuid, journaled, nobrowse)
/dev/disk3s2 on /Users/Personal (hfs, local, nodev, nosuid, journaled, nobrowse)

There is a password on the disk image, however it's saved in the keychain and so i'm never prompted.

I'm mounting many other encrypted disk images using exactly the same process, the only difference being this one is on my boot disk.

I'm mounting and unmounting using the following:

Code:
mountVolume()
{
	sparsebundle_path=${1}; mount_point=${2}
    
	attach_result=`sudo hdiutil attach -nobrowse "${sparsebundle_path}" -mountpoint "${mount_point}"`
    echo "${attach_result}" >> "${mount_log}"
}

unmountVolume()
{
	mount_point=${1}    

	unmount_result=`sudo hdiutil unmount "${mount_point}"`
    echo "${unmount_result}" >> "${unmount_log}"
}

And here's the output with the plist & -puppetstrings flags

Code:
[Personal@Aquarius]/> hdiutil attach -plist -nobrowse .Virtual\ Machines/Encrypted\ Virtual\ Machines.sparsebundle -mountpoint /Virtual\ Machines
hdiutil: attach failed - no mountable file systems

 [Personal@Aquarius]/> hdiutil attach -puppetstrings -nobrowse .Virtual\ Machines/Encrypted\ Virtual\ Machines.sparsebundle -mountpoint /Virtual\ Machines
hdiutil: attach failed - no mountable file systems

 [Personal@Aquarius]/> sudo hdiutil attach -puppetstrings -nobrowse .Virtual\ Machines/Encrypted\ Virtual\ Machines.sparsebundle -mountpoint /Virtual\ Machines
Password:
/dev/disk7          	GUID_partition_scheme          	
/dev/disk7s1        	EFI                            	
/dev/disk7s2        	Apple_HFS                      	/Virtual Machines

 [Personal@Aquarius]/> sudo hdiutil attach -plist -nobrowse .Virtual\ Machines/Encrypted\ Virtual\ Machines.sparsebundle -mountpoint /Virtual\ Machines
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>system-entities</key>
	<array>
		<dict>
			<key>content-hint</key>
			<string>GUID_partition_scheme</string>
			<key>dev-entry</key>
			<string>/dev/disk7</string>
			<key>potentially-mountable</key>
			<integer>0</integer>
			<key>unmapped-content-hint</key>
			<string>GUID_partition_scheme</string>
		</dict>
		<dict>
			<key>content-hint</key>
			<string>Apple_HFS</string>
			<key>dev-entry</key>
			<string>/dev/disk7s2</string>
			<key>mount-point</key>
			<string>/Virtual Machines</string>
			<key>potentially-mountable</key>
			<integer>1</integer>
			<key>unmapped-content-hint</key>
			<string>48465300-0000-11AA-AA11-00306543ECAC</string>
			<key>volume-kind</key>
			<string>hfs</string>
		</dict>
		<dict>
			<key>content-hint</key>
			<string>EFI</string>
			<key>dev-entry</key>
			<string>/dev/disk7s1</string>
			<key>potentially-mountable</key>
			<integer>0</integer>
			<key>unmapped-content-hint</key>
			<string>C12A7328-F81F-11D2-BA4B-00A0C93EC93B</string>
		</dict>
	</array>
</dict>
</plist>

Thanks so much for helping with this chown ..
 

noire anqa

macrumors regular
Original poster
Aug 20, 2010
137
0
Code:
 [Personal@Aquarius]~> mount
/dev/disk2 on / (hfs, local, journaled)
devfs on /dev (devfs, local, nobrowse)
map -hosts on /net (autofs, nosuid, automounted, nobrowse)
map auto_home on /home (autofs, automounted, nobrowse)
/dev/disk4s2 on /Users/Work (hfs, local, nodev, nosuid, journaled, nobrowse)
/dev/disk5s2 on /Users/University (hfs, local, nodev, nosuid, journaled, nobrowse)
/dev/disk3s2 on /Users/Personal (hfs, local, nodev, nosuid, journaled, nobrowse)

 [Personal@Aquarius]~> ls -laOe@ /Virtual\ Machines/
total 280
drwxrwxrwx@  3 root  staff  -       102 15 May 19:22 .
	com.apple.FinderInfo	  32 
drwxr-xr-x  35 root  admin  -      1258 15 May 16:59 ..
-rwxrwxrwx@  1 root  staff  hidden    0 23 Mar 14:47 Icon?
	com.apple.FinderInfo	  32 
	com.apple.ResourceFork	142953 

 [Personal@Aquarius]~> hdiutil attach -nobrowse /.Virtual\ Machines/Encrypted\ Virtual\ Machines.sparsebundle -mountpoint /Virtual\ Machines
hdiutil: attach failed - no mountable file systems

 [Personal@Aquarius]~> sudo chown Personal:staff /Virtual\ Machines

 [Personal@Aquarius]~> hdiutil attach -nobrowse /.Virtual\ Machines/Encrypted\ Virtual\ Machines.sparsebundle -mountpoint /Virtual\ Machines
/dev/disk7          	GUID_partition_scheme          	
/dev/disk7s1        	EFI                            	
/dev/disk7s2        	Apple_HFS                      	/Virtual Machines

 [Personal@Aquarius]~> hdiutil unmount /Virtual\ Machines
"/Virtual Machines" unmounted successfully.

 [Personal@Aquarius]~> mount
/dev/disk2 on / (hfs, local, journaled)
devfs on /dev (devfs, local, nobrowse)
map -hosts on /net (autofs, nosuid, automounted, nobrowse)
map auto_home on /home (autofs, automounted, nobrowse)
/dev/disk4s2 on /Users/Work (hfs, local, nodev, nosuid, journaled, nobrowse)
/dev/disk5s2 on /Users/University (hfs, local, nodev, nosuid, journaled, nobrowse)
/dev/disk3s2 on /Users/Personal (hfs, local, nodev, nosuid, journaled, nobrowse)

 [Personal@Aquarius]~> sudo chown root:staff /Virtual\ Machines

 [Personal@Aquarius]~> ls -laOe@ /Virtual\ Machines/
total 280
drwxrwxrwx@  3 root  staff  -       102 15 May 19:22 .
	com.apple.FinderInfo	  32 
drwxr-xr-x  35 root  admin  -      1258 15 May 16:59 ..
-rwxrwxrwx@  1 root  staff  hidden    0 23 Mar 14:47 Icon?
	com.apple.FinderInfo	  32 
	com.apple.ResourceFork	142953 

 [Personal@Aquarius]~> hdiutil attach -nobrowse /.Virtual\ Machines/Encrypted\ Virtual\ Machines.sparsebundle -mountpoint /Virtual\ Machines
hdiutil: attach failed - no mountable file systems

It's so strange .. it's as though group permissions aren't being respected and i have to actually own the directory.
 
Last edited:

chown33

Moderator
Staff member
Aug 9, 2009
10,747
8,421
A sea of green
Some things come to mind.

1. The 'hdiutil unmount' command is not the opposite of 'hdiutil attach'. The correct opposite is 'hdiutil detach'. Read the man page for hdiutil.

2. If the password is on the keychain, whose keychain? Your normal login account, or the root account? What access privileges does the keychain have?

3. Have you tried it with an unencrypted sparse bundle? In short, isolate the cause of the problem by creating a test case that works as desired, then change it until it stops working. The change that makes it stop working is the cause.

4. In the process of isolating the cause, be sure to try attaching to a directory that your normal login account owns. In other words, test the hypothesis you stated: "it's as though group permissions aren't being respected and i have to actually own the directory." Given that the mount point and the sparse bundle are public-writable, I see no reason that root needs to own the mount-point. You might even look at the /Users/Shared directory (public-writable, but sticky) as a better location to make mount-point dirs, rather than in / itself.
 

isthishappening

macrumors newbie
Aug 31, 2012
1
0
Hi everyone,

I'm not a programmer or anything at best laymen terms are complicated, on my TC 7.1a for the first time on a newly made partician which has worked the 4 dozen previous mountings and now this code:

hdiutil: attach failed - no mountable file systems​

hdiutil: attach failed - no mountable file systems


Can somebody help ala black and white simple or will I be crying? I'd appreciate any assistance.

10.8.1 Snow Leopard
3.06 GHz Intel Core i3
4GB 1333MHz Ram
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.