Impossible to mount a usb stick as non-root user

Although I can perfectly mount any usb device (stick or disc) as being root, as a user I am not allowed to perform any such action!

I have modified the corresponding fstab entry to look like:


usbfs                /proc/bus/usb        usbfs      noauto,user                0 0

and I have also made sure that the user is a member of the disk group, but without any luck.

Can somebody provide me with any kind of directions towards resolving this issue?

My system is OpenSuSE 11.2 (with KDE 4.4, but the problem is the same regardless I am attempting to mount the usb device via the GUI or through the text (c/k)onsole).

I would like to thank you in advance for your concern,

Nassos

This looks monsense to me.
The first field should contains a block special device file (something like /dev/sd…) and not the name of a file system type.
The second field should contain the place where to mount it. This can be anywhere in your directory tree, but NOT inside /proc. Often (for USB devoces) people use /media/some-name, but you couls choose anthoer place).
The other fields seem to be OK.

But normaly one does not have an fstab entry at all, and leave it to the system (HAL/DeviceKit) and the DE (KDE/Gnome) to handle this when thh user puts in the device. Does that not work for you?

Of course you were quite right about the dummy fstab entry! Silly me not checking it more thoroughly before reporting it.

However, although I removed the respective entry, I am still unable to resolve the issue:

That is, when I plug in a usb stick, KDE 4.4 picks it up, but when I explicitly request to browse the stick’s content using KDE 4.4’s device notifier, (via Dolphin), I get the dolphin window pointing to the user’s home directory (instead of the usb stick’s one).

Then, when I click the icon on the right of the devices entry (from within KDE’s device notifier) to request to access the device from other applications (literally, this action should most probably attempt to mount the device), I get the error: “Could not mount the disk”.

I should mention herein, that before upgrading from KDE 4.3.x to KDE 4.4, I could (un)mount the corresponding usb device, using KDE’s device notifier, but I was always asked for root’s password!

Thus, I am afraid, that KDE 4.4’s device notifier, fails to ignite the “request root’s password, to attempt and (un)mount the device” procedure.

Therefore, although I should aim for using a device notifier version for KDE 4.4 able to successfully request root’s password, I equally believe, that one could get around with managing to (un)mount a usb device, without the need for root access rights level. In other words, succeeding in allowing any user of the system mount a usb device.

Do you happen to know of any system setting/configuration/mechanism that is responsible for granting permissions for such activity to plain users? It appears that by adding the corresponding user to the disk group is not enough :frowning:

I would once again like to thank you for your immediate concern, in my attempt to shed some more light into the blind alley I have entered and resolve the issue,

Best regards,

Nassos

I can not explain what is going on in your system. In any case, at every stage where you are interested if it is mounted (and where) you can do a plain

mount

from a terminal (no need to be root). Also the behaviour of your earlier KDE 4 levels to ask for a root password is not normaly correct.

Are you sure there is no more entry in /etc/fstab that could be thought by the system to belong to your device? When there is one, HAL/DeviceKit wll do nothing with the device.

I am still only occasionaly on 11.2/KDE 4, but I thought that a USB memory device worked as expected. I will boot into it and check later today.

First of all, I would once again like to thank you for your immediate concern!

As you suggested, I did enter the mount command from within a terminal window (without becoming root) once I have plugged in the usb memory stick, but I did not get back any useful result (the device was not reported from the mount command). The output of the mount command follows:


/dev/sdc4 on / type reiserfs (rw,acl,user_xattr)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
debugfs on /sys/kernel/debug type debugfs (rw)
udev on /dev type tmpfs (rw)
devpts on /dev/pts type devpts (rw,mode=0620,gid=5)
/dev/sda4 on /root_old type reiserfs (rw)
/dev/sdc3 on /opt type reiserfs (rw,acl,user_xattr)
/dev/sda3 on /opt_old type reiserfs (rw)
/dev/sdc2 on /opt1 type reiserfs (rw,acl,user_xattr)
/dev/sda2 on /opt1_old type reiserfs (rw)
/dev/sdb1 on /opt2 type reiserfs (rw)
/dev/sdb2 on /opt3 type reiserfs (rw)
/dev/sdb3 on /opt4 type reiserfs (rw)
/dev/sdb4 on /back_up_1 type reiserfs (rw)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
/proc on /var/lib/ntp/proc type none (ro,bind)

