• Home
  • |
  • Blog
  • |
  • Three Different Ways to Boot a Raspberry Pi From a USB Drive:
Three different ways to boot a Raspberry Pi from a USB drive

Most of the time you might have seen a Raspberry Pi booting from an SD card. Don’t be in the presumption that an SD card is the only option to boot a Pi. Raspberry Pi can be booted from any type of USB storage, no matter whether it’s a thumb drive or a superfast PCI SSDs. We are pleased to show you how to boot Raspberry Pi from a USB drive in this tutorial. In this tutorial we are going to cover why you should boot a Raspberry Pi from a USB drive, what difference you may see when booting a Raspberry Pi from a USB drive, and three ways to boot a Raspberry Pi from a USB drive. First, it is necessary to know why you want to use USB drives to boot Raspberry Pi. The answer to this question lies in the following section.

Prerequisites for booting a Raspberry Pi from a USB drive:

  • A Raspberry Pi (model depending on method used)
  • A microSD card (needed for some methods)
  • A USB drive such as a flash drive, hard drive, or SSD
  • Basic familiarity with the Linux command line interface
  • Administrative access to the Raspberry Pi
  • Backup of any important data on the SD card or USB drive
  • Understanding of device naming conventions in Linux (sda, sdb, etc.)
  • Patience and time to complete the procedures which can take 30+ minutes
  • For method 3 specifically:
    • Raspberry Pi 4 or 4B model
    • Knowledge of whether your Pi 4B needs its EEPROM updated
    • Caution when updating EEPROM as it can “brick” the Pi if done incorrectly

The key prerequisites are having the appropriate Raspberry Pi model and OS version to use your desired method, a USB drive to boot from, Linux command line knowledge, backups of data, and time/patience. The method of updating EEPROM has additional warnings to research compatibility and follow instructions carefully. Let me know if you would like me to elaborate on or modify the prerequisites.

Booting From USB Drive Is Right for You?

You may see using an SD card to boot a Raspberry Pi in most of the tutorials. Even official Raspberry Pi documentation is no exception. But there is a reason for that. SD cards are portable to use. You need not maintain a separate unit for storage. It’s been seen that there is a dramatic reduction in performance when flash drives have been used against SD cards. You may ask how the Pi would perform if you use HDDs/SSDs. They have a track record of an impressive performance against SD cards. Well, yes, you may yield better performance if you use hard drives. But, you may need to bear with additional components like a USB cable for the data transfer hard drive itself with a case for protection. Additionally, an extra power unit if the power drowns from the Pi is not sufficient to run the hard drive. All these requirements make this option inconvenient. If you are ready to compromise with all these inconveniences, then you will get a stable, durable, and performance-oriented Pi for your project. Both ways are better in their way, and both of them have their own pros and cons in practical. See this table which tells the difference in a simple way. We feel this table would help you to decide what is right for you.

Booting from SD cardBooting from Hard Drive
More convenientFaster than SD cards which increase performance
PortableHard drives must remain attached
Finite lifespanLonger lifespan
Simple BackupsMore complicated Backups

Which Method Is to Use to Boot From USB?

If you are made up your mind to try booting your Pi from a USB hard drive. Then you are in the right place. We always encourage you to try exploring different options. We can tell you what we have experienced. But it may not be true in your case. You should try this practically. You are not going to learn until you get your hands dirty. All right, let’s hop on to the actual topic. There are multiple different methods to boot a Raspberry Pi from USB hard drives. Ultimately, it all depends on which model of Pi you are using. We are going to show you three different methods of booting a Pi in this tutorial. It is important to know each one of them before getting started. Each method is better in some terms than others. Let’s have some knowledge of all three methods one after another.

See Also  How to Fix CVE-2022-41352- A Critical RCE Vulnerability In Zimbra Mail Servers

Method #1: Raspberry Pi Imager.

This method is very simple and straight as Raspberry Pi Org starts supporting the USB boot option on the new upcoming models. There is no need to tweak bootloader settings and flashing of EEPROM in the latest model. Booting from a USB drive is as same as booting a Pi from an SD card using the Raspberry Pi imager tool. You just need to select the hard drive instead of the SD card in the imager application while writing the boot image. Bear in mind that this method will work only on Raspberry Pi OS 2020–08–20 or newer and Raspberry Pi 400 and later models. Please check out our post “How easy to set up a Raspberry Pi ” to know more about booting a Raspberry Pi from an SD card.

