I have a USB memory stick that, for my own purposes, I do Not want to be automounted when it is inserted. I have the following entry in my /etc/fstab file:
But when I insert the device, after a few seconds the system mounts it anyway; then when I run the code that is supposed to use it I get an ‘already mounted’ message.
I have also tried
/dev/sdd1 /mnt/3 xfs noauto,users 0 2
with the same result.
I’m guessing that there is something in udev that is doing this. How can I tell it to leave this device alone?
Oh please, why do so many people forget to tell which version of openSUSE they use?
And I guess that this is about the mounting through he desktop (after a pop-up tellng the seated user a mass storage device is connected). Thus we of course want to know which desktop environment.
I share with you the idea is that it should not inform the desktop user that insertion when having a entry for it in /etc/fstab (at least when your identification, in his case the UUID is correct).
When you insert a USB you get an event that then is seen by the Desktop and it notifies you of the insertion . It does not mount it at that point until you do something with it ie open in a browser etc. So it is a Desktop function and you need to say what desktop.
I use KDE, and it does not automatically mount. But I seem to recall that both Gnome and XFCE will automatically mount when you insert.
Check your desktop configuration settings. There is probably an option for this that you can configure. Or, at least, tell us what desktop you are using and maybe someone can point you to the settings for that desktop.
Because sometimes it’s been a long day and I’m tired, so I forget. Sorry 'bout that.
I’m running KDE3 in OS 13.1 64K
And I guess that this is about the mounting through he desktop (after a pop-up tellng the seated user a mass storage device is connected). Thus we of course want to know which desktop environment.
Actually, I don’t care about the desktop; I want the system to ignore it until my program mounts it; thus the noauto option in the fstab entry.
I share with you the idea is that it should not inform the desktop user that insertion when having a entry for it in /etc/fstab (at least when your identification, in his case the UUID is correct).
I like that idea.
What does dmesg tell you?
[406515.297894] usb 2-1.2.7: new full-speed USB device number 12 using ehci-pci
[406515.383568] usb 2-1.2.7: New USB device found, idVendor=0204, idProduct=6025
[406515.383576] usb 2-1.2.7: New USB device strings: Mfr=0, Product=0, SerialNumber=0
[406515.384117] usb-storage 2-1.2.7:1.0: USB Mass Storage device detected
[406515.384296] scsi7 : usb-storage 2-1.2.7:1.0
[406516.386315] scsi 7:0:0:0: Direct-Access Flash Disk 2.00 PQ: 0 ANSI: 2
[406516.386669] sd 7:0:0:0: Attached scsi generic sg4 type 0
[406516.387793] sd 7:0:0:0: [sdd] 130276 512-byte logical blocks: (66.7 MB/63.6 MiB)
[406516.388741] sd 7:0:0:0: [sdd] Write Protect is off
[406516.388750] sd 7:0:0:0: [sdd] Mode Sense: 0b 00 00 08
[406516.389564] sd 7:0:0:0: [sdd] No Caching mode page found
[406516.389570] sd 7:0:0:0: [sdd] Assuming drive cache: write through
[406516.393850] sd 7:0:0:0: [sdd] No Caching mode page found
[406516.393858] sd 7:0:0:0: [sdd] Assuming drive cache: write through
[406516.399188] sdd: sdd1
[406516.402662] sd 7:0:0:0: [sdd] No Caching mode page found
[406516.402669] sd 7:0:0:0: [sdd] Assuming drive cache: write through
[406516.402675] sd 7:0:0:0: [sdd] Attached SCSI removable disk
[406522.281932] XFS (sdd1): Mounting Filesystem
BTW, Running OS 13.1 64K with KDE3.
Sounds reasonable, but exactly the opposite is happening; I get no desktop notification, and the device is mounted even though the fstab entry says noauto.
The noauto has nothing to do with it. From the man page of mount:
noauto
Can only be mounted explicitly (i.e., the -a option will not cause the filesystem to be mounted).
In other words, mount -a (and an equivalent of that is done at boot) will try to mount everyting that is in /etc/fstab, except where there is noauto. There is no effect whatsoever on other specific mounts of that /etc/fstab entry.
This is confusing, but talking about “auto” or “automatic” or similar with respect to mount is vague almost by definition. There are:
mount -a (and the noauto option);
automounter: a way to mount (often NFS) file systems when accessed (see man automount), configured in /etc/auto.master and other map files;
the way desktop users experience the fact that they get offered a connected mass storage device through a pop-up or in a file manager, which then, when accessed, is mounted for them. Because the end-user experiences this as “automatic” or “magic”, they tend to use words like automount, autofs, automatic for it, which is very confusing.
So please let us concentrate on your problem/question and not mix it up with other features.
When a mass storage device is connected (mostly using USB) to a running system with a KDE user in the seat (remember, there can be more KDE users local and/or remote, thus one is selected as being “in the seat”),the user gets a pop-up. When the user then accesses the file system, it will be mounted for him on a mount point created by the system.
When there is an /etc/fstab entry for the file system (thus not using /dev/sdxn, but either the LABEL=/UUID= features of /etc/fstab, or the /dev/disk/by-*/ device files), there will be no pop-up.
And again there will be no mount action when there is no access. And when there is a mount action, it will take place on the mount point configured in /etc/fstab and not on a system generated one.
Please everybody, when the above is not (quite) true or needs any comment, I welcome it when we can make this picture more complete.
Please the OP, explain what you exactly are trying to achieve (the background). What did you do to get what you want, what happened and what did you expect to happen (the three main points of a good problem description)?
AFAIK, KDE3 uses udisks-glue to automatically mount drives on connection. Try to uninstall that (you might have to tell YaST/zypper to ignore dependencies).
You could also try to change its config, see “man udisks-glue.conf”. (I have never used udisks-glue myself, and I’m not using KDE3 since 8 years ago either, when HAL was still around/used)
Okay, I have a USB memory stick that I do not want the system to mount when I plug it into a USB port. And this used to work fine until recently; now, whenever I plug it in, something in the system goes ahead and mounts it at the mount point defined in /etc/fstab; there is no pop-up or prompt before it happens.
When I run the routine that I have written to mount the device and access its files, I get the messages
mount: /dev/sdd1 is already mounted or /mnt/3 busy
/dev/sdd1 is already mounted on /mnt/3
When I tail -f /var/log/messages I see the following:
I assume I now have a much better idea about your problem then three days ago.
A few remarks, in no particular sequence.
You run KDE 3.5 (on openSUSE 13.1), not many will have that and thus trying to help you by re-creating your problem and/or looking inside configuration files (like freedesktop ones) might be difficult.
The entry in /etc/fstab is used, else the mounting would not take place at the mount point defined in that entry.
Both entries in /etc/fstab work the same, I would advice not to use the /dev/sdd1, because when your device next time uses /dev/fdc, you will have a (new) problem.
As said earlier, the noauto option is needed because else the system will want to mount the device at boot (and it most probably is not connected at that moment, resulting in boot problems). But noauto has no influence on the action described above.
There is no pop-up in the desktop because of the /etc/fstab entry: correct.
The log shows that the mount action is done through freedesktop.org. I have almost no knowledge about it (I hope other can help here). But again, the fact that this was (and maybee even still is) an area with a lot of changes, the KDE3 usage might make things difficult here. I do not think that HAL is still in the game though.
I agree with you that no desktop software whatsoever should act upon this device connection. Regardless if a user is logged in (in a GUI) or not.
Missing information: you did not explain if this happens right from the beginning after installation of openSUSE 31.1 or that it functioned as expected until recently (after all openSUSE 13.1 is already out for quite some time).
Do you have other DEs (KDE4, Gnome, …) installed and did you test what happens when you (using another user when you prefer) with that other DE. Did you check what happened when no user is logged in in the GUI (using the real console to see what happens)?
The above might not be of much direct help, but I hope it will trigger more input from others.
I logged into KDE3 and investigated a bit. And the culprit is indeed udisks-glue.
KDE3 starts it unconditionally in startkde3 though (this cannot be disabled), whith the hardcoded config file /opt/kde3/share/config/udisks-glue.conf.
To prevent disks from being automounted, you could edit that config file and change “automount = true” to “automount = false”.
Unfortunately that file is not marked as config file in the RPM package, so your change will get lost when kdebase3-workspace is reinstalled for whatever reason (I don’t really think there will be updates for KDE3 though… )
This is probably worth a bug report at http://bugzilla.opensuse.org/.
I see no other way to disable it (uninstalling udisks-glue, as I wrote already, will work as well though)
>> And I guess that this is about the mounting through he desktop (after a
>> pop-up tellng the seated user a mass storage device is connected). Thus
>> we of course want to know which desktop environment.
>>
> Actually, I don’t care about the desktop; I want the system to ignore it
> until my program mounts it; thus the noauto option in the fstab
> entry.
Well, but you see, this is a desktop feature, not a system feature.
> - The log shows that the mount action is done through freedesktop.org.
> I have almost no knowledge about it (I hope other can help here). But
> again, the fact that this was (and maybee even still is) an area with
> a lot of changes, the KDE3 usage might make things difficult here. I
> do not think that HAL is still in the game though.
No, AFAIK, HAL is out of the picture in the currently released
openSUSE’s KDE3
You should still be able to mount them manually, in particular if you enable “udisks2” in KDE3’s settings.
I had never heard of udisks2, but after hunting around in the K Control Center I found it, and it was already enabled.
Yet the device is still being mounted automagically.
Mounting or unmounting the device manually, once it has been plugged in, has never been a problem. I just want it to happen only when I issue the command.