Raspberry Pi - Part 03 - Prepare SD Card
Raspberry Pi - Part 03 - Prepare SD Card
-
Prepare An SD Card
For Raspberry Pi
Version: 2020-03-16
1 SD card Minimum size 4Gb; class 4 (the class indicates how fast the
card is). We recommend using branded SD cards as they are
more reliable.
2a HDMI to HDMI / DVI lead HDMI to HDMI lead (for HD TVs and monitors with HDMI
input).
OR
HDMI to DVI lead (for monitors with DVI input).
2b RCA video lead A standard RCA composite video lead to connect to your
analogue display if you are not using the HDMI output.
3 Keyboard and mouse Any standard USB keyboard and mouse should work.
Keyboards or mice that take a lot of power from the USB
ports, however, may need a powered USB hub. This may
include some wireless devices.
5 Power adapter A good quality, micro USB power supply that can provide at
least the power your Raspberry Pi model requires (see step 0)
If your supply provides less than 5V then your Raspberry Pi
may not work at all, or it may behave erratically. Be wary of
very cheap chargers: some are not what they claim to be.
It does not matter if your supply is rated more than what
your Raspberry PI requires
6 Audio lead [optional] If you are using HDMI then you will get digital audio via this.
If you are using the analogue RCA connection, stereo audio is
available from the 3.5mm jack next to the RCA connector.
In order to use your Raspberry Pi, you will need to install an Operating System (OS) onto an
SD card. An Operating System is the set of basic programs and utilities that allow your
computer to run. Eg. Windows on a PC or OSX on a Mac.
The following instructions will guide you through installing an OS on your SD card that will
allow you to easily install different OS’s and to recover your card if you break it.
1. Insert an SD card that is sized between 4GB and 32 GB, into your computer
A. Windows
Download the SD Association's Formatting Tool from
https://www.sdcard.org/downloads/formatter_4/eula_windows/
Note: The builtin Windows formatting tool will only format the first partition that Windows can read not
the entire disk. For this reason we advise using the official SD Card Association Formatting Tool.
Install and run the Formatting Tool on your machine
Set "FORMAT SIZE ADJUSTMENT" option to "ON" in the "Options" menu
Check that the SD card you inserted matches the one selected by the Tool
Click the “Format” button
B. Mac
Download the SD Association's Formatting Tool from
https://www.sdcard.org/downloads/formatter_4/eula_mac/
Install and run the Formatting Tool on your machine
Select “Overwrite Format”
Check that the SD card you inserted matches the one selected by the Tool
Click the “Format” button
C. Linux
We recommend using gparted (or the command line version parted)
Format the entire disk as FAT
A. Windows
Right-click on the file and choose “Extract all”
B. Mac
Double-tap on the file
C. Linux
Run unzip [downloaded filename]
5. Copy the extracted files onto the SD card that you just formatted
6. Insert the SD card into your Pi and connect the power supply. Your Pi will now boot into
NOOBS and should display a list of operating systems that you can choose to install. If your
display remains blank, you should select the correct output mode for your display by
pressing one of the following number keys on your keyboard
Raspbian is a version of Debian Linux specifically configured to run on the Raspberry Pi and is
recommended by the Raspberry Pi Foundation as the operating system to install.
1. Download the latest Raspbian OS available for free from the Raspberry Pi website.
https://downloads.raspberrypi.org/raspbian_latest
2. Instaling is on SD card
A. Windows
Once you have the ZIP file downloaded to your computer, unarchive it using eg. 7zip
(https://www.7-zip.org/ ). There will be a single .img file inside. This is the disk image you will
flash to the Raspberry Pi’s SD card. To install Raspbian, you will need an SD card that has
at least 4 GB of space or more. Note that the cheap 16 GB Class 10 SD card works great on
the Raspberry Pi, and gives you plenty of room to add media and other programs once
Raspbian is installed.
Insert the SD card into your SD card reader and check which drive letter was assigned. You
can easily see the drive letter, such as G:, by looking in the left column of Windows
Explorer. You can use the SD card slot if you have one, or a cheap SD adapter in a USB
port.
Download Rufus utility from https://rufus.ie/ . Install the tool and run it. You may need to
run this as administrator. Right-click on the file, and select Run as administrator.
Select the drive letter of the SD card in the device box. Be careful to select the correct
drive. If you get the wrong one you can destroy the data on your computer's hard disk!
If you are using an SD card slot in your computer and can't see the drive in Rufus, try
using an external SD adapter.
Select the image file .img you extracted earlier.
Click Write and wait for the write to complete.
Exit the imager and eject the SD card.
B. Mac
https://www.raspberrypi.org/documentation/installation/installing-images/mac.md
C. Linux
https://www.raspberrypi.org/documentation/installation/installing-images/linux.md
:found
echo.
:: USB drive found?
if "%FirstRemovableDisk%" neq "" (
rem check if FAT32
for /f "tokens=5" %%a in ('@fsutil fsinfo volumeinfo %FirstRemovableDisk% ^| findstr /B "File
System Name : "') do (@set DriveType=%%a)
if "!DriveType!" equ "FAT32" (
rem get the latest image
for /f "tokens=*" %%a in ('dir "%LOCRB%\*-%TYPE%.img" /b /od') do set IMG=%%a
choice /M "!IMG! will be written to %FirstRemovableDisk% OK?"
if !ERRORLEVEL! equ 1 (
echo Writing image !IMG! onto disk %FirstRemovableDisk% with Rufus
pushd %LOCRF%
rufus.exe -f FAT32 -i "%LOCRB%\!IMG!"
popd
echo.
echo Copying additional files to %FirstRemovableDisk%, please wait ...
copy /Y secret %FirstRemovableDisk%\ 1>nul 2>nul
copy /Y ssh %FirstRemovableDisk%\ 1>nul 2>nul
copy /Y wpa_supplicant.conf %FirstRemovableDisk%\ 1>nul 2>nul
mkdir %FirstRemovableDisk%\SetupScripts 1>nul 2>nul
copy /Y "%LOCSH%\*.sh" %FirstRemovableDisk%\SetupScripts 1>nul 2>nul
ren %FirstRemovableDisk%\SetupScripts\BaseConfigME-0.sh RunNow.sh
%LOCRD%\removedrive E: 1>nul 2>nul
echo.
echo Image ready. You can now safely remove USB-stick with micro SD card!
)
) else (
echo Micro SD card not FAT32
echo 1. Delete all partitions on Micro SD card
echo 2. Create FAT32 formatted partition
echo.
%LOCPW%\partitionwizard.exe
echo.
echo Restart this CMD script.
pause
The risk with an open SSH port is that someone can access it and log in. To do this, they need
a user account and a password. Out of the box, all Raspbian installs have the default user
account ‘pi’ with the password ‘raspberry’. If you’re enabling SSH, you should really change
the password for the ‘pi’ user to prevent a hacker using the defaults. To encourage this, we’ve
added warnings to the boot process. If SSH is enabled, and the password for the ‘pi’ user is
still ‘raspberry’, you’ll see a warning message whenever you boot the Pi, whether to the
desktop or the command line. We’re not enforcing password changes, but you’ll be warned
whenever you boot if your Pi is potentially at risk.
Please note that installing this update on an existing Raspbian install will not change the status
of SSH on that machine; if SSH is enabled, installing the update leaves SSH enabled, and vice-
versa.
Since we first launched Raspberry Pi, an SD card (or microSD card) has always been a vital
component. Without an SD card to store the operating system, Raspberry Pi is pretty useless*!
Over the ensuing eight years, SD cards have become the default removable storage
technology, used in cameras, smartphones, games consoles and all sorts of other devices.
Prices have plummeted to the point where smaller size cards are practically given away for
free, and at the same time storage capacity has increased to the point where you can store a
terabyte on your thumbnail.
The 64GB card shown below is Class 10, and so can write at 10MB/s. It also shows the logo of
UHS (“ultra high speed”) Class 1, the 1 inside the letter U, which corresponds to the same
speed.
More recently, speeds have started to be quoted in terms of the intended use of the card, with
Class V10 denoting a card intended for video at 10MB/s, for example. But the most recent
speed categorisation – and the one most relevant to use in a Raspberry Pi – is the new A (for
Once installed, you will find the new application “Raspberry Pi Diagnostics” in the main menu
under “Accessories”, and if you launch it, you’ll see a screen like this:
In future, this screen will show a list of the diagnostic tests, and you will be able to select
which you want to run using the checkboxes in the right-hand column. But for now, the only
test available is SD Card Speed Test; just press “Run Tests” to start it.
We are testing against the A1 specification, which requires a sequential write speed of 10MB/s,
500 random write operations per second, and 1500 random read operations per second; we
run the test up to three times. (Tests of this nature are liable to errors due to other
background operations accessing the SD card while the test is running, which can affect the
result – by running the test multiple times we try to reduce the likelihood of a single bad run
resulting in a fail.)
If the test result was a pass, great! Your SD card is good enough to provide optimum
performance in your Raspberry Pi. If it failed, have a look in the log file – you’ll see something
like:
You can see just how your card compares to the stated targets; if it is pretty close to them,
then your card is only just below specification and is probably fine to use. But if you are seeing
significantly lower scores than the targets, you might want to consider getting another card.