# USB Automounting

## Torretto1

Hey there, brand new to Gentoo. Love it so far but I'm just stuck on trying to get a few things working. One of them is automounting USB. On most other distros when you plug in a usb device it mounts automatically. I cannot seem to get this to work, when i connect a USB drive it gives me an error message :

Not able to mount <disk name>

Not authorized to perform operation

I haven't been able to find a solution to this, I have seen a lot of mention about editing /etc/fstab but I believe that would only work with one specific drive. I want it to work when any USB disk is connected. Thanks in advance for any help that you folks can provide. BTW I am using Genkernel and MATE DE.

----------

## Roman_Gruber

Your user needs to be in a group.

```
roman@localhost ~ $ groups

wheel audio cdrom video games cdrw usb vboxusers android plugdev roman wireshark dropbox

```

Please provide the output of the command groups as your ordinary user. In the past there was something called pmount to use it.

On a sidenote, why don t you mount it manually as root? You know where it is mounted and anthing else. 

As I used a full blown desctop environment some auto mounted some not, but basically you need a service which does this for you.

Have you ever considered looking at the search engine of your choice first?

https://www.google.at/search?q=gentoo+wiki+automounting&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official&client=firefox-a&channel=fflb&gfe_rd=cr&ei=V14uVIO4EYSh8welkYGwDQ

gives

http://wiki.gentoo.org/wiki/AutoFS

more relevant

http://wiki.gentoo.org/wiki/Mdev/Automount_USB

my choice because I know what is done and it always works. Relying on a daemon to mount stuff never worked for me as I was a bit more lazy user. Manually mounting as user root with the mount falgs user so any user can rw a device always worked

http://wiki.gentoo.org/wiki/Mount

http://wiki.gentoo.org/wiki/USB/HOWTO

----------

## i92guboj

 *Torretto1 wrote:*   

> Hey there, brand new to Gentoo. Love it so far but I'm just stuck on trying to get a few things working. One of them is automounting USB. On most other distros when you plug in a usb device it mounts automatically. I cannot seem to get this to work, when i connect a USB drive it gives me an error message :
> 
> Not able to mount <disk name>
> 
> Not authorized to perform operation
> ...

 

How do your start your X session? Do you have USE="... consolekit policykit ..." in your make.conf? Do you have "consolekit" added to the default runlevel? What's the output for this command if you run it in xterm (or similar) from within your X session?

```
$ ck-list-sessions
```

----------

## Torretto1

In response to tw04l124, the groups account gives the following:

[ziggy@ziggy_gentoo ~]$ groups

wheel audio cdrom video usb users portage plugdev ziggy

And I have found several articles like those that you listed but I've had trouble getting any of them to work. I'll try the ones you list there specifically.

In response to i92guboj:

I have my dm (lightdm) in the default runlevel so it loads on boot, and then it logs me directly into my DE. I did not have consolekit in the default runlevel, nor did I have  consolekit or policykit in my make.conf file. Output of the 

```
$ ck-list-sessions
```

 command is:

```
[ziggy@ziggy_gentoo ~]$ ck-list-sessions

Session4:

   unix-user = '1000'

   realname = '(null)'

   seat = 'Seat1'

   session-type = ''

   active = TRUE

   x11-display = ':0'

   x11-display-device = '/dev/tty7'

   display-device = ''

   remote-host-name = ''

   is-local = TRUE

   on-since = '2014-10-03T23:44:48.625822Z'

   login-session-id = '53'

```

----------

## VoidMage

With such output from ck-list-sessions, automounting should work.

If it doesn't seem as if it did, recheck with 'udisksctl mount'

----------

## Torretto1

It seems like it is, or would be working, just that my user doesn't have permissions to mount. When I connect a USB drive an error pops up automatically saying not authorized to perform operation. The fact that it is automatic would seem to mean that it would be auto mounting given the right permissions

----------

## VoidMage

Something doesn't look right here.

Post taken from one terminal, one after the other:

1.  ck-list-sessions

2. 'ls -l <the device node of the plugged device>'

3. 'getfacl <the device node of the plugged device>'

4. 'udevadm info <the device node of the plugged device>'

5. full output of 'udisksctl mount -b <the device node of the plugged device>'

Cause it seems that you're giving the output of the commands for different users.

----------

## i92guboj

As VoidMage says, it should work given that output from ck-list-sessions.

The error you are getting is exactly the kind of error you get when you are not attached to a valid consolekit session. So, knowing if mounting works from command line using udisksctl is imperative. The rest of that info will help us to narrow the issue.

----------

## Torretto1

Solved the problem! Turns out for some reason I had installed systemd at some point, uninstalled that, and problem is now solved. USBs automount exactly how I want them too. I was having trouble figuring out why everyone was so against sytemd on every forum or anything I had read, but I now fully understand. Removing it has fixed both of the main issues I was having. I'm very glad to have these forums as a resource as I learn my way around!

----------

## VoidMage

 :Rolling Eyes: 

Actually, the real problem with systemd is a completely different matter...

What might have played a role here, is that consolekit and systemd just don't play well together, as the former was one of the components the later sought to assimilate.

----------

## Torretto1

Lol well either way I definitely know to avoid it lol. And I had read that they dont work well together, which is what led me to try uninstalling systemd. Thanks guys

----------

