Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[SOLVED] USB automount in MATE Desktop
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Desktop Environments
View previous topic :: View next topic  
Author Message
Tickeldi
n00b
n00b


Joined: 17 Mar 2009
Posts: 32
Location: Norddeutschland

PostPosted: Sat Apr 27, 2013 12:09 pm    Post subject: [SOLVED] USB automount in MATE Desktop Reply with quote

Hey there.

I googled around a lot and also looked at the topics in this forum but nothing seems to help me there.
I am using mate-base/mate-1.6.0 (from the mate-overlay) for my desktop environment and it won't show usb-sticks.

I can mount them in the terminal as root well enough, so all kernel settings should be all right.

I activated this for policykit to work.

Quote:

[*] Auditing support
[*] Enable system-call auditing support


But it didn't change anything.

pmount is installed, my user is in the plugdev group.

Any ideas?
_________________
"Linux basiert doch auf DOS oder nicht?" *schüttel*


Last edited by Tickeldi on Fri May 03, 2013 3:08 am; edited 1 time in total
Back to top
View user's profile Send private message
Knute
Guru
Guru


Joined: 28 Jun 2004
Posts: 362
Location: Fargo, ND

PostPosted: Tue Apr 30, 2013 8:05 pm    Post subject: Reply with quote

Several things actually....

First of all, since you say that you can mount it as root, what group does your usb device show up in?

Is is plugdev, or root, or something else entirely?

Second, do you have an fstab entry for it? I'm not sure, but I think that an fstab entry with the automount option may be necessary. It's something to look at in any case.

HTH
_________________
Knute
----------
The human race has one really effective weapon, and that is laughter.
-- Mark Twain

If you want proof of that, take a look at windows sometime. :)
Back to top
View user's profile Send private message
Tickeldi
n00b
n00b


Joined: 17 Mar 2009
Posts: 32
Location: Norddeutschland

PostPosted: Wed May 01, 2013 3:13 am    Post subject: Reply with quote

Hey there. Thanks for your reply.
I am not entirely sure what you mean with
Code:
what group does your usb device show up in?
.
It depends on where it should show up. If I connect any usb mass memory device the kernel registers it normally:
dmesg:

Quote:

