Lab — Backup Raspberry Pi

Lab Report
This is a simple write up about your experience with this lab. Place a screenshot of a step in the process during the backup.

Introduction
You have done a great amount of work on your Raspberry Pi this semester and you want to preserve the data on your Raspberry Pi. One of the standard UNIX tools for backing up your system is tar. This stood for tape archive, but there is no tape drive for the Raspberry Pi. One of the things you will need is a USB flash drive (formatted FAT at least) and the ability to remote into your Raspberry Pi. You will need to power your Raspberry Pi from the power microUSB port (the one furthest way from the processor) and connect the USB drive to the second microUSB port.

Procedure
Step 1: Attach and mount USB drive
First you need to verify what device you attached the USB drive to.
sudo lsblk -f
This command will list the drives attached to your system. You want to ignore the mmcblk device because that is the microSD card port on your Raspberry Pi. On my system, this was /dev/sda1 (the partition for the removable flash drive). Then you want to issue the following command:
sudo mount /dev/sda1 /media
This will mount the USB flash drive in the /media folder (or directory) so that you can perform the backup.
Step 2: Backup your Raspberry Pi
Issue the following command using the tar command to backup your Raspberry Pi:
sudo tar -cvpzf /media/«replace with a filename of your choice» –exclude=/media –one-file-system /
Once you issue this command, it will take a while to completely backup your Raspberry Pi root file system. You could follow the same process to backup your /boot partition, replacing / with /boot.
Step 3: There is no step 3.

Alternative backup procedure
If you are connecting to the Raspberry Pi using SSH, you have the option to backup the Raspberry Pi over the SSH connection to your local computer. This works either through the USB-Ethernet connection or wireless. You will issue the a command similar to the following:
ssh «pi@Raspberry Pi Name | Raspberry Pi IP address» sudo tar -cvpzf – –one-fidle-system / > backup.tar.gz
There are no further steps. Between « and » you use either the Raspberry Pi name or IP address. backup in backup.tar.gz can be actually any name you wish.

Last Completed Projects

topic title academic level Writer delivered