Mount USB External Hard Drive to Linux Box

To mount a USB External Hard Drive to a Linux Box, first make sure the unit is plugged in and powered on. Depending on your linux distribution, the hard drive may automatically mount. If this is not the case, mounting the external hard drive is not a very complicated tasks.

To begin, you will need to know where the hard drive is located. In most cases, the location is /dev/sda1 (though this is not always the case). However, if this isn’t the case, you can run the df command into you console. This will return a list of devices where you will most likely be able to find your drive by means of the hard drive max capacity.

Now, assuming the external hard drive is found at /dev/sda1. A great default place to mount the drive is in the /mnt/usbdrive. You will first need to make sure the folder already exists. If the folder does not exist, it can be created by using the command mkdir ‘/mnt/usbdrive‘. Then, use the below command into your terminal:

mount /dev/sda1 /mnt/usbdrive ext3 default 0 0

In the above example, mount is the command, /dev/sda1 is where the hard drive is currently located and /mnt/usbdrive is the folder in which you want the mount the hard drive. The next ext3 is the hard drive file system (Click here for information on Linux File Systems). The next input ‘default’ tells the default settings to be used. The first zero means to back up the file system using the dump utility and the second zero tells the OS whether to process the hard drive if fsck is run.

To have the Linux distribution automatically mount the drive on boot, you will need to add an entry (line) to the /etc/fstab file. In this case, it will be exactly the same as the mount command, except you will not need the mount command:

/dev/sda1 /mnt/usbdrive ext3 default 0 0

Now you have your external that is mounted when the Linux operating system boots up.

Share and Enjoy:
  • Digg
  • DotNetKicks
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • Live
  • MySpace
  • Netvibes
  • Reddit
  • StumbleUpon
You can leave a response, or trackback from your own site.

No Responses to “Mount USB External Hard Drive to Linux Box”

  1. jason says:

    quick question for you, can you email me? Nice website?

    The question involves external ext3 formatted drives. I’m using redhat enterprise 4 and am using ext3 formatted external drives to backup to. The linux system auto mounts the drives in /media as usbdisk or usbdisk1 etc.

    My question revolves around a problem, once a week or so we run into an i/o error or a problem with one of the drives showing up. We have 3-9gig we’re backing up daily and I’m using cron and tar to compress and mv the files to the external drives. It’s when we switch drives that we sometimes run into problems…

    any thoughts?

    I was thinking about keeping 1 external drive always connected and connecting the off site backup drives to the first external drive…but I guess we would still run into problems sometimes?

    I felt so smart setting up all the drives as ext3, I don’t feel so smart now

    thanks for your time

Leave a Reply