Gnome-based GUI environment
gio mount -d /dev/sdb1
Easy as that.
For older versions of Gnome you may need to use gvfs-mount
instead:
gvfs-mount -d /dev/sdb1
Headless (no GUI) machine
Add an entry in /etc/fstab
and specify options for it.
From the manpage of fstab
:
The fourth field (fs_mntops).
This field describes the mount options associated with the filesystem.
<snip>
user allow a user to mount
owner allow device owner to mount
Now you'll need to make sure the device is owned by the correct owner. Specify that in an udev
rule. Put a file in /etc/udev/rules.d/50-myhdd-ownerchange.rules
:
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0bb4", ATTRS{idProduct}=="0ff9", MODE="0600", OWNER="username"
Replace the vendor and product ids with the USB device you want to get triggered by it. Find them using the command lsusb
. Also change the MODE
if you like.
Alternatively, use pmount
. I don't like it, personally.
sudo mkdir -p /mnt/hx
thensudo mount /dev/sdb1 /mnt/hx
?sudo chown -R username:groupname /folder
. The-R
makes the chown permissions be applied recursively. Also check thechmod
, even that takes the-R
parameter.