The other two methods are a debatable topic. One method says to hijack the complete root file system from the SD card into the USB drive. Other methods say to upgrade the firmware from the official Raspberry Pi org to boot the Pi from USB storage. We would like to compare both of the methods using a table here in this section.

Upgrade FirmwareMoving the root file system
Only works with newer modelsWorks with all models
Requires a change on the Pi itselfPortable from one system to another
Procedure may differ between modelsUniversally applicable to all models
No need of SD cardSD card is mandatory to have

Method #2: Moving the Root File System.

This method is closer to the universe. No matter what model you have, starting from its early release to the present, it works flawlessly. Let’s get into it from scratch. This procedure is divided into Five simple steps.

  1. Backup your SD card
  2. Trigger the file system check
  3. Clone the SD card to a hard drive
  4. Configure the hard drive as a boot partition
  5. Expand the swap

Time needed: 30 minutes

Moving the root file system:

  1. Take a backup of your SD card:

    Let’s start the procedure by taking a backup of your SD card. Use a built-in ‘SD card copier’ or any other program of your choice to copy the content of the SD card before processing.

  2. Trigger the file system check:

    It’s good to start with a file system checkup to ensure everything is correct before moving the file system to the USB drive. Create a file named ‘forcefsck’ in the root directory. This file indicates the system to check the file system in the next reboot. If your Pi is hooked up to a monitor, you can see what is going on on the Pi. If not, just give a little extra time to the Pi to complete the boot process and come up. If you see your Pi booted without any errors, then your pi passed the file system test successfully. The file ‘forcefsck’ will disappear from the root directory. This is only a one-time test. However, you can trigger another test by repeating the process.

    $ sudo touch /forcefsck
    $ sudo reboot

    Trigger the file system check

  3. Clone the SD card to a hard drive:

    The first step to booting from a hard drive is to copy the content of the SD card to the hard drive partition. All of you know that the Raspberry Pi imager creates two partitions on the SD card. We need to copy the content of the boot partition of the SD card to the hard drive. To do this let’s find out the data to be copied from which SD card’s partition to which hard drive’s partition. Let’s check the boot partitions now and take note of PARTUUID.

    $ cat /boot/cmdline.txt

    Clone the SD card to a hard drive

  4. List all the storage partitions using blkid command

    List all the storage partitions using blkid command. Here we have a hard drive attached and connected to the Pi with three partitions created on it. Please check our post “How to Partition and Format the Hard Drives on Raspberry Pi:” to know how the hard drive has been partitioned..

    $ sudo blkid

    How to get bulkid on raspberry pi

  5. Match the PARTUUID of boot partition in the result of blkid command

    All right, now we know the data to move from which partition to which partition. Let’s break it down for you. Match the PARTUUID of boot partition in the result of blkid command. this gives the information about the data to be copied from /dev/mmcblk0p2 partition to /dev/sda1 partition. Let’s copy the content using ‘dd’ command. dd command will not show any progress information. You need to wait until the backup process gets completed. Time depends on the size of the data. It may take a longer time if you have more data on your SD card. It tests your patience.

    $ sudo dd if=/dev/mmcblk0p2 of=/dev/sda1 bs=32M conv=noerror,sync

    dd: A command used to copy files or a partition.
    if: input file
    of: output file
    bs: block size
    conv: conversion options

    Copy partition using dd command

  6. Check the target partition for errors

    After completion of the data transfer, check the target partition for errors using the file system consistency check command.

    $ sudo e2fsck -f /dev/sda1

    Check the target partition for errors using file system consistency check command

  7. Try Remounting the drive for errors

    If you see something like Cannot continue. Remount the drive and try the same command.
    Check the target partition for errors using file system consistency check command 2

  8. Reboot the Pi

    You may see some errors like this, and there is something corrupted on the SD card file system. Try to repeat the process by turning off the Pi without shutdown. Or try taking the previous backup again. The safest way is to do this by copying the contents of the SD card to a place and using that as a source for the dd command, which prevents copying any files on the fly from the SD card. After all, errors go off. Reboot the Pi.

    $ sudo reboot

  9. Pi will read the partition by itself

    Soon after reboot, your Pi will start reading the whole boot partition by itself. You can do this manually, too, by Issuing this command. This shouldn’t take a long time. When you finish this command, the new root system will have access to the full OS partition.

    $ sudo resize2fs /dev/sda1


  10. Configure the hard drive as a boot partition:

    To set up the hard drive as your boot device, you need modification in these two places:
    1. /boot/cmdline.txt
    2. /etc/fstab

    Substitute the PARTUUID of /dev/sda1 in /boot/cmdline.txt

    $ sudo blkid

    Take the bulkid of partition

  11. Edit the cmfline.txt

    Copy the PARTUUID of /dev/sda1. Edit the /boot/cmdline.txt file using any text editor and replace the PARTUUID of the boot partition with the PARTUUID of /dev/sda1.

    $ sudo nano /boot/cmfline.txt

    Configure the hard drive as a boot partition

  12. Delete the PARTUUID of /dev/mmcblk0p2 and write the PARTUUID of /dev/sda1. Save and reboot the Pi.

    Configure the hard drive as a boot partition 2

  13. Configure the hard drive as a boot partition 3

  14. Edit the /etc/fstab and replace the PARTUUID of /dev/mmcblk0p2 with PARTUUID of /dev/sda1

    After the reboot, it starts using the hard drive. For any reason, your Pi didn’t boot with your hard drive, you can connect your hard drive to your desktop computer and edit the /boot/cmdline.txt file. But you should have PARTUUID of /dev/sda1 or /dev/mmcblk0p2 handy to update and boot your Pi with your choice of storage.

    Edit the /etc/fstab and replace the PARTUUID of /dev/mmcblk0p2 with PARTUUID of /dev/sda1.

  15. Mark the PARTUUID from the fstab table

    Configure the hard drive as a boot partition 4

  16. Mark the new PARTUUID from the fstab table

    Configure the hard drive as a boot partition 5

  17. Reboot the Pi

    Reboot one more time.
    $ sudo reboot

  18. Expanding the swap:

    Now you are booting your Pi from your hard drive. If you are running new PI models which have 4 or 8 GB of RAM on them. You may need to expand the system swap. Raspberry Pi is already using swap partitions but in a very small amount. Use swapon command to see how much space is configured as a swap. It’s just 100 MB.

    $ swap -s

    Expanding the swap

  19. Increase the swap size

    To increase the swap size edit the file ‘/etc/dphys-swapfile’.  And, reboot the Pi.Expanding the swap 1

  20. Confirm the increase of SWAP size

    Comment the ‘CONF_SWAPSOZE-100’ line and uncomment the CONF_SWAPFACTOR=2. This would automatically pick up the swap size as twice the RAM size. When next time you reboot, your swap size will be 8 GB on a 4 GB model of Pi. Please make sure you have enough space on your boot partition before touching the swap configurations. We recommend doing this when you have a boot disc larger than 32 GB.

See Also  How To Protect Your Android Device From The New DawDropper Banking Dropper?

Method #3: Updating the Bootloader Eeprom

This method is suitable only for Raspberry Pi 4 and 4B models. Depending on when your Raspberry Pi 4B was manufactured, the bootloader EEPROM may need to be updated to enable booting from USB mass storage devices. If you have older models of Pi with you, you are probably going to break down your Pi if you follow this procedure. The procedure would differ with different models. Please pay attention to your procedure and Pi model before taking any decision. Visit this site to see how to upgrade the EEPROM of Raspberry Pi.


Now, we hope you have some idea of different ways to boot a Raspberry Pi from a USB drive. It’s a debatable topic to decide on SD card vs USB storage. If you have new models of Pi, we recommend using USB storage. If not, just fine to stick with an SD card. Again, we recommend using super-fast SSD or at least faster HDDs if you are decided to go for a USB boot. Because flash drives are never found to be the best performers, you can use them as long as you are okay with their performance.

If you have older models of Pi, we never recommend using USB storage as your default boot device. You may need to flash EEPROM on your Pi. This is a one-time procedure. You can’t undo this once you do the flash. This procedure is quite complex. It’s not for beginners. Moreover, the procedure would differ with different models. There are chances of damaging the Pi if you follow the wrong procedure. It’s better to use an SD card to boot up the Pi and use the USB storage as an extended drive to increase the storage capacity.

Thanks for reading this article. If you find this article interesting, please visit our site to read more such interesting articles.

Recommend Products for Raspberry Pi Users

We have some Raspberry Pi accessory recommendations that we think you’ll find useful. These are products we’ve personally selected that we believe are must-haves for any Raspberry Pi owner. Take a moment to look through the list – you can click on any item to view more details or purchase it directly from Amazon. Whether you’re just getting started with your Pi or looking to expand its capabilities, we’re confident you’ll find something helpful among our top picks. Let us know if you have any other questions!

Declaimer: The below products contain affiliate links. We may receive a small commission if you purchase through these links at no additional cost to you. You can read our full affiliate disclosure here.

Read More:

About the author

Arun KL

Arun KL is a cybersecurity professional with 15+ years of experience spanning IT infrastructure, cloud security, vulnerability management, Penetration Testing, security operations, and incident response. He is adept at designing and implementing robust security solutions to safeguard systems and data. Arun holds multiple industry certifications including CCNA, CCNA Security, RHCE, CEH, and AWS Security.

To know more about him, you can visit his profile on LinkedIn.

Leave a Reply

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

  1. For method 2, after the reboot on step 17 I now only have a flashing cursor at the top left of the screen. I'm working with the Pi 4B with 8Gb RAM, a 3.5A power supply and the SSD I'm trying to boot from is the Kingston A400 plugged into a USB-SATA adapter (same result whether I use the USB 3 or 2 slots).
    Now it's only trying to boot from the SSD via USB, I don't know how I can fix it since I now can't boot from the SD card and amend things via the GUI – help please!

    1. Hello Dave,

      I am sorry to hear that you have ended up in trouble. Answer these questions to help fix this problem.

      Did you check the target partition for errors? Did you notice any errors?
      Did Pi read the partitions?
      Did you follow all the steps that make the hard drive bootable? (step 10 to 16)

      If all the above things are perfect, then you should try powering the Hard drive with additional power input.

      If nothing works for you, try booting the Pi in recovery mode: https://drjohnstechtalk.com/blog/2019/08/raspberry-pi-recovery-mode-or-interrupting-the-boot-process/

      Let me know if this solves your problem.

  2. Very nice manual. Worked out but how do you solve the reboot issue? I removed the sd-card and powered it on with the usb drive attached and the raspb pi-4 started without any problem. However after a reboot the raspb pi 4 didn't start. Seems there is a power-issue with the usb 3 slot. Powering off and on again resolved the problem. So no problem when you are at home. In my case there is a problem because I use the rpb at a different location with rdp so I won't be able to pull the plug.

  3. Good stuff,
    I did the copy process with BalenaEtcher. now I got this:

    root@Oldie:~# blkid
    /dev/mmcblk0p1: UUID=”6725-6501″ BLOCK_SIZE=”512″ TYPE=”vfat” PARTUUID=”0e2887fb-01″
    /dev/mmcblk0p2: UUID=”98fa3b6b-e750-4e39-8191-3b4eae912463″ BLOCK_SIZE=”4096″ TYPE=”ext4″ PARTUUID=”0e2887fb-02″
    /dev/sda1: UUID=”6725-6501″ BLOCK_SIZE=”512″ TYPE=”vfat” PARTUUID=”0e2887fb-01″
    /dev/sda2: UUID=”98fa3b6b-e750-4e39-8191-3b4eae912463″ BLOCK_SIZE=”4096″ TYPE=”ext4″ PARTUUID=”0e2887fb-02″
    /dev/sda3: UUID=”65b6c8f8-0fde-42c2-8014-16d1c20701f7″ TYPE=”swap” PARTUUID=”0e2887fb-03″

    How to find out, if the SSD is working as intended?

{"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

Learn Something New with Free Email subscription

Email is also one of the ways to be in touch with us. Our free subscription plan offers you to receive post updates straight to your inbox.