[43535.828828] hub 2-0:1.0: state 7 ports 8 chg 0000 evt 0008
[43535.828843] ehci_hcd 0000:00:1d.7: GetStatus port:3 status 001803 0 ACK POWER sig=j CSC CONNECT
[43535.828852] hub 2-0:1.0: port 3, status 0501, change 0001, 480 Mb/s
[43535.932027] hub 2-0:1.0: debounce: port 3: total 100ms stable 100ms status 0x501
[43535.983371] ehci_hcd 0000:00:1d.7: port 3 reset complete, port enabled
[43535.983380] ehci_hcd 0000:00:1d.7: GetStatus port:3 status 001005 0 ACK POWER sig=se0 PE CONNECT
[43536.034031] usb 2-3: new high-speed USB device number 4 using ehci_hcd
[43536.085246] ehci_hcd 0000:00:1d.7: port 3 reset complete, port enabled
[43536.085254] ehci_hcd 0000:00:1d.7: GetStatus port:3 status 001005 0 ACK POWER sig=se0 PE CONNECT
[43536.149379] usb 2-3: default language 0x0409
[43536.151891] usb 2-3: udev 4, busnum 2, minor = 131
[43536.151896] usb 2-3: New USB device found, idVendor=0930, idProduct=6544
[43536.151899] usb 2-3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[43536.151902] usb 2-3: Product: TransMemory
[43536.151905] usb 2-3: Manufacturer: TOSHIBA
[43536.151908] usb 2-3: SerialNumber: 001CC0C60DA8CC8083272543
[43536.152021] usb 2-3: usb_probe_device
[43536.152026] usb 2-3: configuration #1 chosen from 1 choice
[43536.152447] usb 2-3: adding 2-3:1.0 (config #1, interface 0)
[43536.152503] usb-storage 2-3:1.0: usb_probe_interface
[43536.152510] usb-storage 2-3:1.0: usb_probe_interface - got id
[43536.152654] scsi7 : usb-storage 2-3:1.0
[43537.193807] scsi 7:0:0:0: Direct-Access TOSHIBA TransMemory 1.00 PQ: 0 ANSI: 4
[43537.194443] sd 7:0:0:0: Attached scsi generic sg2 type 0
[43537.195290] sd 7:0:0:0: [sdb] 60594432 512-byte logical blocks: (31.0 GB/28.8 GiB)
[43537.195790] sd 7:0:0:0: [sdb] Write Protect is off
[43537.195796] sd 7:0:0:0: [sdb] Mode Sense: 45 00 00 00
[43537.196590] sd 7:0:0:0: [sdb] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[43537.201048] sdb: sdb1
[43537.204067] sd 7:0:0:0: [sdb] Attached SCSI removable disk


From here on, I have to mount it manually because nothing else will.

I'll do that like this:
Quote:
mount -o umask=0022,gid=27,uid=1000 /dev/sdb1 /media/stick/


This results in MATEs filemanager dutifully showing the stick and its contents. I can also write on it as my normal user. As wanted, the stick is mounted in my users group. And I have to unmount it via terminal as root again.
But this is not the behaviour I want.

I want caja (MATEs filemanager) to automatically mount a freshly connected usb stick to a mountpoint in /media/[LABEL or UUID]. And I want to be able to click that little eject icon to have it unmounted again. Other distributions using MATE (Mint for example) are able to do that so I guess I just haven't configured it right yet. I used GNOME2 before and it worked there out of the box as well.

I don't think that a static entry in fstab will be able to replicate this behaviour but I am ready to learn.
_________________
"Linux basiert doch auf DOS oder nicht?" *schüttel*
Back to top
View user's profile Send private message
Knute
Guru
Guru


Joined: 28 Jun 2004
Posts: 362
Location: Fargo, ND

PostPosted: Wed May 01, 2013 7:39 pm    Post subject: Reply with quote

Ok, let me clairfy what I was referring to here.

If you go into /dev and use the command ls -l (those are small case L's not ones, btw), you will get a listing similar to this:
Code:
 2:26PM % ls -l sd??                                                                 /dev (knute) pts/1
brw-rw---- 1 root disk 8,  1 Apr 30 10:02 sda1
brw-rw---- 1 root disk 8,  2 Apr 30 05:02 sda2
brw-rw---- 1 root disk 8,  3 Apr 30 10:02 sda3
brw-rw---- 1 root disk 8,  4 Apr 30 05:02 sda4
brw-rw---- 1 root disk 8,  5 Apr 30 10:02 sda5
brw-rw---- 1 root disk 8,  6 Apr 30 10:02 sda6
brw-rw---- 1 root disk 8,  7 Apr 30 10:02 sda7
brw-rw---- 1 root disk 8,  8 Apr 30 10:02 sda8
brw-rw---- 1 root disk 8,  9 Apr 30 05:02 sda9
brw-rw---- 1 root disk 8, 17 Apr 30 05:02 sdb1
 2:27PM %                                                                            /dev (knute) pts/1

You have the permissions, followed by owner, then group, then major and minor ids, then date, then name.

What I was asking you was what group does your usb device show up in? In the example that I gave off my machine, that would be disk.

Now, from what you posted, your usb device looks like it registers on sdb1. If that's where it always shows up, you can add an entry into fstab to have it automatically mount when it detects sdb1.

The fstab entry would look something like this:
[code]# <fs> <mountpoint> <type> <opts> <dump/pass>
/dev/sdb1 /media/stick auto auto,user 0 0[code]

This is just a "for instance", I don't know if it will actually work, as there may be an issue with the first auto that I put, as that is for the filesystem. If you put in your filesystem type in there, it should work.

As I have not used MATE or it's filemanager before, I can't speak to them. Hopefully this gets you on the right track, though.
_________________
Knute
----------
The human race has one really effective weapon, and that is laughter.
-- Mark Twain

If you want proof of that, take a look at windows sometime. :)
Back to top
View user's profile Send private message
ssuominen
Developer
Developer


Joined: 30 Sep 2005
Posts: 2001
Location: Finland

PostPosted: Wed May 01, 2013 8:52 pm    Post subject: Reply with quote

Tickeldi wrote:
Hey there. Thanks for your reply.
I am not entirely sure what you mean with
Code:
what group does your usb device show up in?
.
It depends on where it should show up. If I connect any usb mass memory device the kernel registers it normally:
dmesg:

...

I'll do that like this:
Quote:
mount -o umask=0022,gid=27,uid=1000 /dev/sdb1 /media/stick/


This results in MATEs filemanager dutifully showing the stick and its contents. I can also write on it as my normal user. As wanted, the stick is mounted in my users group. And I have to unmount it via terminal as root again.
But this is not the behaviour I want.

I want caja (MATEs filemanager) to automatically mount a freshly connected usb stick to a mountpoint in /media/[LABEL or UUID]. And I want to be able to click that little eject icon to have it unmounted again. Other distributions using MATE (Mint for example) are able to do that so I guess I just haven't configured it right yet. I used GNOME2 before and it worked there out of the box as well.

I don't think that a static entry in fstab will be able to replicate this behaviour but I am ready to learn.


Since MATE uses gvfs like gnome does (far as I know) , you need to use `gvfs-mount` instead of `mount` so proper information gets passed to MATE through glib/gio/gvfs
You can use ConsoleKit or systemd to get local authorization, see `ck-list-session` output in X11 terminal as normal user, it should say 'active = TRUE'. If it doesn't, then
it's not working.
Once you are set, you always get access on your user to it through consolekit or systemd, polkit wthout root access. That is, when you are locally logged as opposed to being remotely logged in when
it would be denied by default (but possible)
Remember to remove any conflicting fstab entries if there are problems (for a test)

Code:

$ ck-list-sessions


Code:

$ gvfs-mount -h
Back to top
View user's profile Send private message
Tickeldi
n00b
n00b


Joined: 17 Mar 2009
Posts: 32
Location: Norddeutschland

PostPosted: Fri May 03, 2013 3:07 am    Post subject: uuuh embarrassing Reply with quote

Thanks very much for your helpfulness and your time. Everything works fine now.

I was a bit noobish. I thought MATE would've replaced all GNOME libraries with their own versions (or renamed once at least). Seems they just use the normal gnome-base/gvfs for the heavy lifting in this case. There is no dependency or useflag that would pull it in when installing MATE though.

I just had to simply
Quote:
emerge -av gnome-base/gvfs
and the functionality I wanted was there in all its greatness.

Again thank you both, for your precious time.
_________________
"Linux basiert doch auf DOS oder nicht?" *schüttel*
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Desktop Environments All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum