Bug 182374 - USB storage devices with ext3 fs get automatically mounted but desktop not notified
USB storage devices with ext3 fs get automatically mounted but desktop not no...
Status: CLOSED WORKSFORME
Product: Fedora
Classification: Fedora
Component: kdelibs (Show other bugs)
5
All Linux
medium Severity medium
: ---
: ---
Assigned To: Ngo Than
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2006-02-21 21:22 EST by Stefan Becker
Modified: 2007-11-30 17:11 EST (History)
0 users

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-04-29 00:13:44 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Stefan Becker 2006-02-21 21:22:09 EST
Description of problem:

When USB storage devices are attached they are automatically mounted. KDE pops
up the "device inserted" requestor but of course choosing "Open Window" fails,
because the device is already mounted. Additionally the icons on the desktop are
shown as "unmounted" so when you double-click them it tries to mount which again
fails.

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

hal-0.5.7-0.cvs20060213.1
dbus-0.60-7.2
kernel-2.6.15-1.1955_FC5

How reproducible: Always

Steps to Reproduce:
1. Attach USB storage device with ext3 fs
2. mount
3. umount /media/*
4. remove USB device
  
Actual results:

mount shows devices are already mounted.
KDE opens "device attached" action window.
Device icons appear on KDE desktop in "unmounted" state.
After removal the /media directories don't disappear.

Expected results:

Devices should not automatically be mounted.
Removal should also remove /media directories.

Additional info:

If the USB storage device is formatted with the FAT fs then it is still
automatically mounted but at least the desktop show it correctly as "mounted"
and after removal the entry in /media disappears.
Comment 1 Ngo Than 2006-02-22 11:48:37 EST
I cannot reproduce this problem with latest KDE in rawhide. The desktop shows
the device icons correctly as "mounted" and the kded daemon opens the windows
without any problem!

The kded daemon does not mount automatically the devices. It seems that the hal
backend does it. So it's a bug (or feature?) in hald daemon, but not in KDE.
Comment 2 John (J5) Palmieri 2006-02-22 11:55:47 EST
We do not auto mount devices.  gnome-volume-manager does that in gnome.  It
shouldn't be running if you are running KDE.
Comment 3 Stefan Becker 2006-02-22 12:12:31 EST
The devices seem to be mounted by root and not with user rights, ie. user can't
unmount them. So I doubt that they are mounted by a KDE process.

Is there anything I can monitor to see which process does the mount?
Comment 4 Stefan Becker 2006-02-23 03:21:35 EST
I now disabled all KDE components which have something to do with media
plugging/mount:

    KDED Media Manager
    Media Notifier Daemon (kded)
    kwikdisk

-> the devices don't get mounted anymore BUT also no directories are created in
/media.

If I start "KDED Media Manager" again the problem reappears.

Looking at the audit.log shows that the UID for the mount command is mine and
not root.

Looking at lshal output you see:

udi = '/org/freedesktop/Hal/devices/volume_uuid_a07092a0_d89c_467a_81c4_c247191d
9681'
  info.hal_mount.mounted_by_uid = 500  (0x1f4)  (int)
  info.hal_mount.created_mount_point = '/media/Backup'  (string)
...
  volume.is_partition = true  (bool)
  volume.is_disc = false  (bool)
  volume.is_mounted = false  (bool)
  volume.mount_point = ''  (string)
  volume.label = 'Backup'  (string)
...

So HAL thinks it's not mounted (that would explain why the desktop shows them as
unmounted) but still it has been mounted by UID=500 (that's me). If the KDED
Media Manager is not running the first two lines (.hal_mount.) don't exist.

I couldn't find any configuration options for "KDED Media Manager" that controls
the automatic mounting.

I have the feeling that something is missing in the KDED Media Manager. Maybe it
is not updating the information to HAL correctly?

Please tell me if you need more complete logs...
Comment 5 Stefan Becker 2006-02-24 01:19:27 EST
I just deleted my KDE configuration and started with a fresh one for KDE 3.5.1.
The problem still exists, so it is not a KDE setting which might have been wrong
while migrating through different KDE 3.x versions in FC4.
Comment 6 Stefan Becker 2006-03-11 03:54:56 EST
OK, now I tried with GNOME: same problems with USB storage devices which have
ext3 fs. USB sticks with vfat only get automatically mounted if you have
selected the option in the preferences.

BTW: After the ext3 volumes are mounted, they don't show up on KDE/GNOME
desktop. So the only chance to unmount them is for root to use "umount
/media/*". I noticed that this changes the security context of /etc/mtab so that
future updates of /etc/mtab fail and thus "mount" doesn't work correctly
anymore. Only /proc/mounts shows all mounts correctly. You can restore normal
behavior with "restorecon -v /etc/mtab", but you have to do that after each
"umount /media/*".

If you only hot-plug USB devices with vfat fs, the security context of /etc/mtab
doesn't change and therefore "mount" works correctly all the time.

Can you please retest with an USB device formatted with ext3 fs?
Comment 7 Stefan Becker 2006-03-11 13:15:31 EST
Tested also with CD & DVD: they behave like vfat formatted storage devices, ie.
they get mounted automatically but their status is shown correctly on the desktop.

So it seems that only ext3 (or maybe other than vfat/is9660/udf) formatted
removable storage devices don't work correctly.
Comment 8 Stefan Becker 2006-03-15 21:24:38 EST
I found out that the Media Manager stores the user preferences in

  .kde/share/config/mediamanagerrc

If you change the properties of a storage media device it stores the changes
there indexed by the HAL identifier, e.g.

[/org/freedesktop/Hal/devices/volume_label_EOS_DIGITAL]
atime=false
automount=false
mountpoint=/media/EOS_DIGITAL
quiet=false
ro=false
shortname=lower
sync=false
uid=true
utf8=true

[/org/freedesktop/Hal/devices/volume_uuid_357f7cd6_e340_47e2_9a1e_0393ada49c8b]
...

Comparison of the Properties... dialog of vfat/iso9660 vs. ext3 shows that the
KDE Media Manager doesn't offer any filesystem specific options for ext3, ie.
"Mount as user". Maybe it needs to be recompiled with ext3 support? Or maybe
it's totally missing from the code, ie. this would be an upstream bug?
Comment 9 Stefan Becker 2006-04-29 00:13:44 EDT
It works OK now with the latest updates for FC5:

$ rpm -q kdebase dbus hal kernel
kdebase-3.5.2-0.2.fc5
dbus-0.61-3
hal-0.5.7-3
kernel-2.6.16-1.2096_FC5

Maybe it was a bug in KDE 3.5.1...

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