The mounting from your desktop is done using UDisks a system daemon that allows (some) unprivileged mounts via polkit. UDisks has a command line tool you can use called udisksctl
:
udisksctl mount -b /dev/sdxY
and
udisksctl unmount -b /dev/sdxY
If udisksctl
asks you for password, that means that some requirements needed for the unprivileged mount are not met. For example you are trying to mount a system disk (not a removable one) or you are not logged in an active session etc. If this is the case, UDisks won't help you and you need to add your device to fstab with the user
or users
option which allows unprivileged mounts (even just with the simple mount
command). For an external drive that is not available all the time add the noauto
option so the system doesn't try to mount it during boot.
So add a line similar to this to your fstab
UUID=<uuid of your drive> /media/mySSD ext4 defaults,noauto,users 0 0
(you can get the UUID from lsblk -f
)
and then just mount it with mount /media/mySSD
.