Howto: Mounting without sudo
This had been bothering for some time. On a system without an automounting “solution,” which I don’t usually like because they involve daemons and message subsystems and whatnot, mounting an external drive such as a USB key can be problematic. Mounting requires sudo, but sudo inflicts root ownership on the target, which makes it inaccessible to a non-root user, short of using sudo over and over again.
Here’s what I mean. Let’s suppose I have a USB key at /dev/sda1 that I want to mount to a folder called /media/usbdisk. First I make the folder.
sudo mkdir /media/usbdisk
Simple enough. Now mount /dev/sda1 to that folder.
sudo mount /dev/sda1 /media/usbdisk
Also pretty simple. But look at who owns the folder. ls -lha gives …