Auto mount of USB Drive on Debian


#1

Previously I was using Debian Version 8.6 (Jessie), recently I’ve upgraded my Beaglebone Black to Debian Version 9.5 (Stretch)

While using Jessie, if I plugged in a USB thumb drive it was automatically mounted and appeared in //media// but with Stretch the USB drive is not automatically mounted. I can open a terminal window and find the drive using “lshw” and them mount the USB drive, but I would like to have this happen automatically.

I have a USB mouse and keyboard and they seem to work OK.

Is there a setup parameter somewhere that is now disabling the auto mount feature for the USB drive? If not what is the best way to implement an auto mount of the USB drive when it is plugged in?


#3

@texasEE, auto-mount is a feature/function of the windows manager (lxde/lxqt/qt/gnome/xfce/etc…) Thus there is not a universal on or off switch…

Which windows-manager are you using? Then we can go thru the details of enabling it…

Regards,


#4

The image I’m running (BBB-blank-debian-9.5-lxqt-armhf-2018-09-4gb.img.xz) should have LXQT as the window manager

But if I check to see by using: ‘ps aux’ to see what display manager task are running I get:

“/usr/sbin/lightdm”


#5

@texasEE, lxqt’s auto mount is controlled thru pcmanfm, you can either go into pcmanfm’s settings and configure it or edit:

~/.config/pcmanfm-qt/lxqt/settings.conf

and change any of these options to “true” to get the functionality you want…

CloseOnUnmount=false
MountOnStartup=false
MountRemovable=false

Make sure to reboot after each change…

Regards,


#6

Those setting would seem to only apply when I opened a terminal window. I’d like the auto mount feature to be system wide so that I don’t need to open a terminal window. I’m running a headless unit.

There seems to be lxtq/settings.conf files in the following directories:
/etc/xdg/pcmanfm-qt
/opt/scripts/desktop-defaults/stretch
/opt/scripts/desktop-defaults/jessie

Any recommendation on which of these to use for a system wide default?


#7

pcmanfm-qt is the “file manger” for lxqt, thus it’s in control of auto-mounting for lxqt…

It’s config for auto-mounting is available in 2 locations:

package default: /etc/xdg/pcmanfm-qt
and
user config: /home/(username)/.config/pcmanfm-qt/lxqt/settings.conf

Now this relies on lxqt actually running, so if your running headless and you disable xorg/lightdm/lxqt/etc it will no longer auto-mount your media.

So for a headless enviroment, using “autofs” is a much better solution, it does require some configuration:

https://wiki.archlinux.org/index.php/autofs

Regards,


#8

I’ve edited both the /etc/xdg/pcmanfm-gt & the /home/ config files with all three options set to true without success.

In my environment I have a 4D Systems Gen4 LCD and sometimes a keyboard/mouse. When I plug in the USB Thumb Drive I can see it is recognized by the BBB since the bottom right hand of the LCD pops up the name of the volume name of the internal drive and the volume name of the Thumb drive. A quick check using a terminal window of the /media folder shows that the USB drive is not mounted at this point.

On the bottom right hand corner of the desktop there is a small drive ICON, selecting that and then selecting the volume name of the USB drive opens up file manager showing the contents of the USB thumb drive. A quick check using a terminal window of the /media/ folder shows that the USB drive is now mounted. The drive stays mounted even after closing the file manager and will stay mounted until the USB drive is removed or the power is recycled.

What I’m looking for is for the system to automatically mount the USB drive when the drive is plugged in without having to use the desktop.


#9

Okay, that sounds like a bug in lxqt/pcmanfm, as “MountRemovable” should auto-mount with out requiring the user to select the drive from the bottom right.

For your actual application setting up “autofs” would be a much more reliable option.

Regards,