Unsafe device removal warning pops-up after resuming from suspend

Bug #92091 reported by Huygens
22
Affects Status Importance Assigned to Milestone
hal (Ubuntu)
Confirmed
Medium
Unassigned

Bug Description

It perhaps has some similarities with bug #73679 (https://bugs.launchpad.net/ubuntu/+source/gnome-volume-manager/+bug/73679) but is still quite different (at least from my point of view) that I decide to report it in a separate bug.

What happens:
I have a USB hard disk (NTFS and read only) that is most of the time plugged on my laptop.
My laptop is configured to go to sleep (suspend mode) after an hour. When I resume the session (and since the update of today or yesterday) I get a warning message that the external hard disk has not been properly removed. (see attached screenshot)

How to reproduce:
Plug a USB external storage, put the computer in suspend mode, resume from the suspend mode, log back to Gnome session and the bug is visible.

Impact:
Low: I am using the default ntfs driver in read only mode, so there is no data loss. Also after a while (10-20 sec once logged back in the session) the drive is detected again and mounted.

Tags: suspend
Revision history for this message
Huygens (huygens-25) wrote :

I forgot to mention that I'm using Ubuntu Feisty Fawn. And that this week-end this bug was not present (I mean there was no warning after resuming).

Revision history for this message
Brian Murray (brian-murray) wrote :

Thanks for taking the time to report this bug and helping to make Ubuntu better. I am a little bit unclear on whether or not you mean that this didn't used to happen or this is not happening any more. Please let us know. Thanks in advance.

Revision history for this message
Huygens (huygens-25) wrote :

It did not use to happen before, but now it does.

As I have seen some new updates, I can try to perform the test again. But I will do so later on this day. I will keep you post.
I will also try to use the older kernel (2.6.20-9) instead of the latest one.

Revision history for this message
Huygens (huygens-25) wrote :

OK here are the results of my new tests:

With all updates as of 2007/03/15 09h00 UTC, the bug is still present. I mean that after suspend and resume, I still have a warning message telling me that I had performed an unsafe removal of my external hard disk.

I have tried to reproduce it with the previous kernel (2.6.20-9) and I cannot reproduce the bug, so the problem is maybe not on HAL, but on the kernel itself. To clarify things, for this particular test, I have reboot the machine, at grub, I have selected previous kernel, starting every thing else as usual. I have then perform the test to suspend and resume the computer, and after the resume, I did not have the warning about unsafe removal.

N.B.: I did not try to perform a similar test yet with a USB memory stick...

Changed in hal:
assignee: brian-murray → nobody
status: Needs Info → Confirmed
Revision history for this message
Huygens (huygens-25) wrote :

The behaviour is still present with the newest kernel: 2.6.20-12

Revision history for this message
Huygens (huygens-25) wrote :

Just wanted to let you know that the bug is still present with Kernel 2.6.20-15

As I mentioned earlier, if I'm booting with kernel 2.6.20-9 I do not have the problem.

Revision history for this message
Anonimoes (s-kasper) wrote :

I'm experiencing quite the same bug on my desktop computer. I configured my pc to go to sleep after an idle time of 30min. If I start my computer again and the session is resumed I get the 'unsafe device removal' warning as well, of course only if my usb flash disk is plugged in. The same thing happens when I put my machine in hybernate manually.

I don't know if any data loss has occurred but it seems to me this has not happend, still this bug is a bit worrying of course...

NB: I use feisty fawn (7.04) and have installed all available updates.

Revision history for this message
Cycom (cycomos) wrote :

I am also in Feisty Fawn (7.04). I just got suspend working correctly in general, but this error message pops up for me, as well. In this case, I am not using a USB device, but a SD card plugged into my Ricoh card reader. I tried the fix suggested at http://ubuntuforums.org/showthread.php?p=2474560#post2474560, but this did not seem to correct the issue.

Revision history for this message
Anonimoes (s-kasper) wrote :

On top of the "unsafe device removal" warning I get another one now, I don't know if this is the symptom of the same issue but I thought I'd post it here with a screenshot. I'd be happy to report this as a seperate bug if it's really something different then the bug debated here.

See the screenshot for the messages.

