Mounting hard drives

Because I always forget the commands…

Usually you plug a portable hard drive into your ubunty computer and it auto detects the drive and shows it in nautilus. Then you click on it, it gets mounted.

Problem: if you are only ssh’ing into the computer you cannot click on it.

Solution: This command will make sure it gets mounted under /media/$username/$volumelabel

udisksctl mount -b /dev/$deviceId$partition

With $deviceId being for instance “sda” and $partition is “1”.

You find your $deviceId with one of these commands:

ls /dev/sd*


udisksctl status

You have to guess the partition number, for mobile devices a good guess is $partition=1

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.