#5491 closed Bugs (Fixed)

Auto-mounting removable devices fails on Ununtu 8.10 Intrepid

Reported by: cyberwizzard Owned by: Topfs2
Priority: 4 - Normal
Component: Linux Distribution (Operating-System) Version: 8.10 "Atlantis"
Severity: Normal Keywords: usb, auto-mount, hal, pmount
Cc: Blocked By:
Blocking: Platform: Linux

Description

When testing XBMC I noticed the HAL device detection in the logs, I therefor assumed that simply plugging in a USB stick or HD would be automatically mounted.

When testing, this worked because I ran XBMC in a full Ubuntu environment.

After removing the usual bootup scripts and skipping GDM and Gnome, XBMC has been working like a charm.... except drives aren't auto-mounted anymore.

Looking into it further, I see that XBMC is issueing a 'pmount /dev/sdc1 STICKNAME' to the system. I am in the plugdev group so that shouldn't be the problem.

After looking into it further, /sys/block/sdc1/removable was '1' but calling pmount by hand gave me "Device is not removable". I even tried to use pmount-hal as I read somewhere that it ignores the sysfs data and asks HAL directly (lshal showed that indeed it detected the drive as being removable) and still it wouldn't work (it used pmount behind the scene and it did not override the removable command so ofcourse it did not work).

After finding this: https://bugs.launchpad.net/ubuntu/+source/pmount/+bug/296164 I concluded that this is a bug in Ubuntu 8.10 Intrepid which won't be solved for a long time.

Because XBMC already uses HAL to detect new devices, it would be nice to mount the devices as well using HAL. This would solve the problem on Ubuntu 8.10 and possibly other linux distributions as well.

The HAL interface I am referring to is described here: http://people.freedesktop.org/~david/hal-spec/hal-spec.html#interface-device-volume

Change History (5)

comment:1 Changed at 2008-12-21T01:35:37Z by Topfs2

  • Owner set to Topfs2
  • Status changed from new to accepted

comment:2 Changed at 2008-12-21T13:46:05Z by Topfs2

Please try r16632 as this might fix the issues (moved away from pmount as suggested). If not the please provide a debuglog on that revision.

comment:3 Changed at 2008-12-23T22:55:21Z by cyberwizzard

This is the output of a session with:

  • On XBMC boot, an USB was already present
  • After a number of seconds, the stick was pulled without dismounting
  • Half a minute after that, the stick was inserted back in the computer