As for whether anything related to usb has remained in my /etc/fstab, I doubt it, but please find below the entire content of that very file:


/dev/disk/by-id/scsi-SATA_ST3320613AS_6SZ090BQ-part4 /            reiserfs   acl,user_xattr        1 1
/dev/disk/by-id/scsi-SATA_ST3320613AS_6SZ090BQ-part1 swap                 swap       defaults              0 0
#/dev/sda1            swap                 swap       pri=42                0 0
/dev/sda4            /root_old                    reiserfs   defaults              1 2
/dev/disk/by-id/scsi-SATA_ST3320613AS_6SZ090BQ-part3 /opt            reiserfs   acl,user_xattr        1 2
/dev/sda3            /opt_old                 reiserfs   defaults              1 2
/dev/disk/by-id/scsi-SATA_ST3320613AS_6SZ090BQ-part2 /opt1            reiserfs   acl,user_xattr        1 2
/dev/sda2            /opt1_old                reiserfs   defaults              1 2
devpts               /dev/pts             devpts     mode=0620,gid=5       0 0
proc                 /proc                proc       defaults              0 0
#/dev/fd0             /media/floppy        subfs      fs=floppyfss,procuid,nodev,nosuid,sync 0 0
/dev/sdb1            /opt2                reiserfs   defaults              1 2
/dev/sdb2            /opt3                reiserfs   defaults              1 2
/dev/sdb3            /opt4                reiserfs   defaults              1 2
/dev/sdb4            /back_up_1           reiserfs   defaults              1 2

defaults,auto,soft      0 0

Is there anything else I could check with relation to HAL/DeviceKit that might give some more insight about my issue?

Should you have any further queries, please do not hesitate to contact me,

Best regards,

Nassos

On my 11.2 and KDE 4.3.
Before connecting an USB stick:

henk@boven:~> mount
/dev/sda5 on / type ext4 (rw,acl,user_xattr)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
debugfs on /sys/kernel/debug type debugfs (rw)
udev on /dev type tmpfs (rw)
devpts on /dev/pts type devpts (rw,mode=0620,gid=5)
/dev/sda3 on /home type ext3 (rw)
/dev/sda2 on /mnt/oldroot type ext3 (ro,acl)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
securityfs on /sys/kernel/security type securityfs (rw)
nfsd on /proc/fs/nfsd type nfsd (rw)
/proc on /var/lib/ntp/proc type none (ro,bind)
henk@boven:~>

After connecting the devive notifier popped up and the mount gave still the same. Using the pop-up I choose for Opening with file browser (or what it says, mine is in dutch) and Dolphin starts in the root of the USB stick. Then mount gives:

henk@boven:~> mount
/dev/sda5 on / type ext4 (rw,acl,user_xattr)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
debugfs on /sys/kernel/debug type debugfs (rw)
udev on /dev type tmpfs (rw)
devpts on /dev/pts type devpts (rw,mode=0620,gid=5)
/dev/sda3 on /home type ext3 (rw)
/dev/sda2 on /mnt/oldroot type ext3 (ro,acl)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
securityfs on /sys/kernel/security type securityfs (rw)
nfsd on /proc/fs/nfsd type nfsd (rw)
/proc on /var/lib/ntp/proc type none (ro,bind)
/dev/sdf1 on /media/disk type vfat (rw,nosuid,nodev,uid=500,utf8,shortname=mixed,flush)
henk@boven:~>

The owner of /media/disk and all inside is henk and the group is root.
I can umount by using the device notifier and clicking on the ^ button in the entry.

I suppose this is as it designed.

On your fstab. Also you have a mix of by-id entries and device oriented ones (which defers thourough analysis without having the /dev/disk/by-id/ listing) and thus on the assumption that /dev/disk/by-id/scsi-SATA_ST3320613AS_6SZ090BQ is not the same as /dev/sda or /dev/sdb and all three are not the device where the USB stick is connected I do not see any reference to the USB stick. (Hm, long sentence, but I hope you understand what I mean, when not, please ask).

