Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old May 12, 2011, 05:39 PM   #1
noire anqa
macrumors regular
 
Join Date: Aug 2010
hdiutil mountpoint issue

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.
__________________
Mac Pro 8x 3.33GHz, 22GB RAM, 9TB HDD
iPad Mini 32GB, iPhone 5 32GB
noire anqa is offline   0 Reply With Quote
Old May 12, 2011, 06:53 PM   #2
chown33
macrumors 603
 
Join Date: Aug 2009
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.
chown33 is offline   0 Reply With Quote
Old May 12, 2011, 11:06 PM   #3
noire anqa
Thread Starter
macrumors regular
 
Join Date: Aug 2010
Quote:
Originally Posted by chown33 View Post
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?
__________________
Mac Pro 8x 3.33GHz, 22GB RAM, 9TB HDD
iPad Mini 32GB, iPhone 5 32GB
noire anqa is offline   0 Reply With Quote
Old May 13, 2011, 02:04 AM   #4
chown33
macrumors 603
 
Join Date: Aug 2009
Description too complicated. Just post output from 'ls -ldOe@ /pathname/here'.

Last edited by chown33; May 13, 2011 at 02:28 AM.
chown33 is offline   0 Reply With Quote
Old May 15, 2011, 02:21 PM   #5
noire anqa
Thread Starter
macrumors regular
 
Join Date: Aug 2010
Quote:
Originally Posted by chown33 View Post
Description too complicated. Just post output from 'ls -ldOe@ /pathname/here'.
Code:
drwxrwx---@ 4 root  admin  - 136 15 May 19:15 /Virtual Machines/
	com.apple.FinderInfo	 32
__________________
Mac Pro 8x 3.33GHz, 22GB RAM, 9TB HDD
iPad Mini 32GB, iPhone 5 32GB
noire anqa is offline   0 Reply With Quote
Old May 15, 2011, 02:36 PM   #6
chown33
macrumors 603
 
Join Date: Aug 2009
Quote:
Originally Posted by noire anqa View Post
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).
chown33 is offline   0 Reply With Quote
Old May 15, 2011, 02:53 PM   #7
noire anqa
Thread Starter
macrumors regular
 
Join Date: Aug 2010
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
__________________
Mac Pro 8x 3.33GHz, 22GB RAM, 9TB HDD
iPad Mini 32GB, iPhone 5 32GB
noire anqa is offline   0 Reply With Quote
Old May 15, 2011, 03:05 PM   #8
chown33
macrumors 603
 
Join Date: Aug 2009
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 by chown33; May 15, 2011 at 03:12 PM.
chown33 is offline   0 Reply With Quote
Old May 17, 2011, 08:17 AM   #9
noire anqa
Thread Starter
macrumors regular
 
Join Date: Aug 2010
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 ..
__________________
Mac Pro 8x 3.33GHz, 22GB RAM, 9TB HDD
iPad Mini 32GB, iPhone 5 32GB
noire anqa is offline   0 Reply With Quote
Old May 17, 2011, 08:25 AM   #10
noire anqa
Thread Starter
macrumors regular
 
Join Date: Aug 2010
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.
__________________
Mac Pro 8x 3.33GHz, 22GB RAM, 9TB HDD
iPad Mini 32GB, iPhone 5 32GB

Last edited by noire anqa; May 17, 2011 at 08:32 AM.
noire anqa is offline   0 Reply With Quote
Old May 17, 2011, 12:04 PM   #11
chown33
macrumors 603
 
Join Date: Aug 2009
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.
chown33 is offline   0 Reply With Quote
Old Aug 31, 2012, 11:45 PM   #12
isthishappening
macrumors newbie
 
Join Date: Aug 2012
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
isthishappening is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Can not mount Truecrypt container: "hdiutil: attach failed-no mountable file. tomcat1967 OS X Mavericks (10.9) 8 Dec 30, 2013 03:23 PM
Hardware issue? Software issue? SSD beginning to die? oneMadRssn MacBook Air 11 Jun 5, 2013 01:00 PM
Font rendering issue with rMBP (Macbook issue or website issue?) Vinterbird MacBook Pro 8 Feb 27, 2013 11:42 AM
So has the Wi-Fi issue been determined to be a hardware issue or software issue? 1080p iPhone 0 Sep 25, 2012 01:11 AM
Macbook Pro Backlight Issue will swapping Display solve issue? Kayla90 MacBook Pro 4 Aug 24, 2012 02:38 PM

Forum Jump

All times are GMT -5. The time now is 11:01 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC