cannot remount ejected devices

Bug #19126 reported by Julien Olivier
This bug report is a duplicate of:  Bug #11517: Can not eject removable devices. Edit Remove
20
Affects Status Importance Assigned to Milestone
hotplug (Ubuntu)
Invalid
Medium
Martin Pitt

Bug Description

I tested with the newest gnome-volume-manager (1.3.2-0ubuntu3), and here is what
I get:

 1) I plug my disk before starting my computer
 2) Once my GNOME session is opened, the disk's icon appears in the mount
applet, but is the disk is unmounted
 3) I click on the icon and choose "mount". This causes the error to pop up
(/dev/sda1 not in fstab)
 4) I un-plug the disk, and re-plug it. It's mounted automatically, and its
content is shown in Nautilus
 5) I click on the disk's icon and choose "unmount". This causes an error to
appear (eject: unable to eject, last error: invalid argument), but the disk is
correctly unmounted
 6) back to 3)

Note 1: I tried using mounting, unmounting using the disk's icon in the
"computer" place, and the behaviour is exactly the same.
Note 2: pmount /dev/sda1 and umount /dv/sda1 from command line work flawlessly.

Revision history for this message
Martin Pitt (pitti) wrote :

*** Bug 19544 has been marked as a duplicate of this bug. ***

Revision history for this message
Patrice Vetsel (vetsel-patrice) wrote :

please upgrade to udev (0.060-1ubuntu6) breezy; urgency=low
and test is the bug is resolved

Revision history for this message
Martin Pitt (pitti) wrote :

