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
chaindata
folder.Standard location of the
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
ancient
folder.Delete the
chaindata
directory and recreate it.Move the ancient folder back to the now empty chaindata directory.
Change the ownership of the
chaindata
directory to the Geth user.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
chaindata
directory and recreate it.Confirm the ownership and permissions for the
chaindata
directory are set to the Geth user.Start Geth.
Congratulations! You've successfully started a Geth resync ๐ฅณ
Last updated