Comment 26 for bug 548546

Revision history for this message
Ilja Sekler (ilja-sekler-) wrote : Re: nautilus not removing device after unmount

I'm not quite sure about the steps prior to unmounting the device in respect to information you request. 'gvfs-mount -li' and 'udisks --dump' don't report a loop device after

1. mkdir /tmp/tmpmount
2. sudo mount -o loop ubuntu-10.04-desktop-i386.iso /tmp/tmpmount/
3. sudo umount /tmp/tmpmount

They do falsely report a loop device after a run of usb-creator though, while 'losetup -a' clearly indicated that there is none. This is the relevant part of 'udisks --dump' with usb-creator running:

========================================================================
Showing information for /org/freedesktop/UDisks/devices/loop0
  native-path: /sys/devices/virtual/block/loop0
  device: 7:0
  device-file: /dev/loop0
    presentation: /dev/loop0
  detected at: Di 14 Sep 2010 11:42:16 CEST
  system internal: 1
  removable: 0
  has media: 1 (detected at Di 14 Sep 2010 11:42:16 CEST)
    detects change: 0
    detection by polling: 0
    detection inhibitable: 0
    detection inhibited: 0
  is read only: 0
  is mounted: 1
  mount paths: /tmp/tmpLMNiRK
  mounted by uid: 0
  presentation hide: 0
  presentation nopolicy: 1
  presentation name:
  presentation icon:
  size: 733419520
  block size: 512
  job underway: no
  usage: filesystem
  type: iso9660
  version:
  uuid:
  label: Ubuntu 10.04 LTS i386
  loop:
    filename: /home/ilja/ubuntu-10.04-desktop-i386.iso
  drive:
    vendor: Linux
    model: Loop: ubuntu-10.04-desktop-i386.iso
    revision:
    serial:
    WWN:
    detachable: 0
    can spindown: 0
    rotational media: Yes, unknown rate
    write-cache: unknown
    ejectable: 0
    adapter: Unknown
    ports:
    similar devices:
    media:
      compat:
    interface: (unknown)
    if speed: (unknown)
    ATA SMART: not available

========================================================================

And this is after usb-creator finished its job and was closed:

========================================================================
Showing information for /org/freedesktop/UDisks/devices/loop0
  native-path: /sys/devices/virtual/block/loop0
  device: 7:0
  device-file: /dev/loop0
    presentation: /dev/loop0
  detected at: Di 14 Sep 2010 11:42:16 CEST
  system internal: 1
  removable: 0
  has media: 1 (detected at Di 14 Sep 2010 11:42:16 CEST)
    detects change: 0
    detection by polling: 0
    detection inhibitable: 0
    detection inhibited: 0
  is read only: 0
  is mounted: 0
  mount paths:
  mounted by uid: 0
  presentation hide: 0
  presentation nopolicy: 1
  presentation name:
  presentation icon:
  size: 733419520
  block size: 512
  job underway: no
  usage: filesystem
  type: iso9660
  version:
  uuid:
  label: Ubuntu 10.04 LTS i386
  loop:
    filename: /home/ilja/ubuntu-10.04-desktop-i386.iso
  drive:
    vendor: Linux
    model: Loop: ubuntu-10.04-desktop-i386.iso
    revision:
    serial:
    WWN:
    detachable: 0
    can spindown: 0
    rotational media: Yes, unknown rate
    write-cache: unknown
    ejectable: 0
    adapter: Unknown
    ports:
    similar devices:
    media:
      compat:
    interface: (unknown)
    if speed: (unknown)
    ATA SMART: not available

========================================================================

'gvfs-mount -li' reports:

Drive(2): 733 MB Datei
  Type: GProxyDrive (GProxyVolumeMonitorGdu)
  ids:
   unix-device: '/dev/loop0'
  themed icons: [drive-removable-media-file] [drive-removable-media] [drive-removable] [drive]
  is_media_removable=0
  has_media=1
  is_media_check_automatic=0
  can_poll_for_media=0
  can_eject=0
  can_start=0
  can_stop=0
  start_stop_type=unknown
  Volume(0): Ubuntu 10.04 LTS i386
    Type: GProxyVolume (GProxyVolumeMonitorGdu)
    ids:
     unix-device: '/dev/loop0'
     label: 'Ubuntu 10.04 LTS i386'
    themed icons: [drive-removable-media-file] [drive-removable-media] [drive-removable] [drive]
    can_mount=1
    can_eject=0
    should_automount=0

'losetup -a' shows that /dev/loop0 is not associated.

As there are two udev events after Step 2:

KERNEL[1284460875.988134] change /devices/virtual/block/loop0 (block)
UDEV [1284460876.002690] change /devices/virtual/block/loop0 (block)

but none after Step 3, I assumed that these issues could be related. Please note that on Maverick 'losetup -d' is correctly reflected in the output of 'udevadm monitor', just not unmount of loop mounts.