Bitcoin Forum
July 23, 2018, 06:54:04 AM *
News: Latest stable version of Bitcoin Core: 0.16.1  [Torrent]. (New!)
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Power cuts corrupting bitcoin core db  (Read 1977 times)
doof
Hero Member
*****
Offline Offline

Activity: 765
Merit: 501


View Profile WWW
October 25, 2014, 12:30:07 PM
 #1

I've had a few power cuts on an ubuntu box running bitcoind which requires me to re-index the blockchain.  Is it possible to shut down bitcoind each night, backup the chain state and block height, then restart bitcoind?  Then if a power failure occurs, I can just restore last good chain state?
1532328844
Hero Member
*
Offline Offline

Posts: 1532328844

View Profile Personal Message (Offline)

Ignore
1532328844
Reply with quote  #2

1532328844
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1532328844
Hero Member
*
Offline Offline

Posts: 1532328844

View Profile Personal Message (Offline)

Ignore
1532328844
Reply with quote  #2

1532328844
Report to moderator
Dare
Hero Member
*****
Offline Offline

Activity: 504
Merit: 500


Techwolf on #bitcoin and Reddit


View Profile WWW
October 26, 2014, 06:41:47 AM
 #2

I've had a few power cuts on an ubuntu box running bitcoind which requires me to re-index the blockchain.  Is it possible to shut down bitcoind each night, backup the chain state and block height, then restart bitcoind?  Then if a power failure occurs, I can just restore last good chain state?

Potentially, yes; look into using rsync or a filesystem with checkpoints for your backups. However, depending on the severity and duration of the power cuts, it may be easier to buy a UPS to allow your ubuntu box to keep running through a power failure (or failing that, at least provide it with plenty of time to shut down safely).

BTC: 1M8oUcBnkRDEhWWgV8ZXLTB6p1mgnejVbX
How Forum Activity Works
Bitcointalk Forum Rules
|
|
|
Firstbits (lucky vanitygen): 1WoLfRUGDx1
How Forum Trust Works
Bitcoin Source Code
doof
Hero Member
*****
Offline Offline

Activity: 765
Merit: 501


View Profile WWW
October 27, 2014, 05:05:45 AM
 #3

UPS is being looked at, just ads cost and complexity.  Looking for software methods first.
deepceleron
Legendary
*
Offline Offline

Activity: 1512
Merit: 1000



View Profile WWW
October 27, 2014, 06:55:06 AM
 #4

XFS with checkpoints every hour, then besides having a robust journal that can be replayed when powering up, you can roll back to a previous checkpoint.
doof
Hero Member
*****
Offline Offline

Activity: 765
Merit: 501


View Profile WWW
October 28, 2014, 12:52:24 AM
 #5

XFS with checkpoints every hour, then besides having a robust journal that can be replayed when powering up, you can roll back to a previous checkpoint.

Thanks for the tip.  Looking at xfs now.
doof
Hero Member
*****
Offline Offline

Activity: 765
Merit: 501


View Profile WWW
October 28, 2014, 10:16:52 PM
 #6

XFS with checkpoints every hour, then besides having a robust journal that can be replayed when powering up, you can roll back to a previous checkpoint.

Hi Deepceleron,

I've formatted the drive with Blockchain and coinstate on them to xfs.  I cant find any documentation on "checkpoints".  Can you point me to some or otherwise?
deepceleron
Legendary
*
Offline Offline

Activity: 1512
Merit: 1000



View Profile WWW
October 29, 2014, 04:37:26 AM
 #7

Derp, I'm a dummy. I meant ZFS. (if it was ReiserFS I probably wouldn't have mistyperemembered)

http://docs.oracle.com/cd/E19253-01/819-5461/gavvx/index.html
doof
Hero Member
*****
Offline Offline

Activity: 765
Merit: 501


View Profile WWW
October 29, 2014, 10:56:43 AM
 #8

Derp, I'm a dummy. I meant ZFS. (if it was ReiserFS I probably wouldn't have mistyperemembered)

http://docs.oracle.com/cd/E19253-01/819-5461/gavvx/index.html
No tip for you!

Trying to follow this article (Ubuntu 14 server), getting the following error.  Any ideas?  No really hits on google.
http://arstechnica.com/information-technology/2014/02/ars-walkthrough-using-the-zfs-next-gen-filesystem-on-linux/1/

ubuntu@xxx:~$ sudo apt-get install ubuntu-zfs
sudo: unable to resolve host TenThousandAndOne
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package ubuntu-zfs
deepceleron
Legendary
*
Offline Offline

Activity: 1512
Merit: 1000



View Profile WWW
October 29, 2014, 06:36:14 PM
 #9

I personally have only used it on BSDs. Here is a write-up and overview on Linux: https://clusterhq.com/blog/state-zfs-on-linux/

A better starting point for installation looks to be: https://github.com/zfsonlinux/pkg-zfs/wiki/Ubuntu-ZFS-mountall-FAQ-and-troubleshooting
doof
Hero Member
*****
Offline Offline

Activity: 765
Merit: 501


View Profile WWW
October 30, 2014, 09:19:19 AM
 #10

Thanks.  The 2gb memory might be an issue.  Lets hope this FS is a little more robust.  I've set a cron job to shut down bitcoind each night, and rsync chain state and database dirs.  Then restart.

If in the event of a power cut, Im hoping i can just rsync back.
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!