You can tell the Raspberry Pi to use your usb drive as your root file system (rootfs). That would fix the problem.
I am also running a full node on RPi 4 and a 1TB SSD, and what I did was to flash Rasbian in the SSD as well as in the SD card. Then, after booting for the first time the RPi with the SD card and with the SSD unplugged, I told the RPi to boot from the SSD like this:
- Connect your USB Hard drive to the RPi.
- Change the id of the drive to something different so the RPi can differentiate the SD card from the drive. Let's set the id to 0xd34db33f by doing this:
sudo fdisk /dev/sda
Enter the next values to the options that are going to pop up next:
Command (m for help): p
Command (m for help): x
Expert command (m for help): i
Enter the new disk identifier: 0xd34db33f
Expert command (m for help): r
Command (m for help): w
- Check that the PARTUUID of the SD card and the drive are different now by using the following command:
sudo blkid
the "/dev/mmcblk0p1" and "/dev/mmcblk0p1" are referencing the SD card, and the "/dev/sda1" and "/dev/sda2" are referencing the drive. So the PARTUUID of the sda1 and sda2 must be the one that we just setup (d34db33f) followed by a dash and the number of the partition.
- Modify the cmdline.txt file to tell the RPi to boot from your drive like this:
sudo cp /boot/cmdline.txt /boot/cmdline.txt.bak
sudo nano /boot/cmdline.txt
Once in the file, find the variable root=PARTUUID=#######-02 and change it to the one that we just set. The line should look like this:
console=serial0,115200 console=tty1 root=PARTUUID=d34db33f-02 rootfstype=ext4....
Exit by pressing CTRL + X, Then "Y" to save changes, and then ENTER to confirm.
- Reboot the RPi:
sudo reboot
- Make sure the RPi is booting from the drive:
findmnt -n -o SOURCE /
if it shows
dev/sda2
then your good. If not, just recover your cmdline.txt file by using the backup we saved, and start over.
- Finally, we will tell the RPi to mount automatically the drive and use it as the file system by modifying the fstab file:
sudo nano /etc/fstab
Once in the file editor, modify the second PARTUUID to the id we setup earlier. The file should look like this after modification:
proc /proc proc defaults 0 0
PARTUUID=########-01 /boot vfat defaults 0 2
PARTUUID=d34db33f-02 / ext4 defaults,noatime 0 1
CTRL + X, Y, and ENTER to save changes.
- Reboot the RPi again, and That's it!
I had to resize my SSD after this, but I am not sure if you will have to. If you do, or if you need more details, this is the tutorial I followed:
https://jamesachambers.com/raspberry-pi-4-usb-boot-config-guide-for-ssd-flash-drives/
All credits for the guy of the tutorial.
/dev/sda1
mounted at/mnt/hdd
. Maybe you should mount it at~/.bitcoin
instead. ALternatively you could make~/.bitcoin
a symbolic link to a directory under/mnt/hdd
. It will be necessary to backup (e.g.tar
or rename) the existing contents of~/.bitcoin
before making either change and restore afterwards.