Go-ethereum: Ethereum data directory path hardwired to C:\Users\user\AppData\Roaming\Ethereum

Created on 17 Jul 2016  路  10Comments  路  Source: ethereum/go-ethereum

System information

Geth version: 1.4.10 and below
OS & Version: Windows 10 64bit
Commit hash : (if develop)

Expected behaviour

Geth should respect the correct OS roaming path and not default to the C: drive.

Actual behaviour

Ethereum blockchain data is being written to C:\Users\user\AppData\Roaming\Ethereum even when the OS location had moved.

Steps to reproduce the behaviour

The blockchain data was taking a lot of room on my C: drive so I changed the location of the path C:\Users\user\AppData\Roaming (which contains the Ethereum data folder for the blockchain data) to D:\Roaming.

When I start the wallet there is a error message that it cannot find the node and so it begins to download the whole blockchain again to the path C:\Users\user\AppData\Roaming\Ethereum

As the blockchain will get bigger and bigger a lot of people will want to move the data folder to a bigger drive as the C drive is to small and has all the OS programs and data.

Backtrace

[backtrace]

Most helpful comment

Thanks, I know about the CLI parameter but is there a way to persist this in a config file or something comparable?

All 10 comments

Linking Mist issue:

[...] Currently geth will query the user's home directory and expands to it:

home := HomeDir()
filepath.Join(home, "AppData", "Roaming", "Ethereum")

This is a known issue, but not that big since you can always manually point geth to a data directory of your choice with --datadir D:\Ethereum for example.

That is a good solution but most people will not know automatically unless they do a bit of research and people who have moved the OS roaming location will see that Geth is still using the default OS roaming location.

A lot of laptops / PCs these days have small C: SSD drives so moving the default OS roaming location will be commonplace.

Just noting: we have also received requests to move the chain to AppData\Local instead.

AppData\Local is also fine as long as Geth respects the OS location path of the folder.

In Ethereum Wallet app in Windows, on Install, the user can now choose the location of the chaindata.

Is there a way to change the default datadir through config so that it persists?

--datadir=your_favorite_folder

Thanks, I know about the CLI parameter but is there a way to persist this in a config file or something comparable?

Download geth on to second drive. Move your original Ethereum to your new location on a different drive. (I put it on a different machine and mapped a drive to that location) Then you can create a link to new Ethereum location with: mklink /D C:\Users\Name\AppData\Roaming\Ethereum G:\Ethereum Then run geth from g:\

Was this page helpful?
0 / 5 - 0 ratings