Mounts external USB hard drive in a different point after resuming from sleep and from hibernate

Bug #230671 reported by Patricio
76
This bug affects 3 people
Affects Status Importance Assigned to Milestone
linux (Ubuntu)
Expired
Undecided
Unassigned

Bug Description

This bug may be related to 70486. Every time the system resumes from sleeping, it mounts my external HDD in a different location. It does it in disk-1 then disk-2, etc, etc. It keeps the previous mount file under /media but the location is empty. I right click and select unmount, but nothing happends.

HDD is "Maxtor Onetouch II" 200G
$lsusb
Bus 002 Device 004: ID 0d49:7110 Maxtor

This is how it looks after one resuming cycle:
patricio@patricio-desktop:/media$ ls
cdrom cdrom0 cdrom1 disk disk-1 floppy floppy0 KODAKCD MSWin
patricio@patricio-desktop:/media$ umount disk
/sbin/umount.hal: disk is not recognized by hal

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

I think I can do this after each reboot, so I can work around the problem:
patricio@patricio-desktop:~$ sudo umount /dev/sdd1
patricio@patricio-desktop:~$ sudo mount /dev/sdd1 /media/disk

Revision history for this message
ethanay (ethan-y-us) wrote :

confirm exact behavior

Dell XPS m1330
running 8.04 w/latest

Also occurs with my removable media (CD/DVD burner) drive

With media still connected/inserted, suspend computer
resume from computer
there should be two mount points: one is false, and the other is current

I believe it is related to bug 92091 where failure to unmount media before suspend causes these extra problems. data loss hasn't been a concern yet, so I would like to confirm whether the release of fix to 92091 also fixes this issue. i don't see any benefit in media remaining mounted through a suspend/resume cycle, as long as it can be properly detected again upon resume:

sleep called
media unmounted in preparation
enter sleep state
resume called
restore last state
detect and remount any external/removable media

Revision history for this message
Peng Deng (d6g) wrote :

I also confirm this behavior.

After resume from suspend, the old mount point (e.g. /media/disk) is somehow occupied and therefore the external disk has to be mounted to "disk_", if you do the suspend-resume cycle several times, there will be more "deserted" mount point, and the final one could be "disk______" (several underscore)

When I do "ls -l /media", it shows that the old mount point belongs to unknown user/group:

lrwxrwxrwx 1 root root 6 2007-09-23 00:19 cdrom -> cdrom0
drwxr-xr-x 2 root root 4096 2007-09-23 00:19 cdrom0
lrwxrwxrwx 1 root root 7 2007-09-23 00:19 floppy -> floppy0
drwxr-xr-x 2 root root 4096 2007-09-23 00:19 floppy0
d????????? ? ? ? ? ? disk
drwxrwxrwx 1 root root 12288 2008-06-06 22:55 disk_

The behavior is a bit similar to bug #101845, except that bug happened every time you booted up the system, not resume from suspend.

Revision history for this message
Ka-Hing Cheung (kahing) wrote :

similar to #223953 #228344 also. Can someone figure out which one should be used and close others as dups?

Revision history for this message
Fedi SAIDANE (fedi-saidane) wrote :

same problem here. nobody knows how to close the others?

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

This is difficult to fix in userspace, since you cannot just unmount every USB device right before sleep (applications may still have open files on it). Ideally, after resuming, the (re-)detected USB devices would have the same ordering as before. I. e. sda would stay sda, instead of becoming invalid, and sdb popping up for the device.

Revision history for this message
ceg (ceg) wrote : USB device persistence across suspend (was: Mounts external USB hard drive in a different point after resuming sleep)

An "echo 1 >/sys/bus/usb/devices/.../power/persist" could be done for usb-storage devices?

A pointer to kernel info:
http://www.mjmwired.net/kernel/Documentation/usb/persist.txt

and fix released bug #197166 "persist mode in hardy kernel"

Revision history for this message
ceg (ceg) wrote : Re: Mounts external USB hard drive in a different point after resuming sleep

The CONFIG_USB_PERSIST feature should probably be made to also check the serial numbers of the devices it has been enabled for.

