Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

USB disk problem in Slackware 14.2

544 views
Skip to first unread message

Henrik Carlqvist

unread,
Sep 27, 2016, 2:51:37 PM9/27/16
to
I have been starting looking at Slackware 14.2 and have problems using
USB drives as normal user.

Trying to mount the disk by double clicking in KDE or XFCE only gives an
error. If I remember right the error in XFCE is:

polkit authority not available and caller is not uid 0

I have written udev rules to allow a normal user access the USB disk
which gets named /dev/sdb and gets the permission 0666, but that didn't
help.

I have also tried, but not succeeded to customize rules in /etc/plkit-1/
rules.d.

Nor does it help to add the user to the plugdev group.

With previous versions of Slackware it has been possible to mount USB
disks with point-and-click as a normal user without any entries in fstab.

Has anyone else been able to use USB-disks as a normal user from any
desktop environment with Slackware 14.2?

regards Henrik
--
The address in the header is only to prevent spam. My real address is:
hc351(at)poolhem.se Examples of addresses which go to spammers:
root@localhost postmaster@localhost

Lew Pitcher

unread,
Sep 27, 2016, 3:41:19 PM9/27/16
to
On Tuesday September 27 2016 14:51, in alt.os.linux.slackware, "Henrik
Carlqvist" <Henrik.C...@deadspam.com> wrote:

> I have been starting looking at Slackware 14.2 and have problems using
> USB drives as normal user.
>
> Trying to mount the disk by double clicking in KDE or XFCE only gives an
> error. If I remember right the error in XFCE is:
>
> polkit authority not available and caller is not uid 0
>
> I have written udev rules to allow a normal user access the USB disk
> which gets named /dev/sdb and gets the permission 0666,

On directories, you need eXecute privilege to search or use as current working
directory. So, your permissions of 0666 (rw-rw-rw) aren't going to let anyone
access the device, let alone normal users.


> but that didn't help.
>
> I have also tried, but not succeeded to customize rules in /etc/plkit-1/
> rules.d.
>
> Nor does it help to add the user to the plugdev group.
>
> With previous versions of Slackware it has been possible to mount USB
> disks with point-and-click as a normal user without any entries in fstab.
>
> Has anyone else been able to use USB-disks as a normal user from any
> desktop environment with Slackware 14.2?
>
> regards Henrik


--
Lew Pitcher
"In Skills, We Trust"
PGP public key available upon request

Arkadiusz Drabczyk

unread,
Sep 27, 2016, 4:59:33 PM9/27/16
to
On 2016-09-27, Henrik Carlqvist <Henrik.C...@deadspam.com> wrote:
> I have been starting looking at Slackware 14.2 and have problems using
> USB drives as normal user.
>
> Trying to mount the disk by double clicking in KDE or XFCE only gives an
> error. If I remember right the error in XFCE is:
>
> polkit authority not available and caller is not uid 0
>
> I have written udev rules to allow a normal user access the USB disk
> which gets named /dev/sdb and gets the permission 0666, but that didn't
> help.
>
> I have also tried, but not succeeded to customize rules in /etc/plkit-1/
> rules.d.
>
> Nor does it help to add the user to the plugdev group.

Just for the test, does this command work:

$ udisks --mount /dev/<DEVICE>
--
Arkadiusz Drabczyk

Cary

unread,
Sep 28, 2016, 1:18:06 AM9/28/16
to
On my Slackware 14.2 the command

$ udisksctl mount -b /dev/<DEVICE>

prompts for authenication, something it did not do on 14.1.
I'm also trying to modify polkit rules without any success so far.
Some scripts that were able to mount disks without permission I've had
to revert to using "sudo mount" in order to get a GUI prompt.


--
ca...@sdf.org
SDF Public Access UNIX System - http://sdf.org

Henrik Carlqvist

unread,
Sep 28, 2016, 1:36:03 AM9/28/16
to
On Tue, 27 Sep 2016 15:41:16 -0400, Lew Pitcher wrote:
> On directories, you need eXecute privilege to search or use as current
> working directory. So, your permissions of 0666 (rw-rw-rw) aren't going
> to let anyone access the device, let alone normal users.

Yes, but my permission 0666 (rw-rw-rw) was not for the mount point
directory. It was for the device:

