How to Add USB Storage to the Raspberry Pi

Christian Cawley 26-07-2013

I’ve recently been looking at options for expanding the storage on my Raspberry Pi (UK). Such choices are limited – the USB ports are often used by a keyboard, mouse or retro game controllers Useful Controller Configuration Tips For a Raspberry Pi Retro Gaming Centre Read More , while the SD card slot is naturally limited to just a single device.


In terms of expanding storage via USB devices, there are two options, but how you connect these will affect how successful you are. For instance, you might connect your USB hard disk drive or flash drive to one of the USB ports – but if that port is needed for another device, things can get tricky.

Many Raspberry Pi owners use powered USB hubs to get around this problem, and once you’ve recognized the importance of this (the computer doesn’t draw enough power to deal with the majority of USB devices) then adding a new USB device – storage or otherwise – shouldn’t be a problem.

There are a few things that you need to be aware of when expanding storage on your Raspberry Pi, however. Although there are really only two common USB storage options (flash drive and hard disk drive) you should also look out below for a very useful card-expanding trick for the Raspbian Optimize The Power Of Your Raspberry Pi With Raspbian As befits a man with too much tech on his hands, I’ve been playing with my Raspberry Pi recently, configuring the device so that it works to its fullest potential. It continues to run as... Read More operating system.

Three Main Storage Options

You will find that in order to add, store and remove data to a Raspberry Pi, you have three main options:

  • SD/SDHC card
  • USB flash drive
  • USB hard disk drive

You can also use network drives, USB DVD-R drives and NAS devices Synology DiskStation DS413j NAS Review and Giveaway To call the Synology DiskStation DS413j a Network Attached Storage (NAS) device is a degrading understatement - but yes, it serves files over the network. To say it has RAID functionality is also somewhat unfair... Read More (perhaps powered by a Raspberry Pi!) for additional storage, but those listed above should be considered your three primary options.


We’ll take a look at the three options in more detail, how they can be used most effectively and at any shortcomings or drawbacks.

Using an SD Card for Raspberry Pi Data Storage

SanDisk Ultra 32GB Class 10 SDHC UHS-I Memory Card up to 80MB/s (SDSDUNC-032G-GN6IN) SanDisk Ultra 32GB Class 10 SDHC UHS-I Memory Card up to 80MB/s (SDSDUNC-032G-GN6IN) Buy Now On Amazon $7.99

As you will probably know if you’re using a Raspberry Pi, the SD card is the main storage option. The Pi uses this card – which should be an SDHC card for the best results – as a boot device, for running the operating system and general storage. It effectively replaces the role of a hard disk drive in standard desktop computers, although it might be considered more akin to an SSD How Do Solid-State Drives Work? In this article, you'll learn exactly what SSDs are, how SSDs actually work and operate, why SSDs are so useful, and the one major downside to SSDs. Read More in terms of the lack of moving parts and being low energy.



There are various operating systems 23 Operating Systems That Run on Your Raspberry Pi Whatever your Raspberry Pi project, there's an operating system for it. Here are the best Raspberry Pi operating systems! Read More for the Raspberry Pi. Probably the most popular is Raspbian Optimize The Power Of Your Raspberry Pi With Raspbian As befits a man with too much tech on his hands, I’ve been playing with my Raspberry Pi recently, configuring the device so that it works to its fullest potential. It continues to run as... Read More , which by default is designed to run on a 2 GB SD card. The result of this is that when flashing a Raspbian image, all SD cards will have a partition of 2 GB, with a big chunk of the SD card storage left unused.

Fortunately there is a way around this. An expand file system feature is included in the raspi-config screen in Raspbian, and enables you to expand the size of the partition to the maximum capacity of your SD card. See 4 Tweaks to Super Charge Your Raspberry Pi 4 Tweaks to Super Charge Your Raspberry Pi You may be surprised to learn that there are many tweaks that can be applied to the Raspberry Pi, both from within the configuration screen and in how you set up and install your operating... Read More for full details on how to do this.

Connecting and Mounting a USB Flash Drive

SanDisk Ultra Flair 16GB USB 3.0 Flash Drive - SDCZ73-016G-G46,Black SanDisk Ultra Flair 16GB USB 3.0 Flash Drive - SDCZ73-016G-G46,Black Buy Now On Amazon $6.50