(In reply to comment #2)
> please upgrade to udev (0.060-1ubuntu6) breezy; urgency=low
> and test is the bug is resolved

According to the initial description, automounting worked.

Revision history for this message
Julien Olivier (julo) wrote :

With the new udev version, I get different results with my 2 USB media:
 - with my USB key, I can now unmount it without getting the error message, but
it's still not auto-mounted if plugged before GNOME starts, and it still can't
be mounted after being un-mounted.
 - with my USB hard drive, it doesn't appear when plugged. However, an entry in
/dev is created and I can mount it using pmount /dev/sda1. Then, an icon appears
in the mount applet and the computer place. Clicking on it from the mount applet
crashes it, but clicking on it from Nautilus works well. Then, if I try to
unmount it (from Nautilus), I get an error message (eject: impossible to open
the file '/dev/sda1'), but it's successfully unmounted.

Revision history for this message
Martin Pitt (pitti) wrote :

(In reply to comment #4)
> With the new udev version, I get different results with my 2 USB media:
> - with my USB key, I can now unmount it without getting the error message, but
> it's still not auto-mounted if plugged before GNOME starts

That bug is probably still present, I will look at it soon.

>, and it still can't be mounted after being un-mounted.

This is fixed in:

 gnome-vfs2 (2.11.90-0ubuntu3) breezy; urgency=low
 .
   * Remove debian/patches/15_always_eject.patch:
     - This hack was replaced by a policy FDI in hal.
   * Add debian/patches/20_hal_eject.patch:
     - Properly initialize GnomeVFSDrive's must_eject_at_unmount field with
       libhal_drive_requires_eject().
   * debian/rules: Configure with --with-hal-mount=/usr/bin/pmount and
     --with-hal-umount=/usr/bin/pumount to make remounting work again.
     (part of #12870)

> - with my USB hard drive, it doesn't appear when plugged. However, an entry in
> /dev is created and I can mount it using pmount /dev/sda1.

Ok, that's the issue from above (not automounted at session start)

> Then, an icon appears
> in the mount applet and the computer place. Clicking on it from the mount applet
> crashes it,

Will try to reproduce this.

> but clicking on it from Nautilus works well. Then, if I try to
> unmount it (from Nautilus), I get an error message (eject: impossible to open
> the file '/dev/sda1'), but it's successfully unmounted.

That's #5049. It works fine on amd64, but I think it happens on i386.

So the original bug title is solved now, I devote this bug to the other issues
here. However, I don't think that drives should actually be automounted at
startup; clicking on the icons should work probably, but mounting everything
"just for the case" is too much and often unnecessary. I'll look into it.

Revision history for this message
Martin Pitt (pitti) wrote :

gnome-volume-manager (1.3.2-0ubuntu10) breezy; urgency=low

  * Add debian/patches/09_fix_mount_all.patch: Fix logic error in mount_all()
    that broke mounting at session start. (Ubuntu #12870)

 -- Martin Pitt <email address hidden> Tue, 23 Aug 2005 18:55:05 +0200

OK, it seems that automounting volumes is still intended by upstream, so I leave
it at this. FWIW, users can always change it in gnome-volume-properties.

Revision history for this message
Martin Pitt (pitti) wrote :

> > Then, an icon appears
> > in the mount applet and the computer place. Clicking on it from the mount applet
> > crashes it,
>
> Will try to reproduce this.

This is the last unfixed bit in this bug now. It's certainly a corner case, but
should be fixed.

Revision history for this message
Martin Pitt (pitti) wrote :

(In reply to comment #7)
> > > Then, an icon appears
> > > in the mount applet and the computer place. Clicking on it from the mount
applet
> > > crashes it,
> >
> > Will try to reproduce this.
>
> This is the last unfixed bit in this bug now. It's certainly a corner case, but
> should be fixed.

Hm, I tried to get this crash with the latest g-v-m, hal, and gnome-vfs2
packages. I saw it before, but now I can't reproduce it any more. So I guess
this is now fixed as well.

Please cry out loudly if you can still reproduce it, then I reopen this bug.

Thanks!

Martin

Revision history for this message
Julien Olivier (julo) wrote :

I upgraded all the required packages, and still get a few issues:

1) the USB hard drive:
  - It still needs to be mounted "by hand" using pmount. When I insert it, no
icon appears in computer:// or in the disk-mount-applet. However, /dev/sda1 is
created. pmount /dev/sda1 works, and make the icon appear as "sda1". unmounting
it via "pumount" or through Nautilus or the applet makes the icon disappear, but
/dev/sda1 remains.

2) the USB key:
 - Still not mounted on boot.
 - Whenever I unmount it (using Nautilus or the applet), /dev/sda1 is deleted,
but the icon remains (but unmounted). Consequently, clicking on the icon to
re-mount it doesn't work (because /dev/sda1 doesn't exist). I have to unplug /
replug it to make /dev/sda1 appear again.

Revision history for this message
Julien Olivier (julo) wrote :

Oh, and I don't get the crash or the error message on unmount anymore. That's
for the good news :)

Revision history for this message
Martin Pitt (pitti) wrote :

(In reply to comment #9)
> I upgraded all the required packages, and still get a few issues:
>
> 1) the USB hard drive:
> - It still needs to be mounted "by hand" using pmount. When I insert it, no
> icon appears in computer:// or in the disk-mount-applet. However, /dev/sda1 is
> created. pmount /dev/sda1 works, and make the icon appear as "sda1". unmounting
> it via "pumount" or through Nautilus or the applet makes the icon disappear, but
> /dev/sda1 remains.

Ok, please do the debugging exercise on
https://wiki.ubuntu.com/DebuggingRemovableDevices.

> 2) the USB key:
> - Still not mounted on boot.

Same procedure as above, please. "on boot" behaves the same as stopping and
restarting gnome-volume-manager, btw.

> - Whenever I unmount it (using Nautilus or the applet), /dev/sda1 is deleted,
> but the icon remains (but unmounted).

Hmm, I remember having seen that. However, on current amd64/breezy the device
does not disappear and I can remount it without problems. I will install an i386
breezy and check this.

Revision history for this message
Julien Olivier (julo) wrote :

Created an attachment (id=3429)
gvm.log

Revision history for this message
Julien Olivier (julo) wrote :

Created an attachment (id=3430)
lshal.txt

Revision history for this message
Julien Olivier (julo) wrote :

Created an attachment (id=3431)
devices.txt

Revision history for this message
Julien Olivier (julo) wrote :

Created an attachment (id=3432)
dmesg.txt

Revision history for this message
Julien Olivier (julo) wrote :

Here's the output of 'id':julien@amilo ~ $ id
uid=1000(julien) gid=1000(julien)
groupes=4(adm),20(dialout),24(cdrom),25(floppy),29(audio),44(video),103(plugdev),107(lpadmin),1000(julien)

Revision history for this message
Julien Olivier (julo) wrote :

A few comments:

after latest upgrades, both the USB key and the USB hard drive are successfully
mounted on boot, and upon insertion after the boot.

