Based on this answer for automounting USB...
Running Stretch Lite on a Pi3, running Openbox window manager, no desktop or session manager.
Is there a way to change the name of the mount point created by pmount?
For example, by default it will mount to "/media" but I need it to mount to "/media/username". I'd like to do this just by modifying some setup file, or running a CLI; no graphical interface.
If not possible with pmount, is there any other way of automounting to an alternate mount point?
2 Answers
Mounting drives into /media/user/*
is usually done by your file manager. Try running one in daemon mode, e.g.
pcmanfm -d &
Make sure the relevant options in "Volume Management" are checked:
You may need to install a session manager. Otherwise, if two users are simultaneously logged into the system, how do you want the automount to decide which user gets access to removable drives? Automount scripts which work without a session manager (such as usbmount
) mount everything into a common /mnt
exactly for this reason.
The purpose of pmount
is to let you mount drives manually without sudo
, it's strange to transform it into an automount solution using custom scripts.
From the pmount man pages:
pmount device [ label ]
This will mount device to a directory below /media if policy is met (see below). If label is given, the mount point will be /media/label, otherwise it will be /media/device.
So, if you run pmount /dev/sda1 /media/this_is_my_personalised_mounting_point
then you will get /media/this_is_my_personalised_mounting_point
in stead of /media/usb1
which would be chosen by default (if /media/usb1
is not already occupied, of course...)
-
Thanks. To clarify, the goal is for things to mount to /media/username/usb1...2...3... etc. In other words, I want the base to be /media/username/ then the mount points under that. I'm looking for a more elegant solution than just brute-forcing username/usb1. I was hoping there was some undocumented config file somewhere that specifies the base mount point. My current solution just creates a symbolic link in the udev script.– Ed KCommented Jan 15, 2019 at 17:10