Running bitcoin lightning node on an old mac mini: formating the external drive
Introduction:
This is the fifth article in this i\series of articles walking my readers through how I used an old mac mini t run a lightning node. The so it is very slow boot up or turn on, compared to modern devices with SSD drives. Lastly this computer has 4 GB of ram, which most modern computers have 16 GB or more. So this small RAM is an additional reason it is slow.
But the price is Free, as in Paid for long ago and while I have moved on to using lap tops, this used to be my portable or mobile device, as it travels easily and if you have connectors you can connect it to any monitor and some TVs.
If you are reading this article first and not the previous articles, here is a bonus for you, the links to the previous 5 articles;
First six articles
The first article: How to run a bitcoin Lightning Node on an old Mac Mini using an external drive.
The second article: Running Bitcoin Lightning Node on an old Mac Mini: Hardware considerations.
The third article; Running a bitcoin lightning node on an old Mac Mini: Software considerations
The fourth article: Building a bitcoin lightning node on an old Mac mini: a glitch in the memory.
The fifth article: Building a bitcoin lightning node on an old mac-mini; chooseing the external hard drive.
The sixth article: Building a bitcoin lightning node on a mac-mini: Formatting the external hard drive.
Formating.
So I am not an expert in this field, and I Google, and YouTube search most of my projects. This one is no different. YouTube videos explain most things, and you will often be greeeted by the content creator telling you this is his or her 12th try and it worked on the 11th try, so they filmed the 12th try!
The important thing to realize is that most people in this space are learning how to do stuff, and so you are too, join the club, and don't feel bad or inadequete.
I feel I should also explain that the bitcoin blockchain is currently 700 plu GB, and grows 60-70 GB a year. SO my 500 GB hard drive, while huge, was to small.
Plus I need space for the control software.
So I decided to download things to the external hard drive, which is actuallty a SSD drive for speed and performance because this drive needs to read and write several times a day, 24x7, so a HDD is not recommended.ockchain on it instead of your Mac mini's internal drive, you can use a built-in startup option or command line flag.
Here is the step-by-step guide to formatting your drive and pointing Bitcoin Core to it on macOS:
Step 1: Format the External SSD
- Plug your new 2 TB SSD (like the Crucial X9 or Samsung T7 Shield) into your Mac mini.
- Open Disk Utility (press Command + Space, type "Disk Utility", and hit Enter).
- In the left sidebar, select your external drive (make sure you pick the actual drive, not just the volume indented under it).
- Click the Erase button at the top.
- Name your drive something simple with no spaces, like BitcoinDrive.
- Set the Format to APFS or Mac OS Extended (Journaled).
- Set the Scheme to GUID Partition Map, then click Erase.
Step 2: Create a Folder for Bitcoin Data
- Open your external drive (BitcoinDrive) from your desktop or Finder.
- Create a new folder inside it and name it BitcoinData.
Step 3: Launch Bitcoin Core Using the Custom Directory
- By default, Bitcoin Core tries to save files to your Mac's small internal system drive. You can override this using a simple command so it writes directly to your external SSD instead.
- Download and install Bitcoin Core from the official website and move the app to your Applications folder.
- Open the Terminal app on your Mac (search for it using Spotlight or find it in Applications > Utilities).
- Tell Bitcoin Core to launch and use your external drive folder by typing the following command and pressing Enter:
/Applications/Bitcoin-Qt.app/Contents/MacOS/Bitcoin-Qt -datadir=/Volumes/BitcoinDrive/BitcoinData
What Happens Next?
When you run that command for the first time, Bitcoin Core will launch normally, but it will build all of its heavy blockchain files directly onto your 2 TB external SSD.
Tip: Every time you open Bitcoin Core from now on, it needs to know where that data lives. If you launch the app normally by clicking its icon without the command, it will look at your internal drive again. To avoid typing the command every time, you can create a shortcut script or configure a small text file called bitcoin.conf on their system containing the line datadir=/Volumes/BitcoinDrive/BitcoinData.
Alternative to Step 3 being last step
- I researched what else could be done, to avoid the repetitive command line thing....heres is what i found:
To make Bitcoin Core automatically recognize your external drive every time you open it without needing terminal commands, you need to create a text file named
bitcoin.confin Bitcoin's default application support folder. This file tells the software to look at your external drive'sBitcoinDatafolder.
- Open the Bitcoin Application Support directory: 1 min.
Open Terminal (press Command + Space, typeTerminal, and hit Enter), paste the following command, and press Enter to open the hidden folder in Finder:
open ~/Library/Application\ Support/Bitcoin
>*Verification:* A Finder window will pop open showing the Bitcoin configuration directory (it may be empty if you haven't created files there yet).
>2. **Create the bitcoin.conf file:** 2 min.
Open the **TextEdit** app on your Mac. Create a new document, change the format to plain text by clicking **Format > Make Plain Text**, and paste the following line:
```text
datadir=/Volumes/BitcoinDrive/BitcoinData
Save the file directly into that Finder window you opened in Step 1, naming it exactly
bitcoin.conf(make sure it doesn't accidentally save asbitcoin.conf.txt).
Verification: In Finder, confirm that the file is namedbitcoin.confinside the~/Library/Application Support/Bitcoin/path.
- Launch Bitcoin Core normally: 1 min.
Double-click the Bitcoin-Qt app in your Applications folder to launch it normally.
Verification: Bitcoin Core should open without any errors and begin loading the blockchain directly from your external drive.
Last words...
- Now you are uptodate with my progress on this project.
- My next report should be more interesting from a non-technical view, with hopefully a functioning bitcoin node and lightning node.
.
First six articles
The first article: How to run a bitcoin Lightning Node on an old Mac Mini using an external drive.
The second article: Running Bitcoin Lightning Node on an old Mac Mini: Hardware considerations.
The third article; Running a bitcoin lightning node on an old Mac Mini: Software considerations
The fourth article: Building a bitcoin lightning node on an old Mac mini: a glitch in the memory.
The fifth article: Building a bitcoin lightning node on an old mac-mini; chooseing the external hard drive.
The sixth article: Building a bitcoin lightning node on a mac-mini: Formatting the external hard drive.