Author

Topic: Need help--Moving blockchain to SD card on Linux (Read 1708 times)

full member
Activity: 227
Merit: 100
Thank you so much. It's working!
legendary
Activity: 2058
Merit: 1452
I want to run Bitcoin-qt from my laptop computer and have the blockchain stored on an attached USB pendrive as I'm running out of storage space on my laptop's Linux partition.

By the way I appreciate your help. Thanks.

Oh, in that case, just start bitcoin-qt:
Code:
./bitcoin-qt -datadir=path/to/usb
If you already have a copy of the blockchain downloaded, you can move it to usb (no detach needed). If you plan on using the same files on another computer, you'll need to run with the -detachdb option.
full member
Activity: 227
Merit: 100
What am I doing wrong? Any ideas?
Thanks.

Code:
~/Downloads/bitcoin-0.8.2-linux/bin/32 $ ./bitcoin-qt -detachdb=1 -datadir=
bash: syntax error near unexpected token `newline'
Don't bother with datadir. Use the steps from post #9. Then move the files from the existing data directory. Bitcoin's default datadir is in ~/.bitcoin/ (i think, not sure how the unix file system works).


OK. I left out -datadir and just did the following:
Code:
~/Downloads/bitcoin-0.8.2-linux/bin/32 $ ./bitcoin-qt -detachdb=1

When I do this Bitcoin-qt opens and starts reloading the entire blockchain from the beginning.
Maybe I'm not explaining what I want to do correctly.
I want to run Bitcoin-qt from my laptop computer and have the blockchain stored on an attached USB pendrive as I'm running out of storage space on my laptop's Linux partition.

By the way I appreciate your help. Thanks.
legendary
Activity: 2058
Merit: 1452
What am I doing wrong? Any ideas?
Thanks.

Code:
~/Downloads/bitcoin-0.8.2-linux/bin/32 $ ./bitcoin-qt -detachdb=1 -datadir=
bash: syntax error near unexpected token `newline'
Don't bother with datadir. Use the steps from post #9. Then move the files from the existing data directory. Bitcoin's default datadir is in ~/.bitcoin/ (i think, not sure how the unix file system works).
full member
Activity: 227
Merit: 100
What am I doing wrong? Any ideas?
Thanks.

Code:
~/Downloads/bitcoin-0.8.2-linux/bin/32 $ ./bitcoin-qt -detachdb=1 -datadir=
bash: syntax error near unexpected token `newline'


full member
Activity: 227
Merit: 100
Thanks. That's helpful. Linux is pretty user friendly these days so I figured I'd switch from Windoze to help avoid viruses.
legendary
Activity: 2058
Merit: 1452
I'm not tech savvy. When you say I have to execute "such and such" code I have no idea how to do this. Is this something I type into a certain file somewhere or in command line? Where exactly is this coding done?
Thanks.
You said you were using linux, so I assumed you were knowledgeable enough.

Anything in code boxes are to be executed in a terminal (type it in, hit enter). The commands are assuming you're in the directory where bitcoind is installed.
full member
Activity: 227
Merit: 100
you're using linux, so you have to execute (on the machine that the blocks came from):
Code:
./bitcoind -detachdb=1 &
./bitcoind stop
alternately:
Code:
./bitcoin-qt -detachdb=1
then exit the qt interface

after you have done this, the block database will be "detached" from the system. this means it can be moved to any other computer without issue. at the machine that you moved the blocks to, you may start bitcoin normally and resume operation as usual. if you have different wallets, you may need to run bitcoin with "-rescan=1".

I'm not tech savvy. When you say I have to execute "such and such" code I have no idea how to do this. Is this something I type into a certain file somewhere or in command line? Where exactly is this coding done?
Thanks.
legendary
Activity: 1176
Merit: 1280
May Bitcoin be touched by his Noodly Appendage
After detaching the db as the other post tell you and recopying the files, then if you want to actually use
the files on the card instead of copying them to ~/.bitcoin/, run "bitcoind -h" and look at all the options.

I think the one you want is "-datadir=".

Remember if you plan on using the card on different bitcoin clients you'd need to always use the
-detachdb option.

Beware, -datadir will search/put all the files of .bitcoin on the SD, including wallet.dat
newbie
Activity: 42
Merit: 0
Are you still experiencing this problem?
newbie
Activity: 40
Merit: 0
After detaching the db as the other post tell you and recopying the files, then if you want to actually use
the files on the card instead of copying them to ~/.bitcoin/, run "bitcoind -h" and look at all the options.

I think the one you want is "-datadir=".

Remember if you plan on using the card on different bitcoin clients you'd need to always use the
-detachdb option.
legendary
Activity: 2058
Merit: 1452
you're using linux, so you have to execute (on the machine that the blocks came from):
Code:
./bitcoind -detachdb=1 &
./bitcoind stop
alternately:
Code:
./bitcoin-qt -detachdb=1
then exit the qt interface

after you have done this, the block database will be "detached" from the system. this means it can be moved to any other computer without issue. at the machine that you moved the blocks to, you may start bitcoin normally and resume operation as usual. if you have different wallets, you may need to run bitcoin with "-rescan=1".
full member
Activity: 227
Merit: 100
the blockchain database can't be transferred between computers. they must be "detached" first. to do that, run bitcoin with "-detachdb=1" and exit. then you should be able to copy+paste your entire /.bitcoin/ directory.

Sorry I forgot to add that I'm not that tech savvy.
So, I go into the config file and make the detachdb=1 change and then restart bitcoinqt?
How do I let the client know where to find the data after I detach it?

Also, I have already cut and pasted the data prior to detaching it.
Does this mean I have to redownload the blockchain?  Sad
legendary
Activity: 2058
Merit: 1452
the blockchain database can't be transferred between computers. they must be "detached" first. to do that, run bitcoin with "-detachdb=1" and exit. then you should be able to copy+paste your entire /.bitcoin/ directory.
full member
Activity: 227
Merit: 100
I moved my "blocks" and "chainstate" folders to a 64GB card.
How do I tell BitcoinQt that the files are there and not to redownload the entire blockchain?
I'm using Linux.
Thanks.
Jump to: