Page 1 of 1

[SOLVED] How to change automatic mount point of USB devices

PostPosted: Feb 13th, '21, 02:07
by dreamer88
Hi, I installed Mageia 7.1 XFCE a while ago on a laptop and it generally all works fine.
I have one thing that is bugging me though: whenever I insert a USB stick it's automatically mounted under: /run/media/username/USBstickname/
This path is way too long and tedious to type every time I want to access it from a terminal.

Is there a way to change the default mount path back to /media/USBstickname/ as I was used to from other distros (including older versions of Mandriva)?

Re: How to change automtic mount point of USB devices

PostPosted: Feb 13th, '21, 03:36
by doktor5000

Re: How to change automtic mount point of USB devices

PostPosted: Feb 13th, '21, 03:54
by dreamer88
Many thanks, that worked!

Re: How to change automtic mount point of USB devices

PostPosted: Feb 13th, '21, 09:36
by isadora
Please mark the topic as solved by prefixing title in first message with [SOLVED].

Re: [SOLVED] How to change automatic mount point of USB devi

PostPosted: Feb 13th, '21, 19:23
by doktor5000
Please keep in mind that you would need to repeat this in the future for any udisks2 update. And easier workaround could be to simply create a symlink, e.g. /mnt2 which points to /run/media/username if you only want to type less.

Re: [SOLVED] How to change automatic mount point of USB devi

PostPosted: Feb 14th, '21, 00:07
by dreamer88
doktor5000 wrote:Please keep in mind that you would need to repeat this in the future for any udisks2 update.

Why do you think this would be the case?
The config file that I created according to the instructions (/etc/udev/rules.d/99-udisks2.rules) did not exist previously, so I don't think that it will be overwritten. Also shouldn't rpm create a .rpmnew file instead of just overwriting existing config files?

And easier workaround could be to simply create a symlink, e.g. /mnt2 which points to /run/media/username if you only want to type less.

I thought about that but on my other PCs (not running Mageia) I have the mount point under /media so it would be confusing having to type a different path on different PCs.

Re: [SOLVED] How to change automatic mount point of USB devi

PostPosted: Feb 14th, '21, 12:15
by doktor5000
dreamer88 wrote:The config file that I created according to the instructions (/etc/udev/rules.d/99-udisks2.rules) did not exist previously, so I don't think that it will be overwritten. Also shouldn't rpm create a .rpmnew file instead of just overwriting existing config files?

My mistake, thought the change was to /usr/lib/udev/rules.d that's why I mentioned it. If you created it below /etc/udev/rules.d/ then it would overwrite the systemwide rules.
And rpm will only create .rpmnew file if something is marked as %config and I don't think those udev rules below /usr/lib/udev/rules.d are considered config files.