brw-rw---- 1 root disk 8, 0 Sep 26 20:24 /dev/sda
brw-rw---- 1 root disk 8, 1 Sep 26 20:24 /dev/sda1
brw-rw---- 1 root disk 8, 10 Sep 26 20:24 /dev/sda10
brw-rw---- 1 root disk 8, 11 Sep 26 20:24 /dev/sda11
brw-rw---- 1 root disk 8, 2 Sep 26 20:24 /dev/sda2
brw-rw---- 1 root disk 8, 3 Sep 26 20:24 /dev/sda3
brw-rw---- 1 root disk 8, 5 Sep 26 20:24 /dev/sda5
brw-rw---- 1 root disk 8, 6 Sep 26 20:24 /dev/sda6
brw-rw---- 1 root disk 8, 7 Sep 26 20:24 /dev/sda7
brw-rw---- 1 root disk 8, 8 Sep 26 20:24 /dev/sda8
brw-rw---- 1 root disk 8, 9 Sep 26 20:24 /dev/sda9
brw-rw-rw- 1 root plugdev 8, 16 Sep 27 20:34 /dev/sdb

In the example above /dev/sdb is a removable USB device and accessible
not only by root. The fixed disk /dev/sda with all its partitions are
accessible only by root. Sorry I wasn't clear about the chmod.

Henrik Carlqvist

unread,
Sep 28, 2016, 3:27:52 AM9/28/16
to
On Tue, 27 Sep 2016 20:59:21 +0000, Arkadiusz Drabczyk wrote:
> Just for the test, does this command work:
>
> $ udisks --mount /dev/<DEVICE>

No, unfortunately not. I plug in the USB drive and get /dev/sdb but the
udisks command fail:

$ dmesg -T | grep sdb | tail -2
[Wed Sep 28 09:20:54 2016] sdb:
[Wed Sep 28 09:20:54 2016] sd 8:0:0:0: [sdb] Attached SCSI removable disk
$ date
Wed Sep 28 09:21:03 CEST 2016
$ ls -al /dev/sdb
brw-rw-rw- 1 root plugdev 8, 16 Sep 28 09:20 /dev/sdb
$ udisks --mount /dev/sdb
Cannot find device with major:minor 8:16: Message recipient disconnected
from message bus without replying

Also, as Cary says, udisksctl fails:

$ udisksctl mount -b /dev/sdb
Error mounting /dev/sdb:
GDBus.Error:org.freedesktop.UDisks2.Error.NotAuthorized: Not authorized
to perform operation (polkit authority not available and caller is not
uid 0)

Ken P

unread,
Sep 28, 2016, 11:16:52 AM9/28/16
to
On Wed, 28 Sep 2016 05:35:51 -0000 (UTC), Henrik Carlqvist <Henrik.C...@deadspam.com> wrote:
> On Tue, 27 Sep 2016 15:41:16 -0400, Lew Pitcher wrote:
>> On directories, you need eXecute privilege to search or use as current
>> working directory. So, your permissions of 0666 (rw-rw-rw) aren't going
>> to let anyone access the device, let alone normal users.
>
> Yes, but my permission 0666 (rw-rw-rw) was not for the mount point
> directory. It was for the device:
>
> brw-rw---- 1 root disk 8, 0 Sep 26 20:24 /dev/sda
> brw-rw---- 1 root disk 8, 1 Sep 26 20:24 /dev/sda1
> brw-rw---- 1 root disk 8, 10 Sep 26 20:24 /dev/sda10
> brw-rw---- 1 root disk 8, 11 Sep 26 20:24 /dev/sda11
> brw-rw---- 1 root disk 8, 2 Sep 26 20:24 /dev/sda2
> brw-rw---- 1 root disk 8, 3 Sep 26 20:24 /dev/sda3
> brw-rw---- 1 root disk 8, 5 Sep 26 20:24 /dev/sda5
> brw-rw---- 1 root disk 8, 6 Sep 26 20:24 /dev/sda6
> brw-rw---- 1 root disk 8, 7 Sep 26 20:24 /dev/sda7
> brw-rw---- 1 root disk 8, 8 Sep 26 20:24 /dev/sda8
> brw-rw---- 1 root disk 8, 9 Sep 26 20:24 /dev/sda9
> brw-rw-rw- 1 root plugdev 8, 16 Sep 27 20:34 /dev/sdb
>
> In the example above /dev/sdb is a removable USB device and accessible
> not only by root. The fixed disk /dev/sda with all its partitions are
> accessible only by root. Sorry I wasn't clear about the chmod.
>
> regards Henrik