Revision history for this message
Sam V. (sambo-the-ninja) wrote :

I'm getting the same problem though with a vfat USB2 Seagate drive in Feisty. It's also mounting in a new folder after suspend.

Changed in hal:
importance: Undecided → Medium
Revision history for this message
Jeanphe (jeanphe-gmail) wrote :

getting same error message on Feisty using 2 gig Kingston SD, though the same error happens every time I read from the SD card.
It will transfer a couple of files then act like I just yanked the SD out of the slot, returning:

[Error "I/O error" while copying]

Revision history for this message
Mark Grandi (markgrandi) wrote :

This happens to me as well. A 500 gb usb hard drive plugged in, every time i go into suspend or hibernate and come back and login (to unlock screen) i get the libnotify popups saying that the drives were not properly unmounted.

 A temporary fix for this is to of course unmount the usb drives before you go into suspend/hibernate, they remount after you come back. (at least for me)

Im running feisty, with the latest kernel in the repos.

Revision history for this message
AlesUbu123 (ales-maver) wrote :

Same happens here. After hibernation there is a report similar to one you can see on the screenshot by Huygens. Running Ubuntu 7.04 with all the updates and kernel 2.6.20-16. I have experienced no data loss after this so far.

Revision history for this message
Mark Grandi (markgrandi) wrote :

Just to add this still happens in Gutsy Tribe 5 (or 6 or whatever its on) fully updated, using kernel 2.6.22-12-generic

Revision history for this message
Jussi Nykanen (jussin) wrote :

Still happens in current Gutsy (I have all the latest updates installed). I was wondering if someone who knows better how the kernel / file system works, could try (or provide us others with a test case) if the device removal really is unsafe or if bug is in the "message showing rule". Idea is to write something on the disk that would not be written immediately completely (I've understood that this is how Linux often works) on it and then (right after write was done according to the user dialog) do a suspend + resume and see if everything actually got written on the disk as supposed (bug in message rule) or not (bug in suspending).

Revision history for this message
Jussi Nykanen (jussin) wrote :

My bet would be that the bug is in suspending (the device removal is not safe) cause everything works fine if - as already pointed out by Polygon - one unmounts the drive manually before suspending.

Revision history for this message
André Pirard (a.pirard) wrote :

Experiencing the same message on 7.10 (gutsy), FAT USB disk & CD-ROM.
The "Unsafe..." message didn't appear in xfce until I installed ubuntu-desktop on top of an Xubuntu installation (now appears in both gnome and xfce).
BTW, the message doesn't say which device is unsafe, which may be important if the user did nothing like in this case or in fortuitous device disconnection.
Laptop too : Toshiba Tecra 8000 : no ACPI (kernel cannot detect date, just before 2000 anyway, loop problem to be solved with acpi=force)
So, suspend via the software button (and probably automatic one too) does not work, but the power switch does suspend (and is amazingly fast, both off and on).
I imagine is I can only enjoy a hardware initiated suspend.

Impact : I'm reporting for everyone's sake, so the first thing I would say is that the common user shouldn't be taken into the habit of ignoring error messages.
I doubt I would loose data, since I guess it's only the habit of another system to write directory information a full load of seconds after the data was written (a joy to go on holidays with a camera memory card whose space has been freed but whose directory contains leftover files pointing to new shots at random).
Yet, this USB disk structure was messed up some day and I dunno why.

Also, launching a new File Explorer on each resume could be done without.

Hearty André (Hearty like every Heron should be !!!)

Revision history for this message
adpatter (adpatter) wrote :

Adding "umount /media/[NAME OF DRIVE]" to /etc/acpi/prepare.sh stopped the "unsafe device removal" from being displayed. Should the solution for this issue reside in the scripts?

Revision history for this message
Patricio (patricio-stwing) wrote :

Mine looks like this:

#!/bin/bash
for SCRIPT in /etc/acpi/suspend.d/*.sh; do
    if [ -x $SCRIPT ]; then
 . $SCRIPT
    fi
done

Should I add "umount /media/[NAME OF DRIVE]" after all that?

Is this the reason for bug 230671?

Thanks ( I am new)
Patricio

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.