1

I was following @meeDamian Bitcoin node guide on a Raspberry Pi 3 and could get almost everything to work except that it stores the Blockchain on my USB Harddrive. Its mounted and I have disk space but it puts everything in my root folder.

Where and how can I specify that it gets stored on my USB Drive and can I just the delete the files in folder "blocks"

Thanks for your help

IMG: Node Logfile + Filesystem

Bitcoin Log + Filesystem

2
  • You have /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. Apr 16, 2020 at 9:12
  • Hi thanks, It now works. I had to copy the .bitcoin folder onto my USB drive first and than delete the original .bitcoin. After that the symbolic link worked fine. Before that the symbolic link always created a subfolder as if its not allowed to change the folder type from regular folder to symbolic link. Apr 17, 2020 at 9:42

1 Answer 1

0

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:

  1. Connect your USB Hard drive to the RPi.
  2. 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
  1. 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.

  1. 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.

  1. Reboot the RPi:
sudo reboot
  1. 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.

  1. 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.

  1. 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.

Not the answer you're looking for? Browse other questions tagged or ask your own question.