<snip>
23:37:04 T:3066771248 M: 59842560   DEBUG: HAL: Added - disk | UUID 363C8F053C8EBEFD | FileSystem ntfs | Mounted on /media/windows | HotPlugged NO  | Type 1 |Approved YES
23:37:04 T:3066771248 M: 59842560  NOTICE: LFS: Added - disk | Volume (ntfs)
23:37:04 T:3066771248 M: 59842560   DEBUG: HAL: Added - disk | UUID 78108a30-cd81-48eb-8432-acad6fcb06ec | FileSystem ext3 | Mounted on /home | HotPlugged NO  | Type 1 |Approved YES
23:37:04 T:3066771248 M: 59842560  NOTICE: LFS: Added - disk | Volume (ext3)
23:37:04 T:3066771248 M: 59842560   DEBUG: HAL: Added - disk | UUID cb85e8d0-2fae-4905-af61-0ce84ef315be | FileSystem swap | HotPlugged NO  | Type 1 |Approved NO
23:37:04 T:3066771248 M: 59842560  NOTICE: LFS: Added - disk | Volume (swap)
23:37:04 T:3066771248 M: 59842560   DEBUG: HAL: Added - disk | UUID 5d6960c6-86f8-4494-b6a9-c3760f83b65a | FileSystem ext3 | Mounted on / | HotPlugged NO  | Type 1 |Approved NO
23:37:04 T:3066771248 M: 59842560  NOTICE: LFS: Added - disk | Volume (ext3)
23:37:04 T:3066771248 M: 59842560    INFO: HAL: Generated global device list, found 68
23:37:04 T:3066771248 M: 59842560    INFO: HAL: Sucessfully initialized
23:37:04 T:3066771248 M: 59842560  NOTICE: initialize done
<snip>
23:37:32 T:3066771248 M: 56479744   DEBUG: HAL: Device (/org/freedesktop/Hal/devices/usb_device_930_6533_0800725150623890_if0_scsi_host_0_scsi_device_lun0_scsi_generic) Removed
23:37:32 T:3066771248 M: 56479744   DEBUG: HAL: Device (/org/freedesktop/Hal/devices/volume_uuid_AC9D_F912) Property volume.mount_point modified
23:37:32 T:3066771248 M: 56578048   DEBUG: HAL: Device (/org/freedesktop/Hal/devices/volume_uuid_AC9D_F912) Property volume.is_mounted_read_only modified
23:37:32 T:3066771248 M: 56578048   DEBUG: HAL: Device (/org/freedesktop/Hal/devices/volume_uuid_AC9D_F912) Property volume.is_mounted modified
23:37:32 T:3066771248 M: 56578048   DEBUG: HAL: Device (/org/freedesktop/Hal/devices/volume_uuid_AC9D_F912) Removed
23:37:32 T:3066771248 M: 56578048  NOTICE: HAL: Removed - removable disk | UUID AC9D-F912 | FileSystem vfat | Mounted on /media/BDEKENS | HotPlugged YES | Type 0 |Approved YES
23:37:32 T:3066771248 M: 56578048  NOTICE: LFS: Removed - removable disk | BDEKENS
23:37:32 T:3066771248 M: 56578048  NOTICE: HAL: UnMounting /org/freedesktop/Hal/devices/volume_uuid_AC9D_F912 (UUID AC9D-F912 | FileSystem vfat | Mounted on /media/BDEKENS | HotPlugged YES | Type 0 |Approved YES )
23:37:32 T:3066771248 M: 56578048   ERROR: DBus: org.freedesktop.DBus.Error.UnknownMethod - Method "Unmount" with signature "as" on interface "org.freedesktop.Hal.Device.Volume" doesn't exist
23:37:32 T:3066771248 M: 56578048   DEBUG: HAL: Device (/org/freedesktop/Hal/devices/storage_serial_0930_USB_Flash_Memory_0800725150623890_0_0) Removed
23:37:32 T:3066771248 M: 56578048   DEBUG: HAL: Device (/org/freedesktop/Hal/devices/usb_device_930_6533_0800725150623890_if0_scsi_host_0_scsi_device_lun0) Removed
23:37:32 T:3066771248 M: 56578048   DEBUG: HAL: Device (/org/freedesktop/Hal/devices/usb_device_930_6533_0800725150623890_if0_scsi_host_0) Removed
23:37:32 T:3066771248 M: 56578048   DEBUG: HAL: Device (/org/freedesktop/Hal/devices/usb_device_930_6533_0800725150623890_if0_scsi_host) Removed
23:37:32 T:3066771248 M: 56578048   DEBUG: HAL: Device (/org/freedesktop/Hal/devices/usb_device_930_6533_0800725150623890_if0) Removed
23:37:32 T:3066771248 M: 56578048   DEBUG: HAL: Device (/org/freedesktop/Hal/devices/usb_device_930_6533_0800725150623890) Removed
<snip>
23:38:00 T:3066771248 M: 55312384   DEBUG: HAL: Device (/org/freedesktop/Hal/devices/usb_device_930_6533_0800725150623890) Added
23:38:00 T:3066771248 M: 55410688   DEBUG: HAL: Device (/org/freedesktop/Hal/devices/usb_device_930_6533_0800725150623890) Property info.linux.driver modified
23:38:00 T:3066771248 M: 55410688   DEBUG: HAL: Device (/org/freedesktop/Hal/devices/usb_device_930_6533_0800725150623890_if0) Added
23:38:00 T:3066771248 M: 55410688   DEBUG: HAL: Device (/org/freedesktop/Hal/devices/usb_device_930_6533_0800725150623890_if0_scsi_host) Added
23:38:06 T:3066771248 M: 54661120   DEBUG: HAL: Device (/org/freedesktop/Hal/devices/usb_device_930_6533_0800725150623890_if0_scsi_host_0) Added
23:38:06 T:3066771248 M: 54759424   DEBUG: HAL: Device (/org/freedesktop/Hal/devices/usb_device_930_6533_0800725150623890_if0_scsi_host_0_scsi_device_lun0) Added
23:38:06 T:3066771248 M: 54759424   DEBUG: HAL: Device (/org/freedesktop/Hal/devices/usb_device_930_6533_0800725150623890_if0_scsi_host_0_scsi_device_lun0_scsi_generic) Added
23:38:06 T:3066771248 M: 54759424   DEBUG: HAL: Device (/org/freedesktop/Hal/devices/storage_serial_0930_USB_Flash_Memory_0800725150623890_0_0) Added
23:38:06 T:3066771248 M: 54759424   DEBUG: HAL: Device (/org/freedesktop/Hal/devices/storage_serial_0930_USB_Flash_Memory_0800725150623890_0_0) Property info.interfaces modified
23:38:06 T:3066771248 M: 54759424   DEBUG: HAL: Device (/org/freedesktop/Hal/devices/volume_uuid_AC9D_F912) Added
23:38:06 T:3066771248 M: 54759424  NOTICE: HAL: Trying to mount BDEKENS
23:38:06 T:3066771248 M: 54759424  NOTICE: HAL: Mounting /org/freedesktop/Hal/devices/volume_uuid_AC9D_F912 (UUID AC9D-F912 | FileSystem vfat | HotPlugged YES | Type 0 |Approved YES ) at BDEKENS
23:38:06 T:3066771248 M: 54759424    INFO: HAL: mounted BDEKENS on /media/BDEKENS
23:38:06 T:3066771248 M: 54759424   DEBUG: HAL: Added - removable disk | UUID AC9D-F912 | FileSystem vfat | Mounted on /media/BDEKENS | HotPlugged YES | Type 0 |Approved YES
23:38:06 T:3066771248 M: 54759424  NOTICE: LFS: Added - removable disk | BDEKENS
23:38:06 T:3066771248 M: 54759424   DEBUG: HAL: Device (/org/freedesktop/Hal/devices/volume_uuid_AC9D_F912) Property volume.mount_point modified
23:38:06 T:3066771248 M: 54759424   DEBUG: HAL: Update - removable disk | UUID AC9D-F912 | FileSystem vfat | Mounted on /media/BDEKENS | HotPlugged YES | Type 0 |Approved YES
23:38:06 T:3066771248 M: 54759424  NOTICE: LFS: Updated - removable disk | BDEKENS
23:38:06 T:3066771248 M: 54759424   DEBUG: HAL: Device (/org/freedesktop/Hal/devices/volume_uuid_AC9D_F912) Property volume.is_mounted_read_only modified
23:38:06 T:3066771248 M: 54759424   DEBUG: HAL: Update - removable disk | UUID AC9D-F912 | FileSystem vfat | Mounted on /media/BDEKENS | HotPlugged YES | Type 0 |Approved YES
23:38:06 T:3066771248 M: 54759424  NOTICE: LFS: Updated - removable disk | BDEKENS
23:38:06 T:3066771248 M: 54759424   DEBUG: HAL: Device (/org/freedesktop/Hal/devices/volume_uuid_AC9D_F912) Property volume.is_mounted modified
23:38:06 T:3066771248 M: 54759424   DEBUG: HAL: Update - removable disk | UUID AC9D-F912 | FileSystem vfat | Mounted on /media/BDEKENS | HotPlugged YES | Type 0 |Approved YES
23:38:06 T:3066771248 M: 54759424  NOTICE: LFS: Updated - removable disk | BDEKENS
<snip>

So unmounting seems to fail because the call to dbus was not correct (or maybe because the stick was already gone?)

This test was performed with the latest SVN version on a 1200MHz machine without proper OpenGL support (which is why I didn't try to unmount as the interface is rendered at 0.1 fps) running Ubuntu Intrepid with the latest updates.

On this machine pmount also failed and the new HAL method worked flawlessly (except for the unmounting part).

comment:4 Changed at 2009-01-03T15:47:47Z by Topfs2

try r16858 , I appended "lazy" as unmounting method, this should make it unmount despite the drive not being there.

It would be great if you could confirm it on intrepid as I have only tried it on hardy and it works there.

comment:5 Changed at 2009-01-14T21:49:23Z by Topfs2

  • Resolution set to Fixed in SVN
  • Status changed from accepted to closed

Im closing this one

Note: See TracTickets for help on using tickets.