Thanks to everybody contributing to increae our meagre knowledge in this subject. I hope we all will benefit from it.
After reading all the above, I did some experimenting.
When I am loged in (my uid=500) and I connect an USB stick, I find in /var/log/messages:
May 3 19:35:14 boven kernel: usb 2-7: new high speed USB device using ehci_hcd and address 7
May 3 19:35:14 boven kernel: usb 2-7: new device found, idVendor=0ea0, idProduct=1001
May 3 19:35:14 boven kernel: usb 2-7: new device strings: Mfr=1, Product=2, SerialNumber=0
May 3 19:35:14 boven kernel: usb 2-7: Product: Flash Disk
May 3 19:35:14 boven kernel: usb 2-7: Manufacturer: USB
May 3 19:35:14 boven kernel: usb 2-7: configuration #1 chosen from 1 choice
May 3 19:35:14 boven kernel: scsi5 : SCSI emulation for USB Mass Storage devices
May 3 19:35:14 boven kernel: usb-storage: device found at 7
May 3 19:35:14 boven kernel: usb-storage: waiting for device to settle before scanning
May 3 19:35:15 boven kernel: scsi 5:0:0:0: Direct-Access NOR Flash Disk 2.00 PQ: 0 ANSI: 2
May 3 19:35:16 boven kernel: ready
May 3 19:35:16 boven kernel: sd 5:0:0:0: [sdf] 119574 512-byte hardware sectors (61 MB)
May 3 19:35:16 boven kernel: sd 5:0:0:0: [sdf] Write Protect is off
May 3 19:35:16 boven kernel: sd 5:0:0:0: [sdf] Mode Sense: 03 00 00 00
May 3 19:35:16 boven kernel: sd 5:0:0:0: [sdf] Assuming drive cache: write through
May 3 19:35:16 boven kernel: sd 5:0:0:0: [sdf] 119574 512-byte hardware sectors (61 MB)
May 3 19:35:16 boven kernel: sd 5:0:0:0: [sdf] Write Protect is off
May 3 19:35:16 boven kernel: sd 5:0:0:0: [sdf] Mode Sense: 03 00 00 00
May 3 19:35:16 boven kernel: sd 5:0:0:0: [sdf] Assuming drive cache: write through
May 3 19:35:16 boven kernel: sdf: sdf1
May 3 19:35:16 boven kernel: sd 5:0:0:0: [sdf] Attached SCSI removable disk
May 3 19:35:16 boven kernel: sd 5:0:0:0: Attached scsi generic sg6 type 0
May 3 19:35:16 boven kernel: usb-storage: device scan complete
May 3 19:35:17 boven hald: mounted /dev/sdf1 on behalf of uid 500
and I (uid 500 has username henk) am the owner of the mounted contents:
boven:/var/log # l /media/
total 40
drwxr-xr-x 3 root root 4096 May 3 19:58 ./
drwxr-xr-x 22 root root 4096 May 3 18:22 ../
-rw-r--r-- 1 root root 89 May 3 19:58 .hal-mtab
-rw------- 1 root root 0 May 3 19:35 .hal-mtab-lock
drwxr-xr-x 7 henk root 27136 Jan 1 1970 disk/
boven:/var/log #
I also of course get a KDE window asking me what I want to do with the device.
I unmounted the device and removed it.
As next step I loged in on a second logical screen with another username/uid (beheerbv/505). I connected the device. Now **both **sessions get the KDE window asking what to do. In /var/log/messages it says (only the last line is of importance here):
May 3 19:58:13 boven hald: mounted /dev/sdf1 on behalf of uid 505
And an ls of /media shows that now beheerbv is the owner of the files.
Now this is a VFAT fs so may be the protection is not so good as on an fs designed for Unix/Linux, but when there are more users loged in it seems to be to the whimsy of the system who will be the owner!
Next step. User beheerbv/505 loged out of the GUI. See /var/log/messages:
May 3 19:49:58 boven hald: unmounted /dev/sdf1 from '/media/disk' on behalf of uid 505
In fact when I looked it was either still mounted, or again remounted, but now the owner was root.
I unmounted and disconnected.
Next step. Also henk/500 loged out. With Cntrl-Alt-F1 I wet to the real console and loged in as root. I connected the device. It was not mounted. I loged in again in the GUI with henk. This was immideatly followed by the mounting of the device on behalf of user 500.
@deano_ferrari. I do not have /.kde/share/config/mediamananagerrc at all.
@brunomcl. I found mentioning of these files on the net including the fact that it could lock things at the wrong moment.
@cjcox. The labels are attached to the partitions, not to the device. found the same as syampillai: when there is label, that is used, else you get disk, disk-1, etc.
Now my first conclusions:
- As was allready said, it is is rather clear waht udev does (and my research is not into udev behaviour, but links with HAL are important though).
- HAL could mount by itself, but I can not find anything about this in its configs. And the experiments also seem to show that it is not HAL that mounts, but the DE (of course the signal comes from HAL). The experiments also seem to show that in this mount behaviour the fact that Linux is a multi-user OS is more or less forgotten
So far from having a direct answer to my question, to me it is a very interesting subject
I wait for more reactions with eagerness.