free up space by deleting blocks

0

I've run into an issue where a bitcoin partition reached 100%.

I created a new partition and try to move the whole Bitcoin directory over, but I seem to be handicapped by "no space left on device" errors.

enter image description here

nyc1_04 is my new mounted volume. I've started the copy process which eventually failed with "no space left on device" and now all operations seem to fail.

i've already tried apt autoremove and apt-get clean.

what are some files i could delete in existing Bitcoin core folder to free up a little space but make it rebuildable when service restarts?

Sonic Soul

Posted 2018-08-27T13:03:50.883

Reputation: 141

Answers

2

Depending on your requirements, you can run in prune mode:

$ bitcoind -prune <max-MiB>

-prune= Reduce storage requirements by enabling pruning (deleting) of old blocks. This allows the pruneblockchain RPC to be called to delete specific blocks, and enables automatic pruning of old blocks if a target size in MiB is provided. This mode is incompatible with -txindex and -rescan. Warning: Reverting this setting requires re-downloading the entire blockchain. (default: 0 = disable pruning blocks, 1 = allow manual pruning via RPC, 550 = automatically prune block files to stay under the specified target size in MiB)

see https://bitcoin.stackexchange.com/a/37497/60443

JBaczuk

Posted 2018-08-27T13:03:50.883

Reputation: 6 172

hi thanks i am trying to avoid prune mode. I have the necessary space just need to move / copy my blocks to the new mounted volume. also not sure the service would start with prune mode considering i am getting the error on every operation because no space is leftSonic Soul 2018-08-27T15:51:11.760

it seems the OS needs a little space even for moving files out, which is why it is not letting me move out of 100% full volumeSonic Soul 2018-08-27T15:53:14.280

Oh, that doesn't match the title of your question. Are you sure about that assumption, that it's referring to the local disk and not the new volume? How is it formatted?JBaczuk 2018-08-27T15:59:57.167

the title means, can i manually delete some blocks to free up space.

as for the new mounted volue, it appears to have 330 gigs free space

/dev/sda ext4 348G 67M 330G 1% /mnt/volume_nyc1_04 – Sonic Soul 2018-08-27T16:26:05.093

although you may be onto something! when i try to copy files to the new volume i get this error:

cannot create regular file '/mnt/volume-nyc1-04/Bitcoin/Bitcoin/blocks/blk01342.dat': No space left on device – Sonic Soul 2018-08-27T16:36:38.350

i tried re-formatting it and attempting another copy, it seems to be in progress, let's hope it succeeds :| im just confused how that filling up seems to have also filled up the main 80GB partition?!Sonic Soul 2018-08-27T16:45:24.407

i moved to a bigger volume. that all succeeded but now when i try to start the service it fails.

Process: 1690 ExecStart=/usr/bin/bitcoind -daemon -pid=/mnt/volume-nyc1-04/Bitcoin/bitcoind.pid -conf=/home/bitcoin/.bitcoin/bitcoin.conf -datadir=/mnt/volume-nyc1-04/Bitcoin (code=exited, status=1/FAILURE) – Sonic Soul 2018-08-27T18:12:16.993

think i figured it out. was access issue since i used root acct to map/move data and new folders were not accessible :) whew..Sonic Soul 2018-08-27T19:01:09.787

glad you got it working!JBaczuk 2018-08-27T19:02:57.020