How to mount external media in Linux via Console

Most of the modern Linux distros can easily detect & mount external drives automatically. In extremely rare case they may fail to mount. At such times, knowing how to manually mount the external drives will come handy. This simple guide will show you to mount external drives like pendrive, external hard-disks, card reader etc in Linux.

First insert the drive in the USB port & then issue the following command as root;

fdisk –l (That’s an ‘L’ not an ‘i’)

This will list all the storage devices attached to your computer including your internal hard-disk. Now look for an entry below your hard-disk & make a note of the device address. It would most probably be /dev/sdb1if you just have a single hard-disk installed in your computer.

In Linux, each device has is represented by a file. So before we can mount anything we need to create a location also known as mount point. So to mount the pendrive create a new folder “pendrive” under /media. You can give any name to the folder it doesn’t matter. This can be done by issuing,

mkdir /media/pendrive

Now that our mount point is created, we need to mount the pendrive at this point to make it accessible. So issue the following command;

mount “media address” “mount point”

In our example the media address is “/dev/sdb1″ & mount point is “/media/pendrive”. So the command to mount the pendrive in our case will be;

mount /dev/sdb1 /media/pendrive

After that your pendrive should be mounted at /media/pendrive & you can view its content by navigating through file manager or via issuing;

ls /media/pendrive

After your are done working with the external drive, it needs to be unmounted before you can unplug it from the USB. To unmount the pendrive issue;

umount /media/pendrive

Do remember to close all the active applications running from the external drive or the unmount will fail.

  • Share/Bookmark

Related posts:

  1. Disinfect virus infected pendrives using Linux Everytime you share your flash drive or portable hard disk...
  2. Configure XMMS media player to scrobb tracks on Last.fm Last.fm provides a good platform to share with the world...

Related posts brought to you by Yet Another Related Posts Plugin.

This entry was posted on Saturday, December 19th, 2009 at 8:57 pm and is filed under General . You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

4 Responses to “ How to mount external media in Linux via Console ”

  1. Instead of running fdisk -l as root you can run

    cat /proc/partitions

    as user.

  2. Rufus D says:

    What about pmount? Doesn’t require root privileges nor creating the mount point

  3. [...] How to mount external media in Linux via Console Most of the modern Linux distros can easily detect & mount external drives automatically. In extremely rare case they may fail to mount. At such times, knowing how to manually mount the external drives will come handy. This simple guide will show you to mount external drives like pendrive, external hard-disks, card reader etc in Linux. [...]

  4. Gaurav says:

    @Debianero Rumbero – Yes, one can do that.

    @Rufus D – Doesn’t work. Command not found.



Leave a Reply