How To AutoMount An External USB Hard Drive via Terminal

Here is the quick and easy guide to figure out how to “Automount” HDD’s / SSD’s during bootup [or reboot] on any version of Ubuntu *like Lubuntu, Xbuntu, etc*

ubuntu

These are the steps in CLI/terminal you’ll need to type [it will be similar on your system]:

  1. Check to see if mounted on system by typing
    mount
    //Look for the HDD/SSD/USB HDD to see if it’s actually showing up in this list
  2. sudo fdisk -l 
    //shows the total # of HDD’s on server [bold text shows the external required to mount on this bullet point

    • Disk /dev/sdb: 2000.4 GB, 2000398933504 bytes
  3.  In Lubuntu, Ubuntu, you’ll need to tell the hard drive where to place the new hdd to access by making the directory and then mounting the hard drive there:
    //you can use either media or mnt in root directory **I prefer mnt = mount**
    sudo mkdir /mnt/hdd
    **Use whatever name you want to ID the directory**
  4. Now you need to tell the hdd where to mount on the new path made:
    sudo mount /dev/sdb /mnt/hdd
  5. type in the command shown to verify you get a 0 to show it works! If you get a 1, the command failed!
    echo $?
  6. Once you’ve completed that, now let’s simply edit the correct file to tell it the new path permanently for automount:
    sudo nano /etc/fstab
  7. Inside this file, place the following line at the bottom and press “ctrl+0 >> ctrl+x” to save:
    /dev/sdb1 /mnt/hdd ntfs defaults 0 0
    **PLEASE NOTE** -Your partition type will show up when you run sudo fdisk -l to use which will be something like NTFS,VFAT,etc [Change to the correct PARTITION type if you don’t use NTFS!]
  8. Type the following to reboot
    sudo reboot

    OPTIONAL: You can also add a symlink to the desktop if you are using a GUI by typing the following command:

    ln -s path/to/your/hdd path/to/desktop/hdd

  9. After all that has been completed, you should have a working automount you don’t have worry about mounting each time you reboot!

If you have any issues, also make sure to verify the drive is the correct one. I do not recommend using any type of package.

I actually also want to make note the following package doesn’t work by typing it into terminal: **I’ve seen a lot of automount tutorials online suggesting this which DOESN’T work**
sudo apt-get install pysdm

Support URL to verify: https://askubuntu.com/questions/237066/where-is-the-pysdm-package/237114

If you have any questions, please leave me a comment! Thanks!!

 

Advertisements

Author: Lubuntu 15.10 Support

https://www.lubuntu1510blog.wordpress.com Dedicated Lubuntu 15.10 Support Beyond The Official Lubuntu Sub-Team

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s