How to Connect a Hard Drive to Raspberry Pi (And Why You Should)

Christian Cawley 17-07-2018

You’re running a Raspberry Pi, perhaps as a server or for retro gaming. Maybe you’re using it for Kodi. The point is, you need extra storage beyond the limits of a microSD card.


It doesn’t matter how large your microSD card is; sooner or later, your Raspberry Pi will need more storage How to Increase Storage on Your Raspberry Pi Need more storage on your Raspberry Pi? You have several options available. Here are all the things you can do. Read More . Also, regardless of how good the error correction is on your little piece of flash memory, sooner or later it will corrupt.

The solution is a hard disk. But how do you connect a hard disk drive to a Raspberry Pi? And what are the benefits of doing so? Here’s everything you need to know.

How to Mount and Read an HDD in Raspbian

As long as you have an external HDD with a USB cable and its own power supply, you’ll be able to use it with your Raspberry Pi. (If your drive doesn’t have a power supply, it will require connecting via a powered USB hub.) All you have to do is connect the drive to a USB port, and power it up.

By default, the hard disk drive won’t be immediately accessible. This is due to a couple of factors: the file system on the disk, and the lack of automatic mounting in Raspbian.

If the disk isn’t formatted with the EXT4 file system, then it cannot be natively read. One way around this is to remove the data from the drive, reformat in EXT4, and then replace the data. Once this is done, it should be accessible, but you’ve wasted a lot of time and effort.


More convenient is the option to use the ntfs-3g software, so that the Raspberry Pi can read the NTFS file system:

sudo apt install ntfs-3g

Note: If the drive is in FAT32 format, you’ll need to install vfat instead.

Ensuring the drive is connected, and powered on, you should find it within the Media directory on your Raspberry Pi. If not, you’ll need to do a bit more work.

First, find its UUID string:

sudo blkid

In the response, the final alphanumeric string is the UUID; keep a note of this. Next, create a location for the mount point. This is typically:

sudo mkdir /mnt/mydisk

Note: Swap “mydisk” with your preferred disk label.

Assign permissions with:

sudo chmod 770 /mnt/mydisk

Next, mount the drive with:

sudo mount -t ntfs-3g -o uid=1000,gid=1000,umask=007 /dev/sda1 /mnt/mydisk

Once you’ve done this, you should be able to access the drive in Raspbian. But what if you want to access the disk after a reboot?

The answer is to edit the fstab. Begin by backup:

sudo cp /etc/fstab /etc/fstab.backup

Next, edit the original:

sudo nano /etc/fstab

Add the information need to mount the disk; this begins with the 16-character UUID string you made a note of earlier:

UUID=ABCDEFGH12345678 /mnt/volume ntfs-3g uid=1000,gid=1000,nofail,umask=007 0 0

Next, reboot:

sudo reboot

You should now find that the HDD storage is accessible each time you boot up your Raspberry Pi! This might prove very useful for storing a retro gaming library, or media for a Raspberry Pi-based Plex media center to stream How to Turn a Raspberry Pi Into a Plex Media Server Here's how to install Plex server on a Raspberry Pi, configure it, and start streaming movies, TV shows, music, and more. Read More .

How to Boot Your Raspberry Pi From HDD

What if simple storage isn’t what you’re looking for? Perhaps you want to lose the potential weak link of the microSD card, and boot from HDD instead?

Raspberry Pi Model B 3+

Using a hard disk drive with your Raspberry Pi doesn’t have to mean using the disk as a secondary device. It is possible to install your OS to the disk, removing the requirement for a microSD card completely.

To do this, you’ll need to ensure the Pi (this works only with the Raspberry Pi 3 and Pi 3B+ How to Decide If You Need the Raspberry Pi 3 B+ Model How much does the Raspberry Pi 3 B+ cost, what specification does it have, and will it improve your existing projects? Read More ) knows that it no longer needs to boot from microSD. This is achieved by starting with a standard Raspbian install on microSD, then changing the USB boot mode.

You can then connect a HDD via USB, format the drive, copy the operating system from the microSD card, and enjoy larger (potentially faster) storage with your Raspberry Pi.

