user128450: 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.

user131953: 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

128450: <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>
 131953: <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>
