Difficulty Level: 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 drive (preferably a SSD drive) without the need for a microSD.
What we need:
- Raspberry Pi 4B (ideally 4 or 8 GB model)
- USB drive (you should use a SSD with USB 3.0)
- microSD card (only if you don’t run the latest bootloader already)
- Secondary backup drive with a
nextcloud_bkpof all your data, (
nc-backup) & a
ncp-config backupof our configurations (
export-ncp) on a separate drive.
- Backup all your data and configs to a separate drive using
- 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.)
- login into your Pi using SSH
sudo apt update&
sudo apt upgrade
sudo rpi-eeprom-updateto see if an update is available.
- if there is, type:
sudo rpi-eeprom-update -ato update
- Power off the pi (
sudo shutdown now)
- Disconnect all of your attached data drives and remove the SD card from the Pi.
- Flash the latest Image “NextCloudPi_Rpi_xx-xx-xx.img” to the USB media.
- 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 Pi) and activate NCP (don’t forget to note the passwords)
Do not attempt to use the web panel to format a USB device with this setup!
- In rare cases the RaspberryPi might refuse to 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 recommendable 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 USB 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, you can use a powered USB Hub.
Congratulations, you are done. Please leave a comment in the Forum if you succeeded or have issues. It helps to improve this documentation.