Sorry to interrupt hcvv.

I note you are running a reiser file system which has not been used since SUSE 10 as default. I also note that you have upgraded Kde to 4.4. Have you done new reinstalls from previous versions of SUSE or just upgrades? If just Upgrades, it is not unexpected that things will not work correctly.

I am not sure your system can be made to work properly the way it is configured.

The mere fact of a Reiser fs can not be a problem imho, but the updating/upgrading instead of a reinstall from 10.x may be a cause of problems. This is only supported since 11.1 IIRC.

@hcvv: (Sorry for the delayed answer, but things at home tend to be hectic sometimes…) I know that the behaviour of kde 4.4 should follow the path that you’ve mentioned in your post, but unfortunately mine (once upgrading from KDE 4.3) doesn’t.
As I have already stated, when I was in KDE 4.3, at least, I was asked for the root’s password (for mounting and unmounting my usb devices) and after that things progressed as expected. Now, in KDE 4.4, I am not even asked for the root’s password.
This could well indicate a possible regression in the new device notifier of KDE 4.4 (the inability to request from the user the root’s password via a dialog box), but in any case, I could run around the issue, if I could alleviate my current system from the requirement to have root privileges in order to (un)mount a usb device. That is currently my aim: to find out more about why my (home) desktop insists on requiring root privileges for such actions, whereas my other (work) desktop does not require any such privileges and can successfully perform the (un)mounting task even under KDE 4.4 9 (on behalf of a regular user).

Thus, I believe it could prove invaluable if anyone could direct me towards finding out more about the HAL/DeviceKit thing you’ve mentioned in one of your previous posts…

@both MattBClassic and hcw:
YES I have been following the upgrade path for many-many years now: In fact, I’ve been upgrading both my (open)SuSE systems, since version SuSE 6.3 (or 6.4, I cannot quite clearly remember now). And yes, from the time the option to use ReiserFS had been made available, I opted for it (without any second thought), as I thought (and still believe) that it is one of the best filesystems out there (of course if Mr. Reiser himself hadn’t followed the choices he made with his personal life, things would most certainly be much better nowadays, but that’s a different story…)

This upgrade journey had a lot of hiccups in the course of time, but I won’t regret any decision I made regarding this upgrade cycle: I have two (2) systems that evolved through the time and retained a lot of the data (and software) I produced in the meantime.

Whichever the case, though, regarding my current issue with (un)mounting a usb device, I am convinced that the problem lies more or less at a settings level, since I have, as I already mentioned, two (2) separate desktop systems (home and work), which have both gone through the aforementioned upgrade cycle, which both have openSuSE 11.2 and KDE 4.4, but with the home one facing the issue, whereas the work one does not. Hence, I still believe that I can work out a solution, once I am given some useful directions about where to search and how to understand a few more things about the difference in the elevation of privileges (for usb devices) between my two (2) systems…

Any help would of course be highly appreciated!

Once again, I would like to thank you for your immediate concern and patience!

Best regards,

Nassos

As I have suspected, it was merely a settings issue!

Based on the following forum entry: mount pen-drives and cds - openSUSE Forums, I executed the command that follows (as the root) on the regular user that I wanted to be able to (un)mount a usb device:


polkit-auth --grant org.freedesktop.hal.storage.mount-removable --user <user_name>

And the above command rectified the issue entirely!!!

As it appears, it was an issue based on the policy applied by the policykit mechanism!

Of course, it remains to be investigated, why KDE 4.4 (unlike KDE 4.3) was not able to pop-up a respective dialog box requesting the regular user to enter the password of the root one to perform the elevated action (since policykit required root’s privileges), but at least I can proceed with my everyday tasks…

I would once again like to thank you all for your help,

Best regards,

Nassos

You are quite welcome. Such stories as yours do not only lead to a solution in the end (even if you found it yourself, which must be most satisfying), but it also teaches us (and the rest of the Forums community) lessons where to search for solutions.

Thanks for sharing the problem and the solution even if it is not quite solved why the two systems behave different.