Bug 6851 - Automatic mounting of storage media doesn't reuse the same mount points
Summary: Automatic mounting of storage media doesn't reuse the same mount points
Status: RESOLVED OLD
Alias: None
Product: Mageia
Classification: Unclassified
Component: RPM Packages (show other bugs)
Version: 2
Hardware: x86_64 Linux
Priority: Normal normal
Target Milestone: ---
Assignee: Mageia Bug Squad
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on: 6855 7011
Blocks:
  Show dependency treegraph
 
Reported: 2012-07-23 00:38 CEST by Sascha Schroeder
Modified: 2013-11-23 16:13 CET (History)
7 users (show)

See Also:
Source RPM:
CVE:
Status comment:


Attachments

Description Sascha Schroeder 2012-07-23 00:38:04 CEST
Description of problem:

Storage media, like USB-Sticks or external harddrives, are not automounted correctly. If you plug in a USB-device, for example, it is mounted correctly the first time. But after several reboots the mountpoint is changing. 

Example: Your USB-device is named "Stick". You plug it in, everything seems to work fine. But after several reboots, the Stick is mounted as Stick_, Stick__, Stick___ and so on, leaving the older directories empty and abandoned on your system inside /media; like orphans.


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Plug in USB devices.
2. Reboot several times.
3. Check the mount points under /media
4. You have to manually delete the older orphaned directories. Every time you plug in the device again, it gets a new dir-name with "_" at the end
Comment 1 Manuel Hiebel 2012-07-23 21:18:19 CEST
What desktop are you running ?

Source RPM: (none) => udisk

Comment 2 Sascha Schroeder 2012-07-23 21:36:38 CEST
Default KDE with Mageia 2: KDE 4.8.2
Comment 3 Manuel Hiebel 2012-07-24 16:26:17 CEST
maybe you can try the the updates of kde4.8.4 in updates_testing (we will have kde4.8.5 in updates) even I found nothing in their bugzilla about that)
Comment 4 Sascha Schroeder 2012-07-24 16:56:18 CEST
I would like to try that. What do I have to do to get the newest KDE-version? I already checked "Core Updates Testing", but there do not seem to be any updates...
Comment 5 Manuel Hiebel 2012-07-24 22:04:35 CEST
If they are not updated to that, then you can search in rpmdrake for the updates, or use urpmi --auto-updates or mark the testing repo as 'updates' one (for the two last you will receive all packages wainting for qa test)

also don't forget to disable it after that.

Source RPM: udisk => (none)

Comment 6 Sascha Schroeder 2012-07-25 11:35:44 CEST
I finally did the updates and got a new kernel, 3.3.8 and KDE 4.8.4. KDE 4.8.5 was not available for me.

So far it seems to work, but I get two failed-messages when the system boots:

