Error unmounting external hard drive

Bug #332016 reported by hackel
This bug report is a duplicate of:  Bug #268356: Cannot unmount volume error. Edit Remove
2
Affects Status Importance Assigned to Milestone
Media Applet
New
Undecided
Unassigned
gnome-mount
New
Undecided
Unassigned
gnome-mount (Ubuntu)
Invalid
Medium
Unassigned

Bug Description

I'm using the media-applet 0.3.2 Ubuntu package, with gnome-mount 0.8-1ubuntu1. When I click to eject an external hard drive (labeled "External") in media-applet, it appears to work properly, however I get the following message:

Cannot unmount the volume 'External'.
Cannot remove directory

The /media/External directory does get removed, however. The following messages are displayed on the console:

mount added :68606E5F606E344A,External
(media-applet:17455): Gdk-CRITICAL **: gdk_window_get_origin: assertion `GDK_IS_WINDOW (window)' failed
mount removed : 68606E5F606E344A,External
unable to read content type attributeunable to read content type attribute

I get the exact same error message when I run "gnome-mount -vu -d /dev/sdb1" manuallly.
If I run "gnome-mount -ve -d /dev/sdb1" (eject instead of unmount), I get the following error:
Cannot eject volume
There was an error ejecting the volume or drive.
org.freedesktop.Hal.Device.Volume.UnknownFailure: Cannot remove directory

But this time, the partition gets unmounted, but the /media/External directory still exists, and I am not able to re-mount the drive with either media-applet or gnome-mount. Mounting manually (with "mount", as root) still works fine, and once I've mounted it once manually, I can remount it again with gnome-mount, however, if I don't first remove the /media/External directory, it will mount it to /media/External_.

Revision history for this message
Dariel Dato-on (odd-rationale) wrote :

I can reproduce the part where if you "don't first remove the /media/External directory, it will mount it to /media/External_".

This seems to be a permissions problem. gnome-mount uses HAL to mount external mediums. HAL usually mounts to /media/$disklabel. If you manually created /media/External as root (sudo mkdir /media/External) or somehow the permissions of that folder gets changed, then HAL does not have the permission to mount to that directory. Hence using /media/External_.

Perhaps you could try unplugging the external medium, removing that directory (sudo rmdir /media/External) and External_ if it exists, then try plugging the external medium back, and mounting it with gnome-mount.

Mixing the use of gnome-mount and mount may cause permissions problems sometimes.

Hope that helps!

Revision history for this message
hackel (hackel) wrote :

I didn't explain myself clearly. I did not ever create the /media/External directory, it was created by hal. When I ran mount manually, I was mounting to /mnt. If I remove the /media/External directory as you said, then the next time it is re-created by hal. However, if I try to eject using gnome-mount, then the /media/External directory is left behind, and even if I remove that directory manually, I can no longer mount the disk with gnome-mount. When I try, nothing happens at all until I either unplug and plug the USB drive, or mount it manually to /mnt and unmount it. See below:

If I try to eject the drive after automounting:

hackel@hermes:~$ gnome-mount -vte -d /dev/sdb1
gnome-mount 0.8
** (gnome-mount:27280): DEBUG: Ejecting /org/freedesktop/Hal/devices/volume_uuid_68606E5F606E344A
** (gnome-mount:27280): DEBUG: Setting up 750ms timer for Flushing Cache dialog
** (gnome-mount:27280): DEBUG: in unmount_done : user_data = 0x0
** Message: Eject failed for /org/freedesktop/Hal/devices/volume_uuid_68606E5F606E344A: org.freedesktop.Hal.Device.Volume.UnknownFailure : Cannot remove directory

Drive *is* unmounted, but /media/External remains (with permissions 700), and I am no longer able to mount the drive with gnome-mount, because it thinks it is already mounted:

hackel@hermes:~$ gnome-mount -vt -d /dev/sdb1
gnome-mount 0.8
** (gnome-mount:26892): DEBUG: Mounting /org/freedesktop/Hal/devices/volume_uuid_68606E5F606E344A
** (gnome-mount:26892): DEBUG: read default option 'locale=' from gconf strlist key /system/storage/default_options/ntfs-3g/mount_options
** (gnome-mount:26892): DEBUG: read default option 'exec' from gconf strlist key /system/storage/default_options/ntfs-3g/mount_options
** (gnome-mount:26892): DEBUG: Mounting /org/freedesktop/Hal/devices/volume_uuid_68606E5F606E344A with mount_point='External', fstype='ntfs-3g', num_options=2
** (gnome-mount:26892): DEBUG: option='locale=en_GB.UTF-8'
** (gnome-mount:26892): DEBUG: option='exec'
** Message: Mount failed for /org/freedesktop/Hal/devices/volume_uuid_68606E5F606E344A
org.freedesktop.Hal.Device.Volume.AlreadyMounted : Device /dev/sdb1 is already mounted.

If I mount the drive manually to /mnt and then unmount it, gnome-mount will work again. Also, if i remove the cable and plug it back in, it automounts properly. Now, if I try to unmount it:

hackel@hermes:~$ gnome-mount -vtu -d /dev/sdb1
gnome-mount 0.8
** (gnome-mount:27093): DEBUG: Unmounting /org/freedesktop/Hal/devices/volume_uuid_68606E5F606E344A
** (gnome-mount:27093): DEBUG: Setting up 750ms timer for Flushing Cache dialog
** (gnome-mount:27093): DEBUG: in unmount_done : user_data = 0x0
** Message: Unmount failed for /org/freedesktop/Hal/devices/volume_uuid_68606E5F606E344A: org.freedesktop.Hal.Device.Volume.UnknownFailure : Cannot remove directory

Drive *is* unmounted and /media/External is gone. It appears that everything worked properly, yet I get the "cannot remove directory" error.

Hopefully this clarifies what is going on. Perhaps this is actually a hal error?

Revision history for this message
Sebastien Bacher (seb128) wrote :

Thanks for the bug report. This particular bug has already been reported, but feel free to report any other bugs you find.

Changed in gnome-mount:
importance: Undecided → Medium
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.