Creating an SD for your Raspberry Pi

by MWAGNER


Posted on January 30, 2017 at 12:00 PM



Creating a bootable SD card for your Raspberry Pi project.

Writing an OS to an SD for the RaspberryPi is sometimes tricky. Corrupt OS installs and SD cards are common among Pi projects, so it is important to know how to clear an SD properly of a corrupt OS, and how to reinstall a new one. Another handy trick is making backups of your favorite OS's after you have made some modifications. This guide will lead you down the path to all of these.

I'm going to start this guide assuming you know absolutely nothing about the RaspberryPi, SD cards, or Linux. So lets start with a brief overview of each. These are the things you need to know to get up and running, from scratch, with a RaspberryPi.

  • RaspberryPi:
    A small Linux computer, between $5 and $35 depending on which of the popular models you choose. Each has their own positives and negatives. It runs Linux for the operating system, instead of commonly used Windows or OSX(MAC), and runs (primarily) off a micro-SD card, instead of a hard drive, which most computers use. It does not have the greatest processing power, however they are cheap and affordable, which is why most people seem to like them for home projects.
  • MicroSD card:
    The main storage location for the Pi. It is the same media most phones use for storage, and are cheap and available widely. Not all Micro-SD cards are made equal, though. There are classes of SD card(common ones are Class 4 and Class 10) Without going into too much detail, the classes kind of denote the performance. Spend the extra money and get a Class 10.
  • Linux:
    Linux is a huge topic, so I am in no means going over all of it. Basically, it is a free operating system alternative for Windows or OSX(MAC). It can run well on just about any hardware configuration, and it's free! There is a bit of a learning curve when you first start using it, but it works great for most peoples needs.
  • win32diskimager:
    This program is what I recommend for creating the SD for the Pi. It allows you to take an OS image (commonly .iso or .img) and "burn" it to the SD card. If you are downloading raspbian, windows IOT core, xbmc, or some other custom Pi OS, you will need this program to write it to the SD card. Another cool trick with this program is creating your own image files. So if you spend 20 hours working on the pi, and you want to back it up, you can use this program to make your own .iso for later use. Download Here.
  • SDformatter:
    This program allows you to clear your SD card after corruption. Sometimes when an SD image crashes, if you try to do the "right-click, format" way of clearing the SD, you will be left with a 50mb card instead of your snazzy 32gb card. This is due to partition and formatting issues. The quickest way to clear an SD that has been used with the Pi, is just to run it through this program. Download Here.

Now, lets get to the good stuff. Actually creating your SD image:

Start by downloading the .iso or .img file. Raspberrypi.org has a lot of great options, whether you are looking for retropie for your retro gaming needs, or raspbian to get up and running for the first time. Visit the site, navigate to the downloads section, and get your file. Download here.

After the file is downloaded, it should show up in your downloads folder, navigate there and you should see a .zip or similar folder with the name of your download. Go ahead and extract the folder (using winrar, 7zip, or your choice of program). Now, you should have access to your image file.

Go ahead at this point, and plug your microSD card into your computer using either a micro-sd to USB adaptor, or microSD to SD, or any other adaptor of your choice. It should pop up as a new location, just as any USB device does, and be assigned a letter.

Load up win32diskimager, and click "yes" when it asks for permissions. On the left had side, you will see two boxes near the top. One looks like a folder, one should have a device letter. If the device letter matches that of your microSD card, perfect. If not, go ahead and click on it and navigate to the device letter of your microSD card. The other box, the folder, is where you need to go next.

Click on it, and a file explorer box will open. Navigate to where your image is, and click on it then hit open. If your image isn't showing up, make sure on the right, instead of "Disk Images" you click on the text and select *.*. This will show all files in your location, and you should see your file. Once you have each of the two boxes set right, the image source and device letter, the "Write" letters should go from gray to black. Click on that and the write will begin. Depending on the quality of your SD card, and adaptor, it may error halfway though. This happens from time to time, just reformat the SD in SDFormatter, and go again.

Congrats, you have now created a boot disk for the Pi! Go ahead and put the SD into your Pi, power it up, and wait. First time bootups usually take extra time, as the disk image will do a few additional things itself.

To clear a corrupt os:

If you find yourself with a corrupt SD card, connect the SD card to your windows machine, load up SD formatter, make sure the correct drive letter is select (as we did in creating the image) and hit format. You will want exFAT or FAT32 format.

Note on raspbian: The default username is "pi" and default password is "raspberry". I recommend changing these by opening a terminal and typing "sudo raspi-config". This will run the raspbian configuration screen, where you can make some changes to the OS/device if you so choose.

This guide should work for any current OS images (as of January 2017). If any problems do arise, email me and I'll look into it.

For anyone looking to make their own image file from a currently working SD, a lot of the steps are the same. Hook your microSD up to the computer using an adaptor, load up win32diskimager. In the "Image File" box, where we previously selected an image downloaded from the internet, go ahead and click on the folder icon, navigate to where you want to save your disk image file, and in the "File Name" field, enter the name you want your file to have. For example, type in "MyOS.iso" to create a disk image file, .iso format, with name "MyOS". hit ok, and the "read" button should have gone from gray, to black. Hit the "read" button, give it time, and you will have made your own disk image file.


Subscribe!

Enter your Name and Email to receive notifications about new posts



Like what you see?

Consider backing us on Patreon to help cover server/project costs! Follow us on Facebook or Twitter! Shop using our Amazon Affiliate link!

Contact Me

Feel free to email me at mwagner@hackmypi.com with any questions!