Home Media Server Series
June 9th, 2020 Update: Reflashing the SDCard for Raspberry Pi with a Fresh Install

Based off what we discussed during our Zoom meeting, I decided it was time to do a completely fresh install with the lastest Raspbian (now called Raspberry Pi OS) image. Here's a summary of what I did followed by some explanations.

  1. Downloaded Raspberry Pi OS Image from here. The release I used was last updated on 5/27/2020
  2. I used the Linux tools available on Mac OS diskutil, dd and symc to copy the disk image onto the SDCard
  3. I emabled ssh and used ifconfig to find my Raspberry Pi's IP address so that I could interact with it as a headless machine.

Back in 2018, I started talking about my personal preference for using a Raspberry Pi B+ in CS160A. Since then, I've used it for a lot of other purposes and experiments so by the time it got to doing a pilot CS160A course with Raspberry Pi over the summer of 2020, it was time for an update. One of the best things about the little Pi is that when you feel too lazy to fix all the things that you've broken over time, it's totally fine to just reflash the whole darn thing. Part of this approach is specific to our Home Media Server project. Since we are going to set things up so that our media is stored separately on the external USB Drive, we won't have to worry about reflashing the OS itself. In my personal case, I'll just have some simple scripts here and there that need to be rewritten anyway.

1. Since 2018, a few things have updated and a lot of things have been made smoother on Raspberry Pi platform. Notably, there is now an imager tool that users can directly download onto their Windows or Mac system which will then walk the user through downloading the correct Raspberry Pi image for the microSD card. Unfortunately, since I only own one Mac Desktop (Mac Mini) and it's all the way from 2014, my operating system did not support the imager tool itself. That was completely fine though because I ended up manually downloading the latest Raspberry Pi image (see above) and then got it onto my already formatted microSD card (since it was used for a previous install).

2. To get the image onto the SDCard, I followed the instructions here. I didn't have to troubleshoot anything since my SDCard was already formatted correctly, but you can check through some of the troubleshooting tips. Notably, you want to use diskutil to first unmount the SDCard device. Then, you want to use dd to copy the image over. As the notes say, this process can take up to 15 minutes so be patient. In summary, I ran the two commands one after the other and had no problems.

diskutil unmountDisk /dev/diskN

In my case, diskN was disk2

sudo dd bs=1m if=path_of_your_image.img of=/dev/rdiskN; sync

In my case, this took about 20 minutes on my 2014 Mac Mini

When you are done, just to be extra safe, manually eject the SDCard

sudo diskutil eject /dev/rdiskN

3. At this point, I simply took the physical SDCard device out of the Mac Mini and put it into the Raspberry Pi. I plugged in a keyboard and mouse via USB and a display via HDMI. Magically, everything just worked and I was walked through some basic configuration via the new Raspberry Pi OS. One of the things I appreciated was the option to right away choose a US keyboard layout as opposed to the UK configuration. In past years, I had to go through an entire walkthrough for how to manually change that in configuration text files.

Once everything booted up, I wanted to grab the local IP address of the raspberry pi. I was prompted to change my password and then using ifconfig found that my address was

10.0.0.155

. While, this address can change, one of the things we'll go over is how to set that up. The only thing left was enabling ssh server login. I had to manually switch that on by using the built in raspi-config tool. Google was able to give me some very straightforward instructions. Essentially, just run that command using sudo and navigate to the Interaction Options to turn on ssh.

That was it. From there, I pulled out the keyboard, mouse and display to essentially turn the RasPi into a headless server and was able to login (just like logging into hills) with:

ssh pi@10.0.0.155

Here's a question/answer on Quora which explains why most likely your IP-Address starts with a 10: Reserved IP address that only work in a Local Area Network (LAN)