How to resync Geth
A common reason for Geth to fail can be an unexpected shutdown of a validator machine. Geth uses RAM for temporary memory and during a graceful shutdown some important information will be written to disk. However, during an unexpected shutdown, there isn't time to write to disk (e.g. due to a sudden loss of power) so important data is lost. This loss of data leads to a corruption of the chaindata
folder, requiring a resync.
File Locations
-
Standard location of the
* Standard location of thechaindata
folder.ancient
folder.
Steps (If the ancient folder exists)
Good news! The required resync can be made much faster than a full resync simply by keeping the ancient
folder. The ancient folder contains files that are not corrupted during an unexpected shutdown.
- Stop Geth.
-
Move the
3. Delete theancient
folder.chaindata
directory and recreate it. 4. Move the ancient folder back to the now empty chaindata directory. 5. Change the ownership of thechaindata
directory to the Geth user. 6. Start Geth.
Congratulations! You've successfully started a Geth resync 🥳
Steps (If the ancient folder does not exist)
If the ancient folder does not exist, that's not a problem. It just means you will need to resync Geth from scratch, which will take a bit longer.
- Stop Geth.
-
Delete the
3. Confirm the ownership and permissions for thechaindata
directory and recreate it.chaindata
directory are set to the Geth user. 4. Start Geth.
Congratulations! You've successfully started a Geth resync 🥳