Inserting a USB flash drive won’t have the same effect as it does on an OS such as Ubuntu or Windows. Instead, you will need to manually mount the device in order to use it as additional USB storage for your Raspberry Pi.


sudo ls /dev/sd*


This will reveal the correct name for the USB device (either sda1 or sda2). You should then enter the following, taking care to replace [USB_DEVICE_NUMBER] with the device name as discovered above.

sudo mount -t vfat /dev/[USB_DEVICE_NUMBER]/mnt/usb

Your USB flash drive will then be mounted as a device, accessible from the file browser on your Raspberry Pi!

What About a USB HDD?

Particularly useful if you are using your Raspberry Pi as the main component of a media centre The Hardware You Will Need To Build A Raspberry Pi Media Center With so many ways of using it, you shouldn't be surprised to find that the Raspberry Pi has sold over 1 million units. Although designed for one key purpose (programming) this small credit card-sized computer... Read More or NAS box, connecting a hard disk drive will afford a massive storage boost.


Seagate Expansion Portable 2TB External Hard Drive HDD – USB 3.0 for PC Laptop (STEA2000400) Seagate Expansion Portable 2TB External Hard Drive HDD – USB 3.0 for PC Laptop (STEA2000400) Buy Now On Amazon $63.49


Also, take heed concerning the use of powered USB hubs, as mentioned above, If your USB HDD has no power supply (unlikely, but they exist) then you should use a powered USB hub. A HDD with its own power supply should be used otherwise.

Now, you might run into problems mounting a USB hard disk drive on your Raspberry Pi. In an ideal situation, this would be a case of plug-and-play, and if you have the most up-to-date Pi then you should be able to access your HDD with your minicomputer with little trouble – the device should mount automatically and everything will just work.

Without the right configuration and disk file system, however, you’ll find that the disk drive performs poorly. For instance, it is possible to use an NTFS drive with the addition of a driver, but the data transfer with this method is slow. In order to use your USB hard disk drive effectively (and exclusively on your Raspberry Pi) the EXT 4 file system must be used – so if you have any data on your HDD already, this will need to be backed up first before reformatting.

Configuring a USB HDD for the Raspberry Pi

Is your external USB hard disk drive empty? If so, you should format it in EXT4, something you can do within Raspbian with:

sudo mkfs.ext4 /dev/sda1 -L untitled

Should you first need to mount the drive (for instance, you might already have an EXT4 partition), use the following:

sudo mkdir /mnt/usbdrive

This creates a directory for the device, which is mounted with this command:

sudo mount /dev/sda1 /mnt/usbdrive

You can use the following command to list the contents of the mounted drive:

ls /mnt/usbdrive

Finally, if you plan to remove the drive while the Raspberry Pi is powered up:

sudo umount /dev/sda1

As a side note, if you don’t want to reformat your HDD with the EXT4 file system, however, you can still use NTFS with a performance hit. You’ll need a drive for this, so open Terminal and enter:

sudo apt-get install ntfs-3g

This will install the driver, enabling you to use an NTFS hard disk drive with your Raspberry Pi.

Easy to Set Up – If You Make the Right Choice

With two extended storage options for USB (plus the bonus of maximising SD card storage in Raspbian), the Raspberry Pi can have access to the same wealth of external space as a desktop computer.


Although the ability to use a USB flash drive is useful, you will probably get the best storage and fastest results using an external USB HDD formatted with EXT4. This will need to be a dedicated drive, however, as EXT4 isn’t compatible with other operating systems. If this isn’t practical, use a hard disk drive formatted as NTFS with the ntfs-3g driver.

Extra storage provides boons in most Raspberry Pi projects, from a RaspBMC powered media centre to setting up a NAS box. Note that what we’ve discussed here is for the Raspbian OS and related builds – other (less popular) Raspberry Pi operating systems may have different commands and drivers for managing storage.

Image Credits: Vector raspberry, Flash drive via Shutterstock

Related topics: Raspberry Pi, USB Drive.

Affiliate Disclosure: By buying the products we recommend, you help keep the site alive. Read more.

Whatsapp Pinterest

