- This wiki attempts to create a beginner-friendly âhow-to guideâ to boot your NCP from a USB media.
- I have updated the doc, accordingly.
- You are most welcome to contribute, by commenting and editing this (wiki).
Difficulty Level: easy
Why would you want to boot from a USB drive?
It is faster and a SSD has a far longer life expectancy as the microSD. So as a home user who wants to have a working system over several years I highly suggest 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 and data.
- Warning: You will not be able to format any USB device 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
or
- 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 updatet 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 ncp 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.
- (if your Pi refuses to boot from USB try to change the boot order manually)
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)
Restore your Backup
1. Restoring NCP Settings
-
Login to the NextcloudPi web panel (at nextcloudpi.local)
-
On the left in the section âSystemâ choose ânc-automountâ and activate it.
-
login to your pi via SSH (ssh pi@IP-ADDRESS | pswd: raspberry)
-
update the pi with
sudo apt update
&sudo apt upgrade
-
update ncp by typing
sudo ncp-config
-
Type
df -h
to list attached drives. -
Look for your backup drive and type:
ls /media/BACKUP-DRIVE/
-
You should see a list of your backups.
-
Look for the
config-backup
and note its name:ncp-config_XXXXXXXX.tar
-
Go back to the NextcloudPi web pannel (at nextcloudpi.local)
-
On the left in the section
Backups
choosenc-import-ncp
-
Fill in
path
andfile name
and hitapply
-
This will not take long as it only restores your
ncp settings
.
(You will not have any user or data restored. This we will do in the follwing step.)
2. Restoring the data-backup
(the process for the dateless and full backup is the same)
- Follow step 1-7 from the description above
- Look for the backup file and note its name:
nextcloud-bkp_XXXXXXXX_XXXXXXXXXX.tar
- Go back to the NextcloudPi web pannel (at nextcloudpi.local)
- On the left in the section
Backups
choosenc-restore
- Fill in path and file name and hit apply
- Depending on your backup size this can take a very long time.
- Once the backup has been restored successfully reboot NCP using the web pannel (top right) or just reboot the pi with SSH
sudo reboot now
- Now you will be able to login with your former login and all your data, apps and users should be restored.
Note:- The web panel login will not be restored, so you will have to use the one you got when you first activated (Installation: Step 2).
-
Do not attempt to use the web panel to format a USB device!
Congratulations, you are done. Please leave a comment if you succeeded or have issues. It helps to improve this documentation.
Note: 02.January 2021: I have followed this tutorial myself and succeeded.