The remaining problems are:
 - Error message "impossible to eject" on unmounting the USB hard drive. But
unmounting actually works.
 - /dev/sdaX deleted after unmounting the USB key, making it impossible to
re-mount without unplugging/replugging it.

The attached files are for the USB hard drive. If you need the same thing for
the USB key, just tell me.

Revision history for this message
Martin Pitt (pitti) wrote :

(In reply to comment #17)
> A few comments:
>
> after latest upgrades, both the USB key and the USB hard drive are successfully
> mounted on boot, and upon insertion after the boot.

Fine, thanks for checking again.

> The remaining problems are:
> - Error message "impossible to eject" on unmounting the USB hard drive. But
> unmounting actually works.

That's #5049 already.

> - /dev/sdaX deleted after unmounting the USB key, making it impossible to
> re-mount without unplugging/replugging it.

I believe that's a consequence of the previous bug (eject fails), but I will
look into it and devote this bug to this issue now.

Revision history for this message
Julien Olivier (julo) wrote :

>> The remaining problems are:
>> - Error message "impossible to eject" on unmounting the USB hard drive. But
>> unmounting actually works.

> That's #5049 already.

OK, sorry about that.

>> - /dev/sdaX deleted after unmounting the USB key, making it impossible to
>> re-mount without unplugging/replugging it.

> I believe that's a consequence of the previous bug (eject fails), but I will
> look into it and devote this bug to this issue now.

Well, just to make sure everything is clear: this bug (/dev/sdaX removed)
happens after unmounting the USB key, whereas the "eject fails" bug happens
after unmounting the USB hard drive.

After unmounting the USB key, I don't get the "eject fails" message anymore, and
after unmounting the USB hard drive, the /dev/sdaX file isn't removed.

Revision history for this message
Martin Pitt (pitti) wrote :

(In reply to comment #19)
> > That's #5049 already.
>
> OK, sorry about that.

No need to be sorry, I just want to track which bug has which number. :-)

> Well, just to make sure everything is clear: this bug (/dev/sdaX removed)
> happens after unmounting the USB key, whereas the "eject fails" bug happens
> after unmounting the USB hard drive.

So you still get the eject bug even on the most recent Breezy? It started to
work again for me again recently. If you still encounter this, can you please
followup to #5049? Please do

  strace eject -v /dev/sdaX 2> eject-strace.txt

copy the output of that command to the bug report and attach eject-strace.txt to
#5049.

For the "device removed" part, can you please do

  * insert USB key
  * have it mounted (automatically)
  * lsmod > mods-before.txt
  * eject it (but leave it attached)
  * lsmod > mods-after.txt

and attach the two txt files here?

Revision history for this message
Julien Olivier (julo) wrote :

Created an attachment (id=3510)
modules before

Revision history for this message
Julien Olivier (julo) wrote :

Created an attachment (id=3511)
modules after

Revision history for this message
Julien Olivier (julo) wrote :

julien@lifebook ~ $ diff mods-before.txt mods-after.txt
4,6c4,6
< nls_utf8 2176 1
< nls_cp437 5888 1
< vfat 12288 1
---
> nls_utf8 2176 0
> nls_cp437 5888 0
> vfat 12288 0
90c90
< sd_mod 17424 3
---
> sd_mod 17424 1
103c103
< usb_storage 64704 2
---
> usb_storage 64704 1

Revision history for this message
Julien Olivier (julo) wrote :

> So you still get the eject bug even on the most recent Breezy? It started to
> work again for me again recently. If you still encounter this, can you please
> followup to #5049? Please do

> strace eject -v /dev/sdaX 2> eject-strace.txt

> copy the output of that command to the bug report and attach eject-strace.txt to
> #5049.

Yes, I still have the bug, but only with the USB hard drive. I attached the
eject-strace.txt to bug #11517.

Revision history for this message
Ernst Persson (ernstp) wrote :

Ah, with my digital camera the missing /dev/sdb1 also happens.
It mounts fine, and produces
/dev/sdb /dev/sdb1
Umounting works fine, no error-messages, but after unmounting there's only
/dev/sdb

Revision history for this message
Martin Pitt (pitti) wrote :

Thanks for the strace. The modules look fine, so I think the failed eject makes
the device invalid somehow. In any case I always saw these bugs occurring
together, so I close it as a duplicate now.

This bug has been marked as a duplicate of bug 11517.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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