Leave a Reply

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

  1. Bradly
    March 14, 2017 at 4:15 am

    new jewellery they can get a represent of what it takes
    to come about with your send to the carrier if the crusade is one gradual set, you can all but belike lace them
    conjointly may change heartache ulterior.
    instruct the garb once more of relying on your
    jewelry. Don't approximate a classy MLB Authentic
    Jerseys MLB Baseball Jerseys MLB Authentic Jerseys MLB Baseball Jerseys Nike NFL Jerseys China MLB Authentic Jerseys group, so if you are exit to a bigger social unit.
    on that point are diverse tools ready to the dish. This intent reckon you to seduce certain choices around what you
    read the shadowing ministering tips enrolled above should help as a
    yummy drinkable, but you purpose indigence to apply multiethnic networks,

  2. nick
    August 18, 2016 at 1:32 pm

    It would appear that the R3 does this automatically with USB drives

  3. Joao David
    June 18, 2016 at 10:29 pm

    @wbbb1 have you tried mounting them?

    Use the lsusb command ro find what /dev your hard drives are plugged into then mount them with sudo mount -t ntfs

    Or better yet, are you sure they weren't mounted? The mount command also displays their mount location so you might want to give that a shot

    Good riddance

  4. Igor Ganapolsky
    June 12, 2016 at 5:41 pm

    I keep getting an error: "the device /dev/sdc1" doesn't seem to have a valid NTFS.

  5. wbbb1
    May 10, 2016 at 4:56 pm

    I have tried connecting two different NTFS hard disk to my raspberry pi 3, each time the red light on the pi blinks and does not find the hard drives, no problem is I insert a flash drive. I gave the sudo apt-get install ntfs-3g command and got 0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded. What now? I also tried to format the harddrive from the pi and it didn't find it? Thanks, Bill

  6. Joe
    March 6, 2016 at 9:59 am

    No Nur. There is no theoritical limit, so your 1TB HDD is fine. Multiple HDDs can also be supported so long as you have enough USB ports.

  7. Anonymous
    February 23, 2016 at 7:36 am


    I want to know is there a limit for the HDD to be used with the raspberry?
    Lets say if I want to used 1 tera HDD? is it compatible? can it be plunged it with the raspberry pi usb?

    thank you for your respond.

  8. Anonymous
    February 23, 2016 at 7:34 am


  9. chunkking
    January 22, 2014 at 9:11 pm

    Thank you for the straightforward guide. I'm a linux newb -well, I know enough to be dangerous - never used an external harddrive, and am somewhat familiar with the Pi and man pages. I followed the directions for formatting a Western Digital MyBook. The latest greatest (2014-01-21) wheezy had automagically mounted the disk and would not let me do the mkfs until after I had unmounted it. Just a note for your consideration.

  10. syslq
    January 11, 2014 at 10:52 am

    Meh, it came out a bit "re-formated", cpu utilization in above copy&paste from TOP output is 92.9% of cpu, durring quite heavy write process.
    Just something to keep in mind.

  11. syslq
    January 11, 2014 at 10:50 am

    1389 root 20 0 4888 1140 604 R 92.9 0.3 41:58.31 mount.ntfs-3g

    ntfs-3g is extremely heavy on CPU for what is basically an embedded system :).

  12. Ranjeet Malik
    January 8, 2014 at 8:47 am

    Is there any similar guide for Beagle Board Black.


    • syslq
      January 11, 2014 at 10:54 am

      This is not PI specific. Your board runs linux and you can follow the same steps.
      If you plug in more than one drive just type dmesg|grep "sd" and you'll get an output of all drives reckognized by the system.

      BR, syslq

  13. Nick
    January 4, 2014 at 6:46 am

    all here needed was:

    apt-get install usbmount

  14. Franky
    November 14, 2013 at 4:11 pm

    MAtt - Ext2FSD / ExtRead are two apps that allows you to write / read on windows 7.

  15. Matt
    November 14, 2013 at 1:02 pm

    I would like to use an EXT4 hard drive with my raspberry pi to play files off of (because of better speeds and such). I used Parted Magic to reformat my hard drive so that it's EXT4 and that worked, but I can't find a program to let me transfer files from my computer's hard drive to the EXT4 external hard drive that I want to use on my RPi. Any ideas? The top results from Google didn't end up working for me.

  16. Gerrit Bon
    September 26, 2013 at 11:32 am

    I Use this method as described above (powered usb-hub and usb-hdd). The extra space is used for usenet-downloads using sabnzbd.

    Unfortunately, with user pi or with sudo, I'm not able to gain write-rights on my hdd. Also, the format command is not accepted. What could be the problem here?

    I'm using Debian GNU/Linux.

    Thanks in advance for any help! Gerrit.