[wiki] Semi-Auto-Mount external media

Udiskie has failed on me for whatever reason (some time over the last couple of months - currently I'm not using USB externals all that much). I use Artix these days, but that doesn't make any difference to what I'm presenting here, as Artix is just Arch without systemd.

Anyway, to topic: I've created a bash/python script called pm.sh that uses pmount & lsblk -f , to make it as painless & fast as possible to manually mount externals.

I'm pretty happy with it, as even if udiskie was currently working, I'd still remove it from my system (as I already have). :slight_smile:

Anyway, for anyone interested (if nothing else it is an easy way to un/mount externals when the more complex systems fail on us), the wiki page that incorporates the script can be found here:

https://wiki.manjaro.org/index.php?title=Pm.sh

I've writen another bash/python script (pum.sh) & added it to the wiki page. The new script uses pumount to unmount the partition that you already pmounted via the existing script & then delestes the /media/sd?? directory.

Usage:

pumount /media/sd??

Is all you need to unmount - no sudo required, but /media IS required.

3 Likes

I'll give it a test. Does it handle internal partitions or encrypted ones? Spacefm has no handling for encrypted volumes but let's you choose your mount command freely. I recently wrote a crypto mount extension for it, and this got me thinking: should I write an interactive mount script for terminal too? Pipe lsblk output to fzf and choose the target with it, asking passwords as necessary.

@Chrysostomus The pmount man page has this to say:

"pmount also supports encrypted devices which use dm-crypt and have LUKS metadata. If a LUKS-capable cryptsetup is installed, pmount will use it to decrypt the device first and mount the mapped unencrypted device instead."

Re. passwords, pmount requires only user privileges, how it handles LUKS I have no experience.

1 Like

I've modified the wiki page, adding a section on how to make /media the system default location for the mounting of external media (no more /run/media/(user)/*).

This is certainly useful for those that use pmount, & will also be useful to those who prefer to do things the old way & NOT use pmount, but would just like to give /media back its old job.

Your choice.

I've also added at the end a section on how to clear empty directories from /media on system shutdown/reboot. This I know works perfectly in Artix, I'm not so sure about Manjaro?

If someone would be so kind as to give me some accurate data on the topic for Manjaro, I'll add it to the wiki?

Forum kindly sponsored by