<p>Since you are probably starting the daemon with a non-standard data directory, you'll need to specify the datadir every time you use the bitcoin-cli command, like this:</p>
<pre><code>bitcoin-cli -datadir=/mnt/bitcoin YOUR_COMMMAND
</code></pre>
<p>Source: <a href="https://howchoo.com/bitcoin/run-bitcoin-full-node-raspberry-pi" rel="nofollow noreferrer">https://howchoo.com/bitcoin/run-bitcoin-full-node-raspberry-pi</a></p>

CC BY-SA 4.0
2022-02-02T01:57:34.840Z
I already re-formatted my hard drive, thank you for the help though
JC43
CC BY-SA 4.0
2022-01-31T16:31:51.000Z
2022-01-31T16:31:51.000Z
rudyrich
<p>I asked this question on AskUbuntu and was told to post it here.</p>
<p><a href="https://askubuntu.com/q/1373657/1519292">https://askubuntu.com/q/1373657/1519292</a></p>
<p>I am trying to follow the Mastering Bitcoin tutorial. After compiling Bitcoin Core, and changing the datadir to my external hard drive in the config file, I get the following error any time I try a Bitcoin-cli command:</p>
<p>error: Could not locate RPC credentials. No authentication cookie could be found, and RPC password is not set. See -rpcpassword and -stdinrpcpass. Configuration file: (/media/XXXX/f1ebcea0-6304-4580-9ce2-1416dc0be49f/BlockchainData/bitcoin.conf)</p>
<p>When I search the forums, the only solution to this error is that Bitcoind was not running, but I confirmed that it is running. I suspect it has something to do with my hard drive permissions or admin level, but everything seems to be set up properly.</p>

CC BY-SA 4.0
2021-11-05T20:01:44.863Z
datadir=/media/XXXX/f1ebcea0-6304-4580-9ce2-1416dc0be49f/BlockchainData is the only thing i have in it
JC43
CC BY-SA 4.0
2022-02-02T01:57:03.207Z
This did not solve the issue. I resorted to re-formatting my drive and got a larger home drive. Thank you for the help though.
JC43
<bitcoind><json-rpc>
I am getting an RPC error when trying to run any Bitcoin-cli commands on Ubuntu
JC43
# I am getting an RPC error when trying to run any Bitcoin-cli commands on Ubuntu

(Asked by: username_0 on 2021-11-05)

I asked this question on AskUbuntu and was told to post it here.

<https://askubuntu.com/q/1373657/1519292>

I am trying to follow the Mastering Bitcoin tutorial. After compiling Bitcoin Core, and changing the datadir to my external hard drive in the config file, I get the following error any time I try a Bitcoin-cli command:

error: Could not locate RPC credentials. No authentication cookie could be found, and RPC password is not set. See -rpcpassword and -stdinrpcpass. Configuration file: (/media/XXXX/f1ebcea0-6304-4580-9ce2-1416dc0be49f/BlockchainData/bitcoin.conf)

When I search the forums, the only solution to this error is that Bitcoind was not running, but I confirmed that it is running. I suspect it has something to do with my hard drive permissions or admin level, but everything seems to be set up properly.

**Tags:** bitcoind, json-rpc

> **Comments:**
> **username_0**: datadir=/media/XXXX/f1ebcea0-6304-4580-9ce2-1416dc0be49f/BlockchainData is the only thing i have in it  
> **username_0**: This did not solve the issue. I resorted to re-formatting my drive and got a larger home drive. Thank you for the help though.  

---

## 1 answers

### Answer by username_1 on 2022-01-31. Score: 4

Since you are probably starting the daemon with a non-standard data directory, you'll need to specify the datadir every time you use the bitcoin-cli command, like this:
bitcoin-cli -datadir=/mnt/bitcoin YOUR_COMMMAND

Source: https://howchoo.com/bitcoin/run-bitcoin-full-node-raspberry-pi

> **Comments:**
> **username_0**: I already re-formatted my hard drive, thank you for the help though  

---

