Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question

migrated from Apr 26 '10 at 6:41

This question came from our site for system and network administrators.

up vote 5 down vote accepted

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.
share|improve this answer

You can run fdisk -l to show you all the disk devices, or after mounting it in the GUI, drop down to the Terminal and run cat /proc/mounts and find your device that's mounted. You can then copy/paste that line from cat /proc/mounts into /etc/fstab and it'll be mounted at startup.

share|improve this answer

devkit-disks will let you query and mount devices, with the --enumerate-device-files and --mount options respectively.

share|improve this answer

Remember you've to make a directory first like this:

sudo mkdir /media/Name_of_directory

The above command will create a directory (folder) in media folder by replacing "Name_of_directory" with your providing folder name.

You can see drives numbers or id by:

sudo fdisk -l

Then mount the drive through:

sudo mount /dev/sda# /media/Name_of_directory

Where # must be replaced with legal number associated with your drives in Ubuntu (Linux Distro)

share|improve this answer

If you don't bother to install pmount you could first check the name of your partition with


Then, assuming you find it on /dev/sdb1 you could do

sudo mount /dev/sdb1 /mnt/ -o uid=1000,gid=1000,rw

assuming that you are user 1000. The uid and gid gives you permission to read and write (rw) on the mount, otherwise only root will have read and write access. Obviously you can add more options in -o (see man mount).

You can check your uid and gid with

cat /etc/passwd | grep YourUserName

Cheers, hope this helps.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .