Create .img file
Make the Pi-Node base .img.gz file for reuse
Put your micro sd card in your local machine and locate what it's called in /dev. For my laptop it is /dev/mmcblk0. Yours will likely be different.
sudo fdisk -l
After locating move into the directory you wish to save the image to and create the image.
# sudo cat /dev/mmcblk0 > pi-node.img
sudo cat /dev/<your sd card> > pi-node.img
cat is better than dd for this. cat will use all of your systems cpu cores, whereas dd uses one core. cat is faster 🙀
Once that completes we will use PiShrink.sh to deflate partitions and compress (among a few other tricks).
chmod +x pishrink.sh
sudo mv pishrink.sh /usr/local/bin
sudo pishrink.sh -aZ pi-node.img Pi-Node.img.gz
pishrink.sh: Shrunk Pi-Node.img.gz from 7.5G to 1.3G ...
And there you have it! 🧙♂