For the full details, see our guide to booting a Raspberry Pi from USB How to Make Raspberry Pi 3 Boot From USB The Raspberry Pi is a versatile piece of kit, capable of a diverse range of tasks. But it has one glaring flaw: the inability to boot from USB. Until now, that is. Read More .

Installing Multiple Raspberry Pi OSes to HDD

If these seems too hands on, and you want to take advantage of the vast additional storage, you should check out the various tools for installing multiple operating systems to your Raspberry Pi. Berryboot, NOOBS, and PINN Lite NOOBS vs. BerryBoot: Which Is Best for Installing a Raspberry Pi OS? Want to install a Raspberry Pi operating system without messing around with image files and SD card writing programs? It's easy with NOOBS and BerryBoot... but which option is best? Read More can all do the job.

All options can install to your Pi-attached hard disk drive, although you may prefer to jump straight into our guides. We’ve produced a tutorial for NOOBS How NOOBS For Raspberry Pi Can Help First Time Users There is something about the Raspberry Pi that might just put people off: until now, setting it up has not been particularly user friendly. NOOBS aims to change that! Read More , and an in-depth guide for Berryboot How to Dual Boot a Raspberry Pi Using BerryBoot Want to install multiple operating systems on your Raspberry Pi? Dual booting is the answer, and BerryBoot is one of the best tools for that. Read More . (You cannot use NOOBS to install to HDD without first following our guide to changing the USB boot mode.)

Raspberry Pi Cases With Space for an HDD

Once you’ve got your HDD sorted out, you’ll probably want to keep it close to your Raspberry Pi. Several enclosures are available that have space for a Raspberry Pi and a 2.5-inch hard disk drive.


This popular online store has several options from WD Labs, all designed to store a Raspberry Pi and a HDD. Although designed for the WD Labs PiDrive disk drive, a small amount of customization should allow any 2.5 inch drive to slot into one of these.

Geekworm Raspberry Pi X820 Enclosure

General Remote Control for BN59-01006A General Remote Control for BN59-01006A Buy Now On Amazon

A useful all-in-one option is this enclosure from Geekwork, which incorporates a Raspberry Pi, X820 expansion board, and compatible 2.5 inch SATA disk drive.

While the enclosure itself is available on Amazon, the X820 SATA expansion board must be purchased separately.

NODE Decentralized Mini Server

If you prefer, something even more integrated, prefer an open source design, and don’t mind a bit of soldering, then YouTuber NODE’s amazing decentralized mini server build might suit you.

Featuring some modifications to a Raspberry Pi 3B+ and a 3D-printed case with space for a 2.5 inch HDD to slot in, this is designed for using your Pi as a server. Find full details at

Setting Up Your Raspberry Pi With an HDD Is Simple

By now, you should be ready to add a hard disk drive to your Raspberry Pi, if you haven’t already. While any model can benefit, the best results are undoubtedly enjoyed on a Raspberry Pi 3 or 3B+.

How you use the hard disk drive is up to you. It may prove useful in a number of ways, including several of the ones in our list of the best Raspberry Pi projects 26 Awesome Uses for a Raspberry Pi Which Raspberry Pi project should you start with? Here's our roundup of the best Raspberry Pi uses and projects around! Read More .

Related topics: Hard Drive, Raspberry Pi.

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. Cindy
    November 12, 2018 at 8:45 am

    Hi, for this Geekworm Raspberry Pi X820 Enclosure, the V1.3 version is not available now at amazon. Now it is the new v3.0 version, you can also find v3.0 and v1.3 version at the Geekworm official site:
    And you can find the v3.0 version on Amazon:

  2. dragonmouth
    July 17, 2018 at 8:37 pm

    Doesn't attaching all kinds of peripherals to a Raspberry Pi just to prove you can defeat the entire purpose of having a low power, micro PC? There comes a point when the RPi and all the devices attached to it take up much more space than a desktop with similar peripherals.

    • Nick
      October 28, 2018 at 3:54 am

      I'm a raspberry pi power user and I have been using them as a desktop computer for 4 years now and that is unrealistic; i have 2 Pis, 2 moniters, 2 keyboards, and 2 mice on my tiny desk as i type this, and it all works beautifully . All of their gear comes nowhere close to the size of even a small PC, and even if they did, you cant beat the preformace at the price point