I've been using the terminal for almost everything: in fact, I often don't even log in through the interface, I use the tty1 and go to the web with text-browsers. So, the external drive doesn't auto-mount, and I use sudo mount /dev/sdb1 /mnt/JMCF125_DE to mount it. It works, but listing shows there's a difference. The files' description when auto-mounting via the GUI (Unity on Ubuntu) looks like:

-rw------- 1 jmcf125 jmcf125

In manual mount, the same files' properties look like this:

-rwxrwxrwx 1 root root

Which makes sense since I had to use sudo to mount. But how come the system doesn't have to? How can my mounts work exaclty like the systems'? Also, I heard every action in the GUI goes through a background shell: can I see what commands are printed there?

  • Your GUI is passing different options to mount. It may be using a front-end such as pmount. What GUI do you normally use? Under what distribution? Oct 13 '13 at 21:38
  • @Gilles, Unity under Ubuntu 12.04 x64.
    – JMCF125
    Oct 13 '13 at 21:54

The default GUI uses Gvfs to mount removable drives and other dynamic filesystems. Gvfs requires D-Bus. You can launch D-Bus outside of an X11 environemnt, but it's tricky. If you have D-Bus running, you can make gvfs mounts from the command line with gvfs-mount.

The program pmount provides a convenient way to mount removable drives without requiring sudo. Pmount is setuid root, so it can mount whatever it wants, but it only allows a whitelist of devices and mount points so it can safely be called by any user.

It is not true that every action in the GUI goes through a background shell. A few do but most don't.

  • Thanks, I installed pmount, and it works. Can I add permissions for normal users to mount removable drives in other locations rather than /media (as long as they own those and they're empty)? Or for that do I have to use the tricky way?
    – JMCF125
    Oct 14 '13 at 9:46
  • 1
    @JMCF125 I don't think pmount allows this. There's no fundamental reason why it doesn't, except that I think it's tricky to do without a race condition. FUSE allows that, but it works differently under the hood. Oct 14 '13 at 10:28

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.