My 14.2 works on Xfce.
Maybe this will help.

kprims@hawk ~ $ udisks --mount /dev/sdb1
Mounted /org/freedesktop/UDisks/devices/sdb1 at /media/CDC4-0016

grep polkit -r /etc
/etc/polkit-1/rules.d/10-org.freedesktop.NetworkManager.rules:polkit.addRule(function(action, subject) {
/etc/polkit-1/rules.d/10-org.freedesktop.NetworkManager.rules: return polkit.Result.YES;
/etc/polkit-1/rules.d/20-plugdev-group-mount-override.rules:/* http://udisks.freedesktop.org/docs/latest/udisks-polkit-actions.html */
/etc/polkit-1/rules.d/20-plugdev-group-mount-override.rules:polkit.addRule(function(action, subject) {
/etc/polkit-1/rules.d/20-plugdev-group-mount-override.rules: return polkit.Result.YES;
/etc/polkit-1/rules.d/20-plugdev-group-mount-override.rules:polkit.addRule(function(action, subject) {
/etc/polkit-1/rules.d/20-plugdev-group-mount-override.rules: return polkit.Result.YES;
/etc/polkit-1/rules.d/50-default.rules:// Default rules for polkit
/etc/polkit-1/rules.d/50-default.rules:// See the polkit(8) man page for more information
/etc/polkit-1/rules.d/50-default.rules:// about configuring polkit.
/etc/polkit-1/rules.d/50-default.rules:polkit.addAdminRule(function(action, subject) {
/etc/shadow:polkitd:*:9797:0:::::
/etc/rc.d/rc.consolekit:# This daemon is used by polkit's console auth agent.
/etc/shadow-:polkitd:*:9797:0:::::
/etc/group-:polkitd:x:87:
/etc/group:polkitd:x:87:
/etc/xdg/autostart/polkit-gnome-authentication-agent-1.desktop:Exec=/usr/libexec/polkit-gnome-authentication-agent-1
Binary file /etc/ld.so.cache matches
/etc/passwd-:polkitd:x:87:87:PolicyKit daemon owner:/var/lib/polkit:/bin/false
/etc/passwd:polkitd:x:87:87:PolicyKit daemon owner:/var/lib/polkit:/bin/false
/etc/dbus-1/system.d/org.kde.polkitkde1.helper.conf: for polkit-kde to work. -->
/etc/dbus-1/system.d/org.kde.polkitkde1.helper.conf: <!-- Only user root can own the polkitkde1.helper service -->
/etc/dbus-1/system.d/org.kde.polkitkde1.helper.conf: <allow own="org.kde.polkitkde1.helper"/>
/etc/dbus-1/system.d/org.kde.polkitkde1.helper.conf: <!-- Allow anyone to call into the service - we'll reject callers using polkit -->
/etc/dbus-1/system.d/org.kde.polkitkde1.helper.conf: <allow send_destination="org.kde.polkitkde1.helper"/>
/etc/dbus-1/system.d/org.freedesktop.PolicyKit1.conf: <policy user="polkitd">
/etc/dbus-1/system.d/org.freedesktop.PolicyKit1.conf: <policy user="polkitd">


Hope you can read this, I didn't wrap the lines.

--
Ken P

root

unread,
Sep 28, 2016, 11:53:46 AM9/28/16
to
Henrik Carlqvist <Henrik.C...@deadspam.com> wrote:
> On Tue, 27 Sep 2016 20:59:21 +0000, Arkadiusz Drabczyk wrote:
>> Just for the test, does this command work:
>>
>> $ udisks --mount /dev/<DEVICE>
>
> No, unfortunately not. I plug in the USB drive and get /dev/sdb but the
> udisks command fail:
>
> $ dmesg -T | grep sdb | tail -2
> [Wed Sep 28 09:20:54 2016] sdb:
> [Wed Sep 28 09:20:54 2016] sd 8:0:0:0: [sdb] Attached SCSI removable disk
> $ date
> Wed Sep 28 09:21:03 CEST 2016
> $ ls -al /dev/sdb
> brw-rw-rw- 1 root plugdev 8, 16 Sep 28 09:20 /dev/sdb
> $ udisks --mount /dev/sdb
> Cannot find device with major:minor 8:16: Message recipient disconnected
> from message bus without replying
>
> Also, as Cary says, udisksctl fails:
>
> $ udisksctl mount -b /dev/sdb
> Error mounting /dev/sdb:
> GDBus.Error:org.freedesktop.UDisks2.Error.NotAuthorized: Not authorized
> to perform operation (polkit authority not available and caller is not
> uid 0)

I run Slackware 14.2 and these commands are not in accord with my
system (the commands are not syntactically correct). For instance:

udisksctl mount -b /dev/sdb

results in a file system error. On the other hand,

udisksctl mount -b /dev/sdb1

mounts the device in some directory /run/media/....

Cary

unread,
Sep 28, 2016, 1:18:06 PM9/28/16
to
What are the permissions on your mount point, /media/CDC4-0016 ?

Is it something like

$ ls -l /media
total 0
drwxr-x---+ 3 root root 60 Sept 28 09:00 CDC4-0016/

that you see?

Henrik Carlqvist

unread,
Sep 28, 2016, 2:26:11 PM9/28/16
to
On Wed, 28 Sep 2016 15:16:50 +0000, Ken P wrote:
> My 14.2 works on Xfce.
> Maybe this will help.

Thanks alot, the fact that this works for others is very useful
information. I have done some slight customizations of the Slackware
installatoin. I didn't think any of them would affect this, but those
customizations also include stuff like compiling a custom patched kernel.
I will restart with a more clean installation and see if USB disks work
there as expected.

Are you running 32 bit Slackware or Slackware64? I am using Slackware64
with multilib myself.

Henrik Carlqvist

unread,
Sep 28, 2016, 2:29:35 PM9/28/16
to
On Wed, 28 Sep 2016 15:53:45 +0000, root wrote:

> Henrik Carlqvist <Henrik.C...@deadspam.com> wrote:
>> $ udisksctl mount -b /dev/sdb
>> Error mounting /dev/sdb:
>> GDBus.Error:org.freedesktop.UDisks2.Error.NotAuthorized: Not authorized
>> to perform operation (polkit authority not available and caller is not
>> uid 0)
>
> I run Slackware 14.2 and these commands are not in accord with my system
> (the commands are not syntactically correct). For instance:
>
> udisksctl mount -b /dev/sdb
>
> results in a file system error. On the other hand,
>
> udisksctl mount -b /dev/sdb1
>
> mounts the device in some directory /run/media/....

Your disk /dev/sdb have a partition table and the file system is on the
first partition. My USB flash drive does not have any partition table and
the file system is on entire /dev/sdb.

Ken P

unread,
Sep 28, 2016, 4:11:03 PM9/28/16
to
> What are the permissions on your mount point, /media/CDC4-0016 ?
>
> Is it something like
>
> $ ls -l /media
> total 0
> drwxr-x---+ 3 root root 60 Sept 28 09:00 CDC4-0016/
>
> that you see?
>

$ udisks --mount /dev/sdb1
Mounted /org/freedesktop/UDisks/devices/sdb1 at /media/CDC4-0016

$ ls -l /media
total 76
drwx------ 14 kprims users 16384 Dec 31 1969 CDC4-0016

Just clicking *open* or double clicking using the mouse gets this.
/run/media/kprims/CDC4-0016/
Which opens file manager.

$ ls -l /run/media/kprims
total 16
drwxr-xr-x 14 kprims users 16384 Dec 31 1969 CDC4-0016

--
Ken P

Ken P

unread,
Sep 28, 2016, 4:34:50 PM9/28/16
to
On Wed, 28 Sep 2016 18:25:59 -0000 (UTC), Henrik Carlqvist <Henrik.C...@deadspam.com> wrote:
> On Wed, 28 Sep 2016 15:16:50 +0000, Ken P wrote:
>> My 14.2 works on Xfce.
>> Maybe this will help.
>
> Thanks alot, the fact that this works for others is very useful
> information. I have done some slight customizations of the Slackware
> installatoin. I didn't think any of them would affect this, but those
> customizations also include stuff like compiling a custom patched kernel.
> I will restart with a more clean installation and see if USB disks work
> there as expected.
>
> Are you running 32 bit Slackware or Slackware64? I am using Slackware64
> with multilib myself.
>
> regards Henrik

I am running slackware64-current, with latest updates. Started with a
clean install July 30, I think. :-)

The two devices I am using to test with.

Bus 005 Device 005: ID 0781:5581 SanDisk Corp. Ultra
Bus 003 Device 002: ID 13fd:1340 Initio Corporation Hi-Speed USB to SATA Bridge



df -h
Filesystem Size Used Avail Use% Mounted on
tmpfs 3.9G 1.1M 3.9G 1% /run
devtmpfs 3.9G 0 3.9G 0% /dev
/dev/sda2 68G 12G 53G 18% /
tmpfs 3.9G 140K 3.9G 1% /dev/shm
cgroup_root 3.9G 0 3.9G 0% /sys/fs/cgroup
/dev/sda4 25G 2.1G 22G 9% /asd
cgmfs 100K 0 100K 0% /run/cgmanager/fs
/dev/sdb1 29G 957M 28G 4% /run/media/kprims/CDC4-0016
/dev/sdc1 932G 39G 893G 5% /run/media/kprims/FANTOM

--
Ken P

Cary

unread,
Sep 28, 2016, 5:48:06 PM9/28/16
to
It's very helpful information. Thank you. The second example you showed
is consistent with the way drives are mounted by udisksctl.
A directory is created with modification time 12/31/69. IIRC, it was a
good year. :)

Henrik Carlqvist

unread,
Sep 29, 2016, 1:57:30 AM9/29/16
to
On Wed, 28 Sep 2016 20:34:48 +0000, Ken P wrote:
> I am running slackware64-current, with latest updates. Started with a
> clean install July 30, I think. :-)

Thanks, that should be rather close to my configuration. If I start with
a stock slackware64 installation and then step by step add multilib, my
custom packages and my custom kernel I should see which step breaks USB
disk functionality for users.

In worst case the difference is between stable and current, but if so I
should be able to find the difference rather fast.

Henrik Carlqvist

unread,
Sep 29, 2016, 10:29:58 AM9/29/16
to
On Thu, 29 Sep 2016 05:57:18 +0000, Henrik Carlqvist wrote:
> If I start with a stock slackware64 installation and then step by step
> add multilib, my custom packages and my custom kernel I should see
> which step breaks USB disk functionality for users.

It turned out that I got broken USB disk functionality from one of my
custom packages which included /etc/group. Among other things the group
polkitd was missing from my custom /etc/group.

So the missing USB functionality in Slackware 14.2 was only caused by my
own custom and broken /etc/group. Thanks to everyone who sent suggestions
in this thread and sorry about the noise!

d...@gmail.com

unread,
Sep 29, 2016, 2:42:02 PM9/29/16
to
This is only partially connected with the topic:

Where to d/l the good old USB-stik booter for Slackware,
but this time for a Win8.1 x64 laptop?
My x86 MOBO was stolen, and I'm hobbling on a RPi.

Where to d/l a minimal/incremental x64 Slackware installation
-- to a darkening-Africa/bad-inet-access location?

What about the old method, where non-X could be installed?
I hate kde; blackbox/fluxbox is good.

== TIA.

Peter "Shaggy" Haywood

unread,
Oct 3, 2016, 4:40:14 PM10/3/16
to
Groovy hepcat Henrik Carlqvist was jivin' in alt.os.linux.slackware on
Wed, 28 Sep 2016 3:35 pm. It's a cool scene! Dig it.

> On Tue, 27 Sep 2016 15:41:16 -0400, Lew Pitcher wrote:
>> On directories, you need eXecute privilege to search or use as
>> current working directory. So, your permissions of 0666 (rw-rw-rw)
>> aren't going to let anyone access the device, let alone normal users.
>
> Yes, but my permission 0666 (rw-rw-rw) was not for the mount point
> directory. It was for the device:
>
> brw-rw---- 1 root disk 8, 0 Sep 26 20:24 /dev/sda
> brw-rw---- 1 root disk 8, 1 Sep 26 20:24 /dev/sda1
> brw-rw---- 1 root disk 8, 10 Sep 26 20:24 /dev/sda10
> brw-rw---- 1 root disk 8, 11 Sep 26 20:24 /dev/sda11
> brw-rw---- 1 root disk 8, 2 Sep 26 20:24 /dev/sda2
> brw-rw---- 1 root disk 8, 3 Sep 26 20:24 /dev/sda3
> brw-rw---- 1 root disk 8, 5 Sep 26 20:24 /dev/sda5
> brw-rw---- 1 root disk 8, 6 Sep 26 20:24 /dev/sda6
> brw-rw---- 1 root disk 8, 7 Sep 26 20:24 /dev/sda7
> brw-rw---- 1 root disk 8, 8 Sep 26 20:24 /dev/sda8
> brw-rw---- 1 root disk 8, 9 Sep 26 20:24 /dev/sda9
> brw-rw-rw- 1 root plugdev 8, 16 Sep 27 20:34 /dev/sdb
>
> In the example above /dev/sdb is a removable USB device and accessible
> not only by root. The fixed disk /dev/sda with all its partitions are
> accessible only by root.

And members of the disk group. The logical answer: add yourself to the
disk group.

--


----- Dig the NEW and IMPROVED news sig!! -----


-------------- Shaggy was here! ---------------
Ain't I'm a dawg!!

Henrik Carlqvist

unread,
Oct 4, 2016, 1:36:39 AM10/4/16
to
On Sat, 01 Oct 2016 09:13:53 +1000, Peter \"Shaggy\" Haywood wrote:

> Groovy hepcat Henrik Carlqvist was jivin' in alt.os.linux.slackware on
> Wed, 28 Sep 2016 3:35 pm. It's a cool scene! Dig it.
>> brw-rw---- 1 root disk 8, 9 Sep 26 20:24 /dev/sda9
>> brw-rw-rw- 1 root plugdev 8, 16 Sep 27 20:34 /dev/sdb
>>
>> In the example above /dev/sdb is a removable USB device and accessible
>> not only by root. The fixed disk /dev/sda with all its partitions are
>> accessible only by root.
>
> And members of the disk group. The logical answer: add yourself to the
> disk group.

Yes, but maybe not the disk group, that is for fixed disks. If something
is to be done with fixed disks it is better done as root. Possibly normal
users should be added to the plugdev group. However, in my case I instead
write a custom udev rule looking something like this, from my /etc/udev/
rules.d/90-local.rules:

# put all removable devices in group "plugdev"
KERNEL=="hd*[!0-9]", ATTR{removable}=="1", GROUP="plugdev", MODE="0666"
KERNEL=="hd*[0-9]", ATTRS{removable}=="1", GROUP="plugdev", MODE="0666"
KERNEL=="sd*[!0-9]", ATTR{removable}=="1", GROUP="plugdev", MODE="0666"
KERNEL=="sd*[0-9]", ATTRS{removable}=="1", GROUP="plugdev", MODE="0666"

The MODE="0666" will give all users read and write access to those
devices, I have rules looking like that also for other devices:

# alsa devices
SUBSYSTEM=="sound", GROUP="audio", MODE="0666"

# Serial ports
KERNEL=="ttyS[0-9]*", MODE="0666"
KERNEL=="ttyUSB[0-9]*", MODE="0666"
KERNEL=="ttyACM[0-9]*", MODE="0666"

# kvm for qemu
KERNEL=="kvm", MODE="0666"

# For spacemouse to work
KERNEL=="event*", MODE="0666"
# But protect the keyboard from reading
ENV{ID_CLASS}=="kbd", MODE="0640"

As you say, it would sometimes also be possible to put users into the
group owning the device, but in my case I am not the only user and the
groups the users belong to are shared by NIS maps rather than in /etc/
groups. To make things even worse some NFS directories are used from
servers which gives a limit on 16 groups for each user. There are several
users which have painfully hit this limit and have to choose among their
most important groups. Adding those users to yet another group to be able
to access hardware would not make me very popular.
0 new messages