Because it is quite likely that one user or tow friends may have two disks of same manufacturer and type.
(Especially in HotplugRaid laptop setups https://wiki.ubuntu.com/HotplugRaid)

The doc from 2007/05 linked above says "Serial numbers and other strings are not compared." But at least its the manufacturers fault if two or more devices really come with equal serial numbers.

Revision history for this message
Tim Gardner (timg-tpi) wrote :

Hardy/Intrepid are working as designed. See https://bugs.edge.launchpad.net/ubuntu/+source/linux/+bug/230671/comments/7 for instruction on how to enable this feature.

Changed in linux:
status: Confirmed → Invalid
Revision history for this message
Ka-Hing Cheung (kahing) wrote :

should that be made easier to discover?

Revision history for this message
André Pirard (a.pirard) wrote : Re: [Bug 230671] Re: Mounts external USB hard drive in a different point after resuming sleep

It would be nice to know exactly what in practice is working as designed.

Although I haven't seen it in a long time, I've met the problem Pen Deng
reports.
My e-mail folders are on a USB drive named D0.
A true folder D0, and even D0_ etc..., would be created in /media.
In that case, the mount point was the next D0_..._.
Result : Thunderbird would complain that it was already running and not
start.
Until the stray folders would be removed by hand.
Is this working as designed?
Not a very attractive feature for a Ubuntu newcomer, I'm afraid.

Thanks for all the good work and a splendid system.

Revision history for this message
ceg (ceg) wrote : Re: Mounts external USB hard drive in a different point after resuming sleep

I am sorry my comments have been misunderstandable and caused this bug to be set to invalid even if it may be valid.

My first comment was made to point to solution, that is possible with new kernels.
The second to point out that USB_PERSIST should better be patched to check USB IDs when somone fixes this bug by enabling USB_PERSIST for usb-storage devices in ubuntu.

Ubuntu 8.04 does NOT yet make use of USB_PERSIST with usb-storage devices.
Devices get mounted on different positions, breaking old mounts points that stay around.

If nobody has fixed this,
this bug is probably still valid.

If the design says to break usb mounts,
this bug may be a valid bug to fix the design.

Revision history for this message
ceg (ceg) wrote :

My comments did not describe an implemented design, but pointed to a possibility to fix this in ubuntu.

Changed in linux:
status: Invalid → Confirmed
Revision history for this message
Leann Ogasawara (leannogasawara) wrote :

The Ubuntu Kernel Team is planning to move to the 2.6.27 kernel for the upcoming Intrepid Ibex 8.10 release. As a result, the kernel team would appreciate it if you could please test this newer 2.6.27 Ubuntu kernel. There are one of two ways you should be able to test:

1) If you are comfortable installing packages on your own, the linux-image-2.6.27-* package is currently available for you to install and test.

--or--

2) The upcoming Alpha5 for Intrepid Ibex 8.10 will contain this newer 2.6.27 Ubuntu kernel. Alpha5 is set to be released Thursday Sept 4. Please watch http://www.ubuntu.com/testing for Alpha5 to be announced. You should then be able to test via a LiveCD.

Please let us know immediately if this newer 2.6.27 kernel resolves the bug reported here or if the issue remains. More importantly, please open a new bug report for each new bug/regression introduced by the 2.6.27 kernel and tag the bug report with 'linux-2.6.27'. Also, please specifically note if the issue does or does not appear in the 2.6.26 kernel. Thanks again, we really appreicate your help and feedback.

Revision history for this message
Patricio (patricio-stwing) wrote : Re: [Bug 230671] Re: Mounts external USB hard drive in a different point after resuming sleep

I think I could do this. You mean to use the deb command to install? I
have done that. would I have to change manually the boot up file (I
dont remember the name of that file but i have it written down) to call
the new kernel?
Thanks,
Patricio

