2. Raspberry Pi system installation and backup

To use Raspberry Pi, we need an operating system. By default, Raspberry Pi will look for the operating system on the inserted SD card. This requires a computer to image the storage device as a boot device and insert the storage device into the computer. Most Raspberry Pi users choose microSD card as the boot device.

2.1. Install through Imgaer

Use Raspberry Pi Imager to install the operating system. This tool can download and write images on macOS, Windows, and Linux. It supports many popular Raspberry Pi operating system images and supports images downloaded directly from Raspberry Pi or third-party vendors (such as Ubuntu). Imager can be used to pre-configure credentials and remote access settings.

You can install Imager in the following ways:

˙macOS, Windows: Download the latest version from https://www.raspberrypi.com/software/ and run the installer.

˙Linux: Run sudo apt install rpi-imager in the terminal to install.

After installing Imager, start the application by clicking the Raspberry Pi Imager icon or running rpi-imager.

Raspberry Pi Imager main window.

  1. Click "CHOOSE DEVICE" and select your Raspberry Pi model from the list. Here we choose Raspberry PI 5;
  2. Click "Select OS" and select the OS you want to install. Imager will always show the recommended version of Raspberry Pi OS for your model at the top of the list;
  3. Insert the SD card into your computer with a card reader and click "Select SD Card". Be sure to select the correct SD card;
  4. Click "NEXT". You can choose "Edit Settings" to customize the OS, or "No" to skip;

img

  1. Edit Settings allows you to set up your Raspberry Pi before the first boot. You can pre-configure: username and password, WiFi credentials, device hostname, time zone, your keyboard layout, remote connection. As shown below:

img

img

  1. After the settings are completed, click "Save" to start writing to the system.

img

2.2, Install through Win32DiskImager

Preparation:

  1. An SD card of more than 2G and a card reader, preferably a high-speed card, Class 4 or above is recommended. The speed of the card directly affects the running speed of the Raspberry Pi. The author recommends 4G or above, otherwise the subsequent development space will not be enough.
  2. Use the special formatting tool SDFormatter to format the memory card.
  3. Install the tool for burning images under Windows system: Win32DiskImager.

Burning system:

  1. Unzip the downloaded system compressed file to get the img image file;
  2. Connect the SD card to the computer using a card tray or card reader;
  3. Unzip and run the win32diskimager tool;
  4. Select the img (image) file in the software, select the drive letter of the SD card under "Device", and then select "Write", and then start burning the system.

img

  1. After the burning is completed, a completion dialog box will pop up, indicating that the burning is completed. If it is not successful, please turn off software such as firewalls and reinsert the SD card for burning. Please note that after burning, the SD card is only 74MB in the Windows system. This is normal because the disk partition under Linux cannot be seen under the Windows system!

Note: After the burning is successful, the system may prompt to format the memory card. At this time, do not format the burned memory card.

2.3. Backup (restore) Raspberry Pi under Windows

Raspberry Pi uses SD card to load the system. If the SD card is lost or damaged, the data on the Raspberry Pi will be lost, so it is very important to backup the Raspberry Pi system.

Preparation: a. Raspberry Pi SD card; b. Card reader; c. Install Win32DiskImager software

If there is no Linux operating system, you can also back up under Windows, but the size of the backed up file is actually the size of the SD card.

First create a blank .img suffix file, open Win32DiskImager, and then select the SD card as shown below, select the newly created blank .img file, and directly read it to back up the system. If you need to reinstall, directly select this image file, select the SD card, and click Write to restore.

img

Advantages: simple operation, backup and restore are implemented by the same software.

Disadvantages: It takes up too much space, the backup is of the entire card, the obtained IMG is the size of the card, and it can only be restored to the original card or a card larger than the original card.