<p>The easiest way to do this according to the <a href="https://en.bitcoin.it/wiki/Running_Bitcoin" rel="nofollow noreferrer">Bitcoin Core Wiki</a> is to append the <strong>datadir</strong> option after running <code>bitcoind</code> to launch the client <a href="https://www.reddit.com/r/Bitcoin/comments/7gzsgp/change_location_of_bitcoin_core_data/" rel="nofollow noreferrer">according to the following syntax:</a> </p>

<ul>
<li><code>bitcoind -datadir=/media/myusername/backup/.bitcoin</code> </li>
</ul>

<p>example provided thusly:</p>

<ul>
<li><code>bitcoind -datadir=/media/alexanderjsingleton/SEAGATE/.bitcoin</code></li>
</ul>

<p>Also, don't forget to mount the external USB hard-drive by using the <code>ls -l /dev/disk/by-uuid/</code> <a href="https://www.alexanderjsingleton.com/how-to-run-a-bitcoin-full-node-on-a-raspberry-pi-b/" rel="nofollow noreferrer">option by command line</a> or by <a href="https://askubuntu.com/questions/547965/mounting-external-hard-disk-for-all-users-at-start-up-in-ubuntu-14-04">GUI-method</a>.</p>

CC BY-SA 4.0
2021-08-03T08:00:48.703Z
Unfortunately, this also moves the wallet.dat file to the new location. Not what the OP was looking for, I think...
bitsmack
CC BY-SA 4.0
2019-10-04T23:13:46.473Z
2019-11-13T19:16:03.960Z
2019-11-13T19:16:03.960Z
alexanderjsingleton
<p>Also, after bitcoin(d)  link creates the ~/.bitcoin folder, you can add a link to external drive.</p>

<pre><code>cd ~/.bitcoin
rm -rf ./blocks
rm -rf ./chainstate
ln -s /data/btc_blocks ./blocks
ln -s /data/btc_chainstate ./chainstate
</code></pre>

<p>remove original block and chainstate though.</p>

CC BY-SA 4.0
2021-08-03T13:49:29.967Z
This is true, but don't forget to copy the blocks and chainstate folders first! These instructions delete the existing data and remap the directories, but then you'd need to do another full "initial block download". (And make sure you stop the bitcoin daemon first)
bitsmack
CC BY-SA 4.0
2019-12-07T08:08:27.487Z
2019-12-07T08:08:27.487Z
Иван Зернов
<p>I have experience with <a href="https://www.alexanderjsingleton.com/how-to-run-a-bitcoin-full-node-on-a-raspberry-pi-b/" rel="nofollow noreferrer">secure-copy</a> and <a href="https://www.alexanderjsingleton.com/running-lightning-on-a-raspberry-pi-with-raspiblitz/" rel="nofollow noreferrer">secure-download</a> but how do I move <strong><em>only</em></strong> the Bitcoin Client "blocks" and "chainstate" folders within the home directory of Ubuntu 18.04 to an external USB hard-drive while running the Bitcoin Client on the connected laptop with limited storage on board?  I'd sincerely appreciate the best-practice or recommended approach for hosting a Bitcoin full-node on a laptop with an external USB hard-drive since I am also attempting to run Blockstream and FIBRE on this environment- thank you</p>

<bitcoin-core><ubuntu><blockstream><fibre>
How to move only "blocks" and "chainstate" folders on an external USB hard-drive while running Bitcoin Client on connected laptop with Ubuntu?
alexanderjsingleton
# How to move only "blocks" and "chainstate" folders on an external USB hard-drive while running Bitcoin Client on connected laptop with Ubuntu?

(Asked by: username_0 on 2019-09-27)

I have experience with [secure-copy](https://www.username_0.com/how-to-run-a-bitcoin-full-node-on-a-raspberry-pi-b/) and [secure-download](https://www.username_0.com/running-lightning-on-a-raspberry-pi-with-raspiblitz/) but how do I move ***only*** the Bitcoin Client "blocks" and "chainstate" folders within the home directory of Ubuntu 18.04 to an external USB hard-drive while running the Bitcoin Client on the connected laptop with limited storage on board? I'd sincerely appreciate the best-practice or recommended approach for hosting a Bitcoin full-node on a laptop with an external USB hard-drive since I am also attempting to run Blockstream and FIBRE on this environment- thank you

**Tags:** bitcoin-core, ubuntu, blockstream, fibre


---

## 2 answers

### Answer by username_0 on 2019-10-04. Score: 0 | Accepted answer

The easiest way to do this according to the [Bitcoin Core Wiki](https://en.bitcoin.it/wiki/Running_Bitcoin) is to append the **datadir** option after running `bitcoind` to launch the client [according to the following syntax:](https://www.reddit.com/r/Bitcoin/comments/7gzsgp/change_location_of_bitcoin_core_data/)

* `bitcoind -datadir=/media/myusername/backup/.bitcoin`

example provided thusly:

* `bitcoind -datadir=/media/username_0/SEAGATE/.bitcoin`

Also, don't forget to mount the external USB hard-drive by using the `ls -l /dev/disk/by-uuid/` [option by command line](https://www.username_0.com/how-to-run-a-bitcoin-full-node-on-a-raspberry-pi-b/) or by [GUI-method](https://askubuntu.com/questions/547965/mounting-external-hard-disk-for-all-users-at-start-up-in-ubuntu-14-04).

> **Comments:**
> **username_1**: Unfortunately, this also moves the wallet.dat file to the new location. Not what the OP was looking for, I think...  

---

### Answer by username_2 on 2019-12-07. Score: 1

Also, after bitcoin(d)  link creates the ~/.bitcoin folder, you can add a link to external drive.
cd ~/.bitcoin
rm -rf ./blocks
rm -rf ./chainstate
ln -s /data/btc_blocks ./blocks
ln -s /data/btc_chainstate ./chainstate

remove original block and chainstate though.

> **Comments:**
> **username_1**: This is true, but don't forget to copy the blocks and chainstate folders first! These instructions delete the existing data and remap the directories, but then you'd need to do another full "initial block download". (And make sure you stop the bitcoin daemon first)  

---