Leann Ogasawara wrote:
> The Ubuntu Kernel Team is planning to move to the 2.6.27 kernel for the
> upcoming Intrepid Ibex 8.10 release. As a result, the kernel team would
> appreciate it if you could please test this newer 2.6.27 Ubuntu kernel.
> There are one of two ways you should be able to test:
>
> 1) If you are comfortable installing packages on your own, the linux-
> image-2.6.27-* package is currently available for you to install and
> test.
>
> --or--
>
> 2) The upcoming Alpha5 for Intrepid Ibex 8.10 will contain this newer
> 2.6.27 Ubuntu kernel. Alpha5 is set to be released Thursday Sept 4.
> Please watch http://www.ubuntu.com/testing for Alpha5 to be announced.
> You should then be able to test via a LiveCD.
>
> Please let us know immediately if this newer 2.6.27 kernel resolves the
> bug reported here or if the issue remains. More importantly, please
> open a new bug report for each new bug/regression introduced by the
> 2.6.27 kernel and tag the bug report with 'linux-2.6.27'. Also, please
> specifically note if the issue does or does not appear in the 2.6.26
> kernel. Thanks again, we really appreicate your help and feedback.
>
> ** Tags added: cft-2.6.27
>
>

Revision history for this message
Matt Zimmerman (mdz) wrote : Re: Mounts external USB hard drive in a different point after resuming sleep

I think the kernel part of this is probably fixed, as it's possible to use the USB persist option to get the desired behaviour (it mostly worked for me).

I think there's a separate issue in that the old mount points don't go away when USB persistence is not enabled, which is probably a HAL issue.

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

@Patricio
The file is /boot/grub/menu.lst
I think during the installation of a new kernel, the post install scripts executed by dpkg are updating grub and its configuration files. So you should have nothing to do. But I would still recommend you to back-up at least the /boot/grub/menu.lst before installing the new kernel. And then check after the installation that in your menu.lst you have the entries for the new and current kernel.
Also, it would be wise to make a back-up of the data on your hard drive (e.g. your /home) before changing the kernel. :-)

Revision history for this message
BirD (bird22) wrote :

Could someone please provide details on how to remove the useless drives that I now have on my desktop. I currently have multiple drives with underscores. Now that I know what caused the issue in the first place I have no problem avoiding the sleep function until this is fixed.

Sorry I am very new to Linux and this is a learning process for me.

Revision history for this message
ethanay (ethan-y-us) wrote :

try the following:

# sudo umount /media/[mount point]

for example
# sudo umount /media/disk1

that should unmount, which removes the drive icon from the desktop. it's then "safe" to disconnect the drive. however, the mount point folder in /media (e.g., "/media/disk") will still be there and unusable. so it is save to remove that directory by using

# sudo rmdir /media/disk[x]

where [x] is the folder if there are multiple media devices connected. if there was only one device connected, it should be just /media/disk

the next time you plug the media in, it should auto mount normally.

Revision history for this message
marco.pallotta (marco-pallotta) wrote :

In my system (Hardy Heron) i can see this issue when resuming from hibernate (almost 50% of resumes), not from sleep.

summary: - Mounts external USB hard drive in a different point after resuming sleep
+ Mounts external USB hard drive in a different point after resuming from
+ sleep and from hibernate
Revision history for this message
penalvch (penalvch) wrote :

Patricio, this bug was reported a while ago and there hasn't been any activity in it recently. We were wondering if this is still an issue? Can you try with the latest development release of Ubuntu? ISO CD images are available from http://cdimage.ubuntu.com/releases/ .

If it remains an issue, could you run the following command in the development release from a Terminal (Applications->Accessories->Terminal). It will automatically gather and attach updated debug information to this report.

apport-collect -p linux <replace-with-bug-number>

Also, if you could test the latest upstream kernel available that would be great. It will allow additional upstream developers to examine the issue. Refer to https://wiki.ubuntu.com/KernelMainlineBuilds . Once you've tested the upstream kernel, please remove the 'needs-upstream-testing' tag. This can be done by clicking on the yellow pencil icon next to the tag located at the bottom of the bug description and deleting the 'needs-upstream-testing' text.

If this bug is fixed in the mainline kernel, please add the following tag 'kernel-fixed-upstream'.

If the mainline kernel does not fix this bug, please add the tag: 'kernel-bug-exists-upstream'.

If you are unable to test the mainline kernel, for example it will not boot, please add the tag: 'kernel-unable-to-test-upstream'.

Please let us know your results. Thanks in advance.

Changed in linux (Ubuntu):
status: Confirmed → Incomplete
tags: added: needs-upstream-testing
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for linux (Ubuntu) because there has been no activity for 60 days.]

Changed in linux (Ubuntu):
status: Incomplete → Expired
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.