Note: This post is part of a series. Each post builds on the previous ones. If you are just trying to add one thing to an existing system that was not built following this series, then I cannot promise that these instructions will work for you, although they probably will. If you’ve started from something other than a non-NOOBS Raspbian image, then you’ll probably need to adjust for that.
Please refer to the series Introduction for a list of all the different posts in the series.
Self-Promotion: I have recorded this series as a screencast for Pluralsight:
If you have a Pluralsight subscription, please consider watching it. Reading the instructions is one thing, but watching it done demystifies the whole process.
What’s a Raspberry Pi?
The Raspberry Pi (http://amzn.to/2ecP7Zi) is a Linux computer about the size of a deck of cards (Uno cards if you put it in a case), and it’s not the prettiest computer in the world. The early models didn’t even really have a “front”. Because it’s so small, there were ports sticking off every side of the board. The newer models (B+, 2B, Zero, 3) have consolidated the ports so that cables are only sticking out of one or two sides now.
The Raspberry Pi was designed as an affordable computer to teach students computer programming with. Before long, it found a following in the “maker” community for its ability to act as an affordable, low-power brain for a wide variety of electronics projects. With its low cost, power consumption, and size, it has been used for a surprisingly large number of projects.
There have been several different models for sale. The $25 Model A+ has 256 MB of RAM, and 1 USB port. The $35 Model B has 512 MB of RAM, 2 USB ports, and a built-in Ethernet port. The B+ builds on the B and while it doesn’t change any of the key attributes of the system like RAM or CPU speed, it doubles the number of USB ports to four, moves some of the connectors around into a little nicer arrangement, and uses a bit less power. There was an earlier, 256 MB version of the Model B as well, but that was completely superseded by the 512 MB version. The Raspberry Pi 2 introduced a quad-core processor to the mix, keeping the same physical layout as the B+.
Next came the Raspberry Pi Zero, which only costs $5 (Usually), but has some serious limitations in both memory, speed, and connectivity. It’s a great choice for building small projects, or for fulfilling the Raspberry Pi’s original goal of teaching children to code, but it isn’t quite suitable for building this project.
Most recently, the Raspberry Pi Model 3 increased the overall speed of the system, and added built-in WiFi and Bluetooth.
But I don’t know Linux
Yeah… that’s pretty normal. Let’s face it, Linux is not an OS you’d put in front of your grandmother or non-technical spouse. For people used to Windows or Mac machines, Linux is going to be very unfamiliar. You generally don’t get to just right-click on things and pick “Properties” to set stuff up, and when you plug in new hardware, Linux doesn’t automatically download drivers from the internet and set them up for you. The desktop environment is getting pretty nice these days, though.
For those of us that were around for the first wave of home computers in the 80’s, and remember tweaking out the settings in autoexec.bat to get the memory settings just right so that we could play a certain game, this will be like a wave of nostalgia. For the younger folks, this may seem very strange and foreign.
Linux is an enchanted land full of magic words that you have to get exactly right in order for them to work. You have to stand in the right spot, at the right time of night, under exactly the right moon, and you’d better be sure that the chicken you’re about to sacrifice is a lefty, or you’ll bring doom and destruction on all the land.
Okay, it’s not quite that bad, but if you are uncomfortable with the idea of following instructions that tell you to type an obscure string of commands and parameters with little or no explanation as to what they mean, you’ll need to get over that fear. The internet is your friend, and you can look up how to do just about anything, but there are a lot of things to configure, and people aren’t always going to tell you why something has to be phrased the way it is.
In this series, I’ll try to explain the meaning of the obscure commands as best as I can, at least the ones that I understand well enough.
What hardware do I need?
Unless you bought some kind of bundle, your Raspberry Pi will need a few accessories before you can do anything with it. The Raspberry Pi doesn’t come with a power supply, or any kind of storage. When you buy a Pi, that’s all you get. A single-board computer, and nothing else.
You’ll need to supply your own monitor, keyboard, and mouse. The monitor can be anything with an HDMI or composite video input. There are adapters available to go from HDMI to VGA if that’s all you have available, but they can be pricey. Any USB keyboard and mouse will do.
Nearly everything in this series will be done from the command line, but the current Raspbian OS boots to the desktop initially, so you’re going to need a mouse as well, but only for the initial setup, and when configuring CrashPlan later on.
The power supply can be almost any Micro-USB phone charger, although it must provide at least 700mA for 1st generation Pis, or 1000mA for the Pi 2 or 3. Since the quality of the power supply can directly affect the stability of the system, I’d recommend buying a high quality supply like the official Raspberry Pi power supply. They’re only about $12, and will save you frustration later. I have some leftover chargers from old cell phones that claim to be full 1-Amp supplies, but can’t even power the caps-lock light on my keyboard. The better your supply, the better your experience will be. Trust me, it’s worth it.
Note: In general, you should try to avoid plugging things into the Raspberry Pi while it is running. Linux is more than capable of hot-plugging peripherals, but with such a small power supply, the Raspberry Pi has tendency to “brown out” and reboot when you plug things in. Your basic flash drive is probably safe, but plugging in a game controller might power-cycle the computer. You’ve been warned.
Storage comes in the form of an SD card. The larger the card, the more stuff it will hold, so you might be tempted to get the largest card you can. As part of this series, I’ll show you how to boot the Raspberry Pi from an external hard drive, so in the long run anything over 8GB will just go to waste, and will take longer to back up. For that reason, I usually stick to an 8GB card while I do the build. Similarly, once you’re booting from the hard drive, the speed of the card won’t matter anymore, but faster cards will make some of the initial setup noticeably faster.
Finally, you may want to buy a case of some kind. There are plenty to choose from, and there are even plans you can print out and fold up to make a case out of card paper. Many people seem to like making cases from Lego bricks as well. I’d recommend a decent protective plastic case with keyhole slots on the back so that the whole thing can be mounted somewhere when you’re finished. You could also Velcro or tie-wrap the Raspberry Pi to the side of the hard drive if you want.
What software do I need?
The Raspberry Pi has no built-in operating system of any kind. It expects to find its OS on the SD card when it powers up, so you’ll need to get an OS onto the SD card before it’s going to do anything.
Note: Older versions of these posts talked about using the Raspberry Pi Foundation’s “NOOBS” image, but that really does cause more problems than it solves when building a server, so I have removed that information. If you really want to read that stuff, then you can dig around using the Internet Archive’s Wayback Machine:
These days, I only recommend getting a plain, Raspbian image from the Raspberry Pi Foundation’s download page, and writing it directly to the card using a program like Win32 Disk Imager or HDD Raw Copy
You might also want to go get the SD Association’s “SD Formatter” tool. This will help you reclaim the unallocated space on your SD card in the event that you want to use it for something else. When you write a 4GB image to a 16GM SD card, you can’t just stick it in a Windows machine, reformat it and expect to get all the space back. Windows is going to see an SD card with a 4GB partition, and 12GB of unallocated space which it will totally ignore. When you tell Windows to format the drive, it’s just going to format the 4GB partition, and leave the other 12GB alone. SD Formatter will format the whole card and get all your space back.
You can accomplish the same effect using something like diskpart on Windows or fdisk on Linux, and you’ll need them if things go really wrong, but in most cases, SD Formatter is all you need. See the supplemental post “SD Cards Gone Bad” for more information on using diskpart to recover corrupted SD cards.
That’s it for the introduction. In the next post, we’ll start building the initial OS image, and get the machine up and running.