Change default blockchain download directory. How to?

How can I tell Umbrel to download the blockchain into an external HDD instead of the default location?
I tried editing “umbrel/app-data/bitcoin/docker-compose.yml” file, but I don’t how which line to modify and what to modify exactly. Can someone shed some light on this?

Hi there,

I am here to try to help you as I did this process in the past, the first thing is i don’t recommend you to use an HDD as it has lower writing/reading speeds ad as it has mobile parts its lifespan would be reduced, instead try with an SSD of an NVME if possible.

Check this guide as it helped me solve this when i needed it:

Let me know if you did it successfully.

I already followed that guide yesterday, but to no avail. It looks a bit outdated to me, as the bitcoin section is not present anymore in the docker-compose.yml file (umbrel 0.5.4). Now it only has a bitcoind section, which seems to control other parts of the software, but not the blocks directory. Thanks anyway.

I see, then in this case what you can do is the following (i don’t have the exact commands)

  1. Assuming you already have your drive mounted, find the way to mount it to the same location automatically on boot.
  2. inside the destination drive if you have nothing, create the blocks and chainstate folders.
  3. Create a symlink of both folders that are already in the path ~/umbrel/app-data/bitcoin/data/bitcoin to the destination.

To check they are correctly liked you can do for example the command stat ./blocks

Clarification: in the following screenshot you are going to see it with the bitcoin directory as I basically created a symlink to a drive that already had my umbrel installation before
So in your case what it shows for me as " File: bitcoin → /mnt/ssd/umbrel/app-data/bitcoin/data/bitcoin/", for you it should be "FIle: blocks → /mnt/{the folder you mounted the drive in}/blocks

Reboot and you should be good to go.

PD: Make sure to take the docker-compose file to it’s default state if you modified it, as this should work as if nothing had changed in the system.

1 Like

Did that and:

filesystem error: cannot create directories: File exists [/data/.bitcoin/blocks]

It looks like umbrel is not prepared to work with symlinking or maybe I’m doing something wrong.

Hmmm it seems that i made a mistake if you followed my steps, apparently you don’t need to create the directories innitially, better check at this guide.

And sure Umbrel is prepared to work with symlinks, as it is on a linux system, also with symlinks is the way my node works as I have two different drives in the same server.

Bear with me Dionisius, we are almost there. Maybe I created the symlink in the wrong way as it is my first time. The commands I am executing are:

cd ~/umbrel/app-data/bitcoin/data/bitcoin/
ln -sv /media/blockchain/bitcoin/blocks/

But then I see this error:

ln: failed to create symbolic link './blocks': File exists

Maybe I cannot link two folders with same name? Should I use a hard link instead of a soft link? What is going on?

If I detete the directories manually and create the symlink, I am probably going to see this error again:

filesystem error: cannot create directories: File exists [/data/.bitcoin/blocks]

Thank you and regards.

PD: I even tried to symlink the files instead of the directories, but to no avail:

ln -sv /media/blockchain/bitcoin/blocks/*

That command gives me this error:

ln: target '/media/blockchain/bitcoin/blocks/rev03967.dat': Not a directory

Don’t know what else to do.

1 Like

For some reason i didn’t see your notification, did you solve this in the end?

I would say a soft link.

In this case you can try deleting the blocks folder in the new drive, and point the symlink to the folder blocks were the data is going to be, if you try to create a symlink in the ~/umbrel/app-data/bitcoin/data/bitcoin/ but in this there is already a blocks folder, it would give an error, as the system will think there would be two folders with the exact same name which is not possible.

Hope you can solve it :slight_smile:

Would be good to create an updated guide about this.

1 Like

Hi Dionisius, I was following your tutorial and also got stuck when I saw that the Bitcoin section in the docker-compase.yml file was different. I’m a noob so don’t know how to follow your new steps without knowing what the commands are? Would it be possible to update your tutorial perhaps?
Thanks!

Hey Green_goblin, did you come right doing this? I have the same issues / errors with trying to move my blocks over to SSD. I’m running Ubuntu 22.04.3 on my old MAcAir and trying to move to a 1TB SSD.

No sorry, same problem, I cannot solve it. I purchased a 2 TB SSD to store the blockchain internally, and now that I copied the entire blockchain into the defaults directories, I see this error:

Error: Unable to open settings file /data/.bitcoin/settings.json.tmp for writing

We will see if I can fix it…

Fuck it, I’m tired, so I’m going to download the blockchain from scratch.

Popping in to say that I’m getting the same error trying to symbolically link the blocks directory:

bitcoind_1 | filesystem error: cannot create directories: File exists [/data/.bitcoin/blocks]

Is this a bitcoind issue?