Ubuntu – How to mount a drive from terminal in Ubuntu

command linemountterminalUbuntu

I want to mount a drive from terminal at startup. At startup if I use ls /media, I notice that it is empty. If I go to Computer and click on VM drive there, I can then see the VM driver in ls /media.

How can I mount that drive from the terminal without having to go to Computer? Something like

mount VM

Or how can find the path of VM like /dev/sda or something?

Best Answer

You can use pmount, from the manual page:

 pmount  ("policy mount") is a wrapper around the standard mount program
 which permits normal users to mount removable devices without a  match-
 ing /etc/fstab entry.

 pmount is invoked like this:

 pmount device [ label ]

 This  will  mount  device  to a directory below /media if policy is met
 (see below). If label is given, the mount point will  be  /media/label,
 otherwise it will be /media/device.
Related Question