29 Apr 2017, 04:48

Changing the Ethereum data directory

This is mostly a note for myself. I’ve dabbled a little with various crypto-currencies and my current interest is in Ethereum.

Unfortunately, the Ethereum data directory can be pretty big. 136GB is the current size on my disk.

No way I want that sitting on my fast, but small, M2 primary drive.

Notes: 1. This guides is for Windows only. 2. Attempt 1 is messy, but might improve in the future.

Attempt 1: Pass an argument

Geth, the main Ethereum client, can take an argument of –datadir. At first blush, this looks exactly what you’d need.

However, at this time, it falls flat as many other Ethereum related tools don’t have overrides, or call their own version of Geth without the argument.

This method is my current preferred approach. It tells the operating system to create a junction to another location. In my case, I ran this from a Administrator command prompt:

mklink /J c:\users\jd\AppData\Roaming\Ethereum Z:\eth\data

The /J indicates that we’re creating a junction for a directory, not a file.

You’ll likely already have a Ethereum folder which is partly what led you to this post. I closed all the Ethereum apps down, copied the directory to my Z drive. I then renamed the existing folder to _Ethereum in case I needed it back. Then I ran the command.

Now, all Ethereum apps with respect the new data location on another drive.