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.
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
- 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_bkp
of all your data, (nc-backup
) & ancp-config backup
of our configurations (export-ncp
) on a separate drive.
Preparation:
- Backup all your data and configs to a separate drive using
nc-backup
&export-ncp
. - 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
- type:
sudo apt update
&sudo apt upgrade
- type:
sudo rpi-eeprom-update
to see if an update is available. - if there is, type:
sudo rpi-eeprom-update -a
to update
- Power off the pi (
sudo shutdown now
) - Disconnect all of your attached data drives and remove the SD card from the Pi.
Installation
- 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)
Note:
Do not attempt to use the web panel to format a USB device with this setup!
Congratulations, you are done. Please leave a comment in the Forum if you succeeded or have issues. It helps to improve this documentation.
Updated: 2021.01.03