How to Format and Mount a USB Hard Drive in Linux

This guide will show you how to format a USB hard drive and then mount it to use in Linux. This also works with USB thumb (flash) drives.

I bought a new USB hard drive the other day. I wanted to use it to create backups of my Linux server. Here’s how I went about formatting and mounting the drive on my Linux server.

The first thing I did was to find out where the disk had been mounted. For that I ran the following command:

# tail -F /var/log/messages

When I plugged in the drive into my server there was a message saying the the drive was available at /dev/sdc1. So the next step was to format the drive. There are a number of file formats that can by read and written to by Linux, but Windows is a bit more fussy about it. So I decided to use a tried and tested file system that works well with both operating systems. I went with FAT. So to format the drive as FAT I ran the following command:

# mkfs.vfat /dev/sdc1

In a few minutes the newly formatted drive was ready to go. Now I wanted to mount it. So I created a directory to mount it:

# mkdir /media/usbdisk

Now, to mount the drive to this mount point I ran the following command:

# mount -t vfat /dev/sdc1 /media/usbdisk

And that’s it. My new hard drive was formatted, mounted, and ready to go. I copied the data I wanted to copy on it and then I unmounted it:

# umount /media/usbdisk

NOTE: this last step is very important. If you unplug your drive without unmounting it you could risk the data it holds.

If this is a USB storage device that you might use often and plan to leave it hooked up to your Linux server you can set up the device to be automatically mounted when you boot into Linux. To do that make an entry like the one shown below at the end of file /etc/fstab:

/dev/sdc1 /mnt/usbdrive vfat defaults 0 0

Now your drive will be automatically mounted to your Linux server, and you can create your automated backups without worrying about mounting a device.


If this article helped you, I'd be grateful if you could share it on your preferred social network - it helps me a lot. If you're feeling particularly generous, you could buy me a coffee and I'd be super grateful :)

buy a coffee for simplehelp.net


Home » Linux » How to Format and Mount a USB Hard Drive in Linux

2 thoughts on “How to Format and Mount a USB Hard Drive in Linux”

  1. This was the most useful help that I have seen in a long time. It is one of those things that I have to do about once a year, which gives me plenty of time to forget how between events. Thank you.

Leave a Comment

Your email address will not be published. Required fields are marked *