1) Failed to start Load legacy module configuration                                                                                                                 [[1;31mFAILED[0m]
See 'systemctl status fedora-loadmodules.service' for details.  

and

2) Failed to start LSB: VirtualBox Additions Service                                                                                                                [[1;31mFAILED[0m]
See 'systemctl status vboxadd-timesync.service' for details. 

Is this crucial or should I ignore these?
Comment 7 Manuel Hiebel 2012-07-25 15:49:09 CEST
>KDE 4.8.5 was not available for me.
yes it will come only in something like 10 days 

For your messages I don't know, but if it's works :)

Depends on: (none) => 6855

Comment 8 Sascha Schroeder 2012-07-25 19:25:14 CEST
I'm still _testing_ this new setup, so I am not sure if it works the next week also. ;-)

I uninstalled "VirtualBox Additions" and got rid of both(!) boot-failures.

The only thing I get now which is irritating is:

udevd[167]: could not find module by name='wl'

Everything else _seems_ to run fine.

Any ideas?

Thanks in advance!
Comment 9 user7 2012-07-27 12:17:52 CEST
As for the virtualbox errors: IIRC, virtualbox requires the kernel-devel package (in the same version as the newest installed kernel). If you installed a 3.3.8 kernel, but not the 3.3.8 kernel-devel package, you will get errors.

CC: (none) => wassi

Comment 10 Sascha Schroeder 2012-07-27 19:15:30 CEST
kernel-desktop-devel is already installed. I got that package automatically with the new kernel version.

Unfortunately, after some days working with the new setup, especially with 3.3.8 and KDE 4.8.4, I have to say, the problem with automount and the underscore still exists. :-/

The system still mounts my USB-stick(s) every time I reboot with a new mountpoint and the underscore.
John Balcaen 2012-08-11 01:36:45 CEST

Depends on: (none) => 7011

Comment 11 Florian Hubold 2012-09-22 11:04:03 CEST
I'm also affected by this quite, this is quite a nuisance.
Weird thing is, even when you unmount the wrongly mounted partitions, and remove their mountpoints, you cannot remove the last active /media/mountpoint_ directory, even if it is empty, nothing mounted over it, it still says "device or ressource busy" for an umount -f and it can't also be rm -rf'ed :/

I don't think this is directly related to KDE, more to the systemd migration ...
Adding Colin as CC

CC: (none) => doktor5000, mageia

Comment 12 andré blais 2013-04-19 10:58:32 CEST
It works the same under gnome.
I don't remember what happened before systemd (and mga2)

It could be a minor advantage if, for example, 2 usb keys of the same brand/model and capacity are inserted at different times.
By not reassigning the same mount point, it reduces somewhat the chance of confusion as to which device is mounted.  Which I found useful in debugging a faulty system a few months back.
It is easy to do "fs /dev/sd*" to see the new mount point(s) used.

But if most prefer reusing mount points, fine with me.

BTW, neither behavior is necessarily "correct", so I'm reducing the severity level.

CC: (none) => andre999mga
Severity: major => minor

Comment 13 Florian Hubold 2013-04-20 10:37:30 CEST
(In reply to andré blais from comment #12)
> 
> BTW, neither behavior is necessarily "correct", so I'm reducing the severity
> level.

Why reduce the severity? It is a regression since Mageia 1 of a basic functionality, there is no easy workaround if you prefer to use the mount helper of the desktop environment(s) for removable storage and requires logging off and removing stale mount points (which where automatically created by the mount helper or whatever thing creates those underscores) manually.

This is definitely normal Severity.
Comment 14 Sascha Schroeder 2013-04-20 11:27:59 CEST
I agree with Florian.

It is a pain to _work_ with flash drives with this bug.

For some tasks it is _essential_ that they are mounted correctly. And it should not alter its state out of nothing. Even after a reboot.

Please take this serious, users will be upset and will switch the distribution because this behavior is simply annoying.
Raphaël Vinet 2013-04-20 11:38:55 CEST

CC: (none) => mailinglistsduraph

Comment 15 andré blais 2013-04-20 19:22:04 CEST
Note that after reboot, mount points ARE reused.
It is only on remounting before reboot that mount points are not reused.

Also note that when mount points are reused :
- assume that sda/ is always mounted with the boot disk
- if device A is mounted at sdb/, then unmounted
- then device B is mounted, it will be mounted at sdb/
- then device A is mounted while B is still mounted, it will be mounted at sdc/

So you have device A initially mounted at sdb/, and later at sdc/
And different devices using the same mount point.
Which is what used to happen.  (And I found somewhat confusing.)

With the current situation, different devices will never use the same mount point (at least not without rebooting)
Just do "ls /dev/sd*" to find the new mount point(s).

So how is reusing mount points necessarily better ?

I think it depends on personal preferences.  But I don't have a big problem if it reverts to previous functioning.
So maybe normal severity, but major severity is not appropriate.
OK, severity set to normal.

I changed the title to accurately reflect the issue.

Summary: Storage media not automounted correctly => Automatic mounting of storage media doesn't reuse the same mount points
Severity: minor => normal

Comment 16 Dave Hodgins 2013-04-21 01:44:17 CEST
From what I'm reading the the above comments, I'm pretty sure
the problems are being caused by not unmounting the usb
drives, before removing them.

For example if you open a usb stick with dolphin, before
you remove the drive, you can either select another directory,
such as home (so that the drive will not be busy), and then
right click on the name of the usb drive, and select "Safely
remove nameofdrive", or close dolphin, click on the device
manager icon and click on the small up arrow inside of a
circle, beside the name of the usb drive, (if you hold the
mouse over that arrow, the tooltip "Click to safely remove
this device" appears).

That will unmount the drive, and delete the dynamically
created mountpoint, so that it's available for reuse, when
the drive is re-mounted.

CC: (none) => davidwhodgins

Comment 17 andré blais 2013-04-21 02:36:02 CEST
Just tested, even with different usb keys.
You're right.
Explicitly unmounts nicely, releasing mount point.

With gnome you just have to click on the small up arrow beside the device name in the nautilus side bar.

So closing as invalid.

Status: NEW => RESOLVED
Resolution: (none) => INVALID

Comment 18 Florian Hubold 2013-04-21 14:24:34 CEST
Seems you're speaking about different problem, or you misunderstood the problem. The problem which is reported here is definitely valid, i can confirm it. Also mount points will no be reused. E.g. by mounting something in dolphin you get a "mountpoint" /media/STICK and then you shutdown (which should unmount the mounted drives, the same way as fixed fstab mounts are unmounted) and on next boot you replug that stick (or leave it plugged) and you will get /media/STICK_ and so on an on.

Weird thing is that once you get those "underscore mounts" you cannot cleanly remove the mount points, and you cannot cleanly unmount them when the system is running. E.g. lsof/fuser don't show any processes acessing them, but umount still says the device is busy. By using fuser -k on those mount points the X server gets killed.

Maybe the fix is just to make sure that manually mounted removable media (mounted by DE mount helpers) or auto-mounted removable media are cleanly unmounted during shutdown/reboot, as it has been before.

Status: RESOLVED => REOPENED
Resolution: INVALID => (none)

Comment 19 Colin Guthrie 2013-04-21 14:59:23 CEST
One option would simply be to mount /media as tmpfs and thus it's empty on boot. That was how things were configured for a while but people complained that manually configured mounts referring to mount paths in /media then failed. If you want to solve this on your systems and do not have any statically configured mount points, I suggest you just add a tmpfs /media mount to fstab and if that works then we document this in the errata.

As Mageia 3 is nearly out and (I presume) does not suffer from this problem (due to udisks now mounting inside /run/user/* tree rather than /media these days), then I suspect doing something more on mga2 would be too invasive.
Comment 20 Dave Hodgins 2013-04-21 18:00:51 CEST
(In reply to Florian Hubold from comment #18)
> Seems you're speaking about different problem, or you misunderstood the
> problem. The problem which is reported here is definitely valid, i can
> confirm it. Also mount points will no be reused. E.g. by mounting something
> in dolphin you get a "mountpoint" /media/STICK and then you shutdown (which
> should unmount the mounted drives, the same way as fixed fstab mounts are
> unmounted) and on next boot you replug that stick (or leave it plugged) and
> you will get /media/STICK_ and so on an on.

I cannot recreate the problem.  Either rebooting, or using poweroff,
and then the power switch to restart, when I boot up, /media is
empty.  This is with a usb stick mounted, and open in dolphin,
when I reboot or poweroff.
 
> Maybe the fix is just to make sure that manually mounted removable media
> (mounted by DE mount helpers) or auto-mounted removable media are cleanly
> unmounted during shutdown/reboot, as it has been before.

We'll need to identify what special case is causing them not to
be cleanly unmounted, as that is working here.
Comment 21 andré blais 2013-04-25 08:23:29 CEST
(In reply to Florian Hubold from comment #18)
> Seems you're speaking about different problem, or you misunderstood the
> problem. The problem which is reported here is definitely valid, i can
> confirm it. Also mount points will no be reused. E.g. by mounting something
> in dolphin you get a "mountpoint" /media/STICK and then you shutdown (which
> should unmount the mounted drives, the same way as fixed fstab mounts are
> unmounted) and on next boot you replug that stick (or leave it plugged) and
> you will get /media/STICK_ and so on an on.

Sorry, I probably should have said "worksforme".
Also, I missed the point about reboot.
I have never seen automount points persist like that after reboot.

> Weird thing is that once you get those "underscore mounts" you cannot
> cleanly remove the mount points, and you cannot cleanly unmount them when
> the system is running. E.g. lsof/fuser don't show any processes acessing
> them, but umount still says the device is busy. By using fuser -k on those
> mount points the X server gets killed.

Weird indeed.
In my system, the mount points of automounted devices are removed within a few seconds of device removal, whether explicitly or automatically unmounted.
(It didn't work like that when I first installed mga2.)

If I mount 2 devices with the same name (like "lexar" for usb keys, or the partition label),
The second mount will have a "1" appended to the name.
If I remove them without explicitly unmounting, then insert them in the opposite order, it is still the second inserted has a "1" appended to the name.
(It works the same for devices in fstab.)

Just a thought ... do you have an entry for these devices in fstab ?
If so, what happens if you remove (or comment out) the entry ?
William Douglas 2013-07-27 15:34:59 CEST

CC: (none) => wed080

Comment 22 Manuel Hiebel 2013-10-22 12:09:24 CEST
This message is a reminder that Mageia 2 is nearing its end of life.
Approximately one month from now Mageia will stop maintaining and issuing updates for Mageia 2. At that time this bug will be closed as WONTFIX (EOL) if it remains open with a Mageia 'version' of '2'.

Package Maintainer: If you wish for this bug to remain open because you plan to fix it in a currently maintained version, simply change the 'version' to a later Mageia version prior to Mageia 2's end of life.

Bug Reporter: Thank you for reporting this issue and we are sorry that we may not be able to fix it before Mageia 2 is end of life.  If you would still like to see this bug fixed and are able to reproduce it against a later version of Mageia, you are encouraged to click on "Version" and change it against that version of Mageia.

Although we aim to fix as many bugs as possible during every release's lifetime, sometimes those efforts are overtaken by events. Often a more recent Mageia release includes newer upstream software that fixes bugs or makes them obsolete.

-- 
The Mageia Bugsquad
Comment 23 Manuel Hiebel 2013-11-23 16:13:01 CET
Mageia 2 changed to end-of-life (EOL) status on ''22 November''. Mageia 2 is no
longer maintained, which means that it will not receive any further security or
bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of Mageia
please feel free to click on "Version" change it against that version of Mageia
and reopen this bug.

Thank you for reporting this bug and we are sorry it could not be fixed.

--
The Mageia Bugsquad

Status: REOPENED => RESOLVED
Resolution: (none) => OLD


Note You need to log in before you can comment on or make changes to this bug.