I've been using arch for a while, and use udisks
with udiskie
to automount my usb drives. I have one usb drive that I store my code on, and often have to go to in the terminal. don't like having to type cd /run/media/bobsfriend12/usbdrive/...
to use it. Is there a way to mount it to say /home/bobsfriend12/usbdrive
instead? Based on the github page it doesn't seem possible to do this with udieskie. Is there some other software?
Add a comment
|
1 Answer
Too low to comment but my two cent would be to put a symlink to the automount directory under ~
ln -s /run/media/bobsfriend12/ /home/bobsfriend12/usbdrives
Most times best solutions are also the simplest.
Ofc. when it comes to mounting filesystems the plain old /etc/fstab
is your friend, see this answer and perhaps this archwiki fstab page is worth reading over.
Hope this helps.
-
For the
fstab
solution, does it work with external drives. By the wiki page it seems that its executed at boot. I don't keep the usb drive plugged in all the time, I switch between multiple computers. Also for thesymlink
, is will it stay if I create asymlink
to a directory that get removed (when I take out the usb drive)? Commented May 20, 2021 at 2:03 -
If the symlink points to a non-exsistent target it will become invalid, but won't get desroyed. My suggestion was to point the symlink to the parent directory, containing all the externally mounted drives. The fstab solution depends on being able to identify the partition via UUID. As I understand the linked answer the systemd triggers the automount (not just on boot), but I have yet to verify it. I will try to get around to it this evening as I'm curious myself.– muthuhCommented May 20, 2021 at 10:13
-
Alright thanks. I think I'll create a symlink to the USB drive itself and then just have an invalid symlink. But if the fstab does do the automount then I'll probably use that. Thanks for you help. Commented May 20, 2021 at 12:19