Raspberry PI 4 – Booting from USB Device (no microSD)

Difficulty Very Easy

Why would you want to boot from a USB drive?

  • It is faster and a SSD has a far longer life expectancy than a microSD. Therefore, as a home user who wants to have a working system over several years, it is highly suggested doing this. (You could of course also use an HDD, but it would spin 24/7.)

  • Warning : You will not be able to keep the data on your USB drive as you have to flash the .img to it. A backup is therefore required to restore settings, users and data.

  • Warning : You will not be able to format USB devices any more using the NCP web panel and will have to do it manually by using the terminal.

  • Warning : You will not be able to use nc-snapshot because your USB drive will be an ext4 filesystem and not BTRFS. (you could, however, partition the drive manually - Difficulty Level: advanced)

  • Warning : The RaspberryPi 4 has issues providing enough power to USB devices. Consider using an externally powered case for the SSD (see Troubleshooting below).

What we have

  • No setup yet
  • NCP on Raspberry Pi 4 booting from microSD with external USB drive for data.
    (If you are still using a armhf image (32bit) you will have updated to arm64 after following this guide)

What we want

  • NCP runs from a USB 3.0 connected drive (preferably an SSD) removing the need for microSD.

What we need:

  • Raspberry Pi 4B (ideally 4Gb or 8Gb model)
  • USB drive (recommended to use an SSD with USB 3.0)
  • microSD card (only if you don’t run the latest bootloader already)
  • Secondary backup drive with a nextcloud_bkp of all your data, (nc-backup) & a ncp-config backup of our configurations (export-ncp) on a separate drive.

Preparation:

  1. Backup all your data and configs to a separate drive using nc-backup & export-ncp

  2. If your bootloader is not up-to-date, or you are not sure about it, update it to the latest version.
    (A more complete ‘how to’ you find here or, if you set up a new Pi follow this documentation)

    1. Login to your Pi via SSH
    2. Type: sudo apt update & sudo apt upgrade
    3. Type: sudo rpi-eeprom-update to see if an update is available.
    4. If there is, type: sudo rpi-eeprom-update -a to update
  3. Power off the pi (sudo shutdown now)

  4. Disconnect all of your attached data drives and remove the SD card from the Pi.

Installation

  1. Flash the latest Image from Github named “NextCloudPi_RaspberryPi_vX.XX.X.zip” to the USB media.

  2. Connect the Pi to Ethernet, plug in the drive and boot. Give it a few minutes and then go to https://nextcloudpi.local or use the IP address of the device and activate NCP (don’t forget to note the passwords)

:: Note ::
Do not attempt to use the web panel to format a USB device with this setup!

Troubleshooting

  • In rare cases the RPi might not boot from USB even if you are on the latest EEPROM.
    You can attempt to resolve this by manually changing the boot order.

  • Some users have reported random shutdowns and errors due to power issues. It is recommended to use an externally powered USB drive.
    Try something like the “LogiLink UA0115” case, it has two USB cables, one USB3 for data and one for power only. If you plug in the USB3 to the Pi’s USB3 port and the USB for power to the Pi’s USB2 port, it seems to solve the power issue. Alternatively, the easier solution is to use a powered USB hub or a drive that has its own power.

Congratulations, you’re done! :partying_face:

We hope this doc was helpful, if you encounter any issues please reach out to the community.
These docs are written by volunteers, please consider becoming one of them.
Contact the wiki team at Matrix or Telegram

A post was merged into an existing topic: About moving the articles

Does anyone know if that “y cable trick” works for other cases too?
I have a case with a normal USB C port (no superspeed like the linked LogiLink case does).
Only few I could find are those:

I don’t know, technically speaking it should hypothetically work however I’d highly recommend using an external drive with its own power cable/delivery rather than powering it through the pi’s usb ports, even if you split it up with data on one and power on the other the pi is still a low power device and you might encounter power issues during heavy loads in that setup.