Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: How does Thunar mount a device?

  1. #1
    Join Date
    Dec 2007
    Beans
    9,667
    Distro
    Lubuntu 16.04 Xenial Xerus

    How does Thunar mount a device?

    When I open Thunar after booting my laptop, I see some "Devices" listed in the side-pane. If I want to access "TOSHIBA EXT" which is a 500GB USB disk, I single-click on it.

    My question is this: how can I do, in a terminal (and without sudo and without using Thunar in the command) what Thunar does when I single-click on "TOSHIBA EXT" as a normal user?

    I don't want to edit /etc/fstab and have not edited it previously.
    Attached Images Attached Images

  2. #2
    Join Date
    Feb 2008
    Location
    Oblivion
    Beans
    Hidden!
    Distro
    Xubuntu

    Re: How does Thunar mount a device?

    Not sure I follow. You want to open the folders on the device from a terminal? You want a terminal command that will open the folders in a GUI?

    Where, if not in the terminal, are you wanting the folders to open?

  3. #3
    Join Date
    Jun 2009
    Location
    0:0:0:0:0:0:0:1
    Beans
    4,697
    Distro
    Xubuntu

    Re: How does Thunar mount a device?

    Quote Originally Posted by Bucky Ball View Post
    Not sure I follow. You want to open the folders on the device from a terminal? You want a terminal command that will open the folders in a GUI?

    Where, if not in the terminal, are you wanting the folders to open?
    OP is asking how thunar does it without root access, so that OP can do it without root access from a terminal
    if you were using sudo
    Code:
    sudo mkdir /media/$USER/TOSHIBA\ EXT
    sudo mount /dev/sdb1 /media/$USER/TOSHIBA\ EXT
    but OP wants to do it without sudo
    Laptop: ASUS A54C-NB91 (Storage: WD3200BEKT + MKNSSDCR60GB-DX); Desktop: Custom Build - Images included; rPi Server
    Putting your Networked Printer's scanner software to shame PHP Scanner Server
    I frequently edit my post when I have the last post

  4. #4
    Join Date
    Feb 2008
    Location
    Oblivion
    Beans
    Hidden!
    Distro
    Xubuntu

    Re: How does Thunar mount a device?

    Quote Originally Posted by pqwoerituytrueiwoq View Post
    ... but OP wants to do it without sudo
    That part is crystal clear.

    So, solution?
    Last edited by Bucky Ball; February 8th, 2014 at 07:29 AM.

  5. #5
    Join Date
    Dec 2007
    Beans
    9,667
    Distro
    Lubuntu 16.04 Xenial Xerus

    Re: How does Thunar mount a device?

    Quote Originally Posted by pqwoerituytrueiwoq View Post
    OP is asking how thunar does it without root access, so that OP can do it without root access from a terminal
    if you were using sudo
    Code:
    sudo mkdir /media/$USER/TOSHIBA\ EXT
    sudo mount /dev/sdb1 /media/$USER/TOSHIBA\ EXT
    but OP wants to do it without sudo
    The only reason I asked for "without sudo" is that Thunar mounts the device without sudo. I have no objection to using sudo, per se, but the question remains: how does Thunar manage to do it without (gk)sudo?

  6. #6
    Join Date
    Feb 2008
    Location
    Oblivion
    Beans
    Hidden!
    Distro
    Xubuntu

    Re: How does Thunar mount a device?

    Quote Originally Posted by vasa1 View Post
    ... the question remains: how does Thunar manage to do it without (gk)sudo?
    Indeed it does. Now I'm curious. Never thought of it before. Perhaps it has something to do with the fact that you have permissions, as the user that logged in to start with, to allow it to do so. Probably about the user and groups ...

    My guess, anyway ...

  7. #7
    Join Date
    Feb 2007
    Location
    Romania
    Beans
    Hidden!

    Re: How does Thunar mount a device?


  8. #8
    Join Date
    Dec 2007
    Beans
    9,667
    Distro
    Lubuntu 16.04 Xenial Xerus

    Re: How does Thunar mount a device?

    Quote Originally Posted by sisco311 View Post
    That seems to be it:
    When you mount a disc normally with the file browser (nautilus etc) it mounts disks by interacting with udisks behind the scenes.
    from the link. Thanks!
    Code:
    [01:41 PM] ~ $ /usr/bin/udisks --mount /dev/sdb1
    Mounted /org/freedesktop/UDisks/devices/sdb1 at /media/TOSHIBA EXT
    [01:41 PM] ~ $
    And unmounting uses --unmount instead of --mount.
    Last edited by vasa1; February 8th, 2014 at 09:13 AM.

  9. #9
    Join Date
    Jun 2007
    Location
    Arizona U.S.A.
    Beans
    3,084

    Re: How does Thunar mount a device?

    Quote Originally Posted by vasa1 View Post
    That seems to be it:
    from the link. Thanks!
    Code:
    [01:41 PM] ~ $ /usr/bin/udisks --mount /dev/sdb1
    Mounted /org/freedesktop/UDisks/devices/sdb1 at /media/TOSHIBA EXT
    [01:41 PM] ~ $
    And unmounting uses --unmount instead of --mount.
    I notice udisks is mounting to /media/ instead of /media/<usr>/. Nevertheless, I put this into a one-line startup script to mount my Lubuntu partition from my Xubuntu partition at login. Seems to be working fine after some brief testing.

    Manual mounting output:

    Code:
    dn@Sydney:~$ udisks --mount /dev/disk/by-label/Lubuntu-1210 
    Mounted /org/freedesktop/UDisks/devices/sda1 at /media/
    
    dn@Sydney:/media$ ls -l
    total 8
    drwxr-x---+  3 root root 4096 Feb  9 07:13 dn
    drwxr-xr-x  23 root root 4096 Jan  3 22:07 Lubuntu-1210
    Any mounting from the devices section in Thunar's side pane is done to /media/<usr>/
    Last edited by Dennis N; February 9th, 2014 at 07:33 PM.

  10. #10
    Join Date
    Nov 2011
    Location
    /dev/root
    Beans
    Hidden!

    Re: How does Thunar mount a device?

    Quote Originally Posted by Dennis N View Post
    I notice udisks is mounting to /media/ instead of /media/<usr>//
    This is different between versions. I have noticed that 12.04 mounts in /media, while 13.10 mounts in /media/<usr>

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •