raspberry
Peter Weiß  

Setup a Raspberry Pi with USB SSD Disk

How to setup your Raspberry Pi to easy boot from a USB SSD disk, instead of the SD Card. For optimal performance we install a 64 Bit operating system, in this case Raspberry Pi OS 64bit Lite Beta. For the following projects in the upcoming Raspberry and Smart Home posts, we just need command line. Therefore the Lite Version is the right choice without any overhead and a smaller image. Be aware that the 64bit Os Version is still in Beta so use it at your own risk, but I had no problems till now, and I use the beta version at least till 8 months on multiple Raspberry Pi’s.

Raspberry Pi Hardware Overview

Let’s start with the basics, the Raspberry Pi itself and the needed devices. Please find the links, to the hardware I use and till now had good experience with, in the following list:

Download Raspberry PI Imager Tool and Raspberry OS

Download the Raspberry Pi Imager Tool, you need it to install the operating system on your USB SSD disk. Find the link to the download for your Operating System here: https://www.raspberrypi.org/software/.

Next, download the latest beta version Raspberry OS 64bit Lite (2021-04-09) from the official download site: https://downloads.raspberrypi.org/raspios_arm64/images/raspios_arm64-2021-04-09/. Choose the zip file and extract it after successful download, you need the extract .img file for the next steps.

At the moment just the 32bit Versions are official supported, so use the Beta version on your own risk. I have used the Server only Lite versions from the beginning of the beta phase, and had no problem since I started about 10 month ago.

Install Raspberry PI OS on your SSD

If you have downloaded the image and the imager tool, you are ready to start the installation process. First connect your USB SSD disk with the USB connector of your work computer. Now start the Imager tool and select the last option, to choose your own image.

Select Own Image to be able to use the downloaded image version

Now go to the folder, where you have downloaded and extracted the image file, and select the file. If you have already downloaded the latest version, the name should be 2021-03-04-raspios-buster-arm64.img. In the screenshot below you see the previous version.

Select your download .img File for installation

Next you have to choose the disk where you want to install Raspberry Os. If you have bought the PNY 240 GB disk from my suggestions, the screen should look like the following Screenshot. Now select the PNY PNY ELITE PSSD Media – 240.1 GB.

Select the correct SSD in this case the PNY 240 GB

Confirm that all data on the selected drive will be deleted, so be sure you selected the correct disc.

Confirm the deletion of the selected disc

After your confirmation you get a last overview of the selected Image which will be installed, if you downloaded the latest version, the date is different than in the screenshot below. And the SD-Card or in your case the SSD disc where the OS should be installed. Finally to start the process you have to click on Write to start the installation.

Overview of selected image and drive

After the image was successful written onto the disc you will get a message about it, and the information that you are now able to unplug the USB drive.

Finally the image was successful written onto your disc

Enable SSH for your first login

For security reasons SSH is not activated after you have installed the Operating system. If you want to connect to your Raspberry Pi with SSH you have to activate it first. The easiest way is to add a file called SSH into the root folder of your previous installed disc. Just plugin the USB SSD disc again into your PC and create a file. You simple could use a Text editor or for example use the terminal.

Start a terminal session and change to your installed disc. The name of the disc is boot and its mounted under Volumes.

cd /Volumes/boot

Now add a file called ssh in the root folder here.

touch ssh

After the file is created, eject your disc from the computer. Now everything is prepared to connect it to your Raspberry Pi.

cd into /Volumes/boot and add file ssh

Power Up your Raspberry with USB Boot

Make sure the Raspberry Pi is powered off. Connect your Raspberry with a Network cable to your network. Attach the USB SSD disk to one of the USB 3 connectors. These are the 2 blue USB connectors on the right hand side of your Raspberry Pi, to get the best possible performance. If you also want to connect a monitor and a mouse and keyboard, have a look into my suggested accessories, but with SSH remote access this is not necessary.

Finally, if all is connected, Power Up your Raspberry with the USB-C Power Connector or maybe a POE Hat if you have one. The first boot takes a little time, but should be finished within 2-3 minutes. Per Default DHCP is activated, the Raspberry Pi should now get a IP from your Router. Log into your router or which device you use as your DHCP Server and check, which IP your new Raspberry has. Alternatively connect a monitor, the IP is also written on Startup.

SSH Login to your Raspberry Pi

Now open again the Terminal to connect with SSH to your Raspberry Pi. The Default Username for Raspberry Pi Os is pi and the default password is raspberry, which we will change in the next steps. You also need the IP address which you have found in the previous section.

ssh pi@<YOUR-IP-ADDRESS>

First you have to accept, that the public key of your Raspberry Pi is stored in your .ssh/known_hosts File. This is necessary for the encrypted connection, so just confirm with yes.

Accept the SSH connection this adds the public key to your known hosts

Second, enter the password and you should get connected to your Raspberry Pi.

SSH with Key File instead of Password

This step is not necessary, but SSH with KeyFiles is more secure than Username and Password and you don’t have to type in your password, when connecting to your Raspberry. It’s also needed for automation with Ansible, I’ll provide some blog posts with more automation projects in the future.

If you already have a Private Key File on your computer, just copy the public key to the Raspberry. If you don’t have one you have to generate one before you are able to proceed. Tell me if you are interested, I could post an article with the whole process.

ssh-copy-id pi@<YOUR-IP-ADDRESS>

The Keys will be copied, from now on the authentication is done with the installed keys, and you don’t have to add your password when you connect to your raspberry.

Initial Raspberry Pi Settings

You are now successful connected into your Raspberry Pi for the first time. In the next sections, I give you some recommendations for the initial system setup, before you start with your projects.

Upgrade the Operating System

As you see the timeline between new Operating systems is long, so it’s necessary to install latest updates, especially Security Updates. But it’s also possible that new distributions are in the meantime available. Before using the System it’s good to be Up-To-Date, therefore you should first upgrade your system. For Update use the package manager apt or apt-get.

sudo apt update
sudo apt dist-upgrade -y

Depending of the changes this could take a longer time, please be patient till everything is updated.

Raspi-Config

The easiest way of configuration with Raspberry Pi Os is with the raspi-config Tool. You just have to start it and choose the settings you want.

sudo raspi-config

Raspi-Config – Localisation Options

Start raspi-config and select Localization options. The important settings are your language and region and the timezone, if you use the Raspberry with direct keyboard sou also should select the keyboard layout. Additional if you want to use WIFI you should also set the WLAN country here.
The minimum settings are the first 2 settings:

  • L1 Locale
  • L2 Timezone

Raspi-Config – System Options

You could find here some of the specific system options, which you could set. Important is the hostname, especially if you have more than just one Raspberry, and here you are able to change your password. If you’d like to use WIFI here are the settings to connect to your WIFI. So at least this to options are important to set:

  • S3 Password
  • S4 Hostname

Raspi-Config – Interface Options

Here you could enable disable all different interfaces of your Raspberry Pi. All should be setup correct, you already added the ssh File to the image. As a consequence the SSH Setting here is enabled, if not you are able to set this here. Therefore the important setting in this menu is

  • P2 SSH

Summary

In this blog post, you got some of my recommendations about the needed hardware to get a Raspberry Pi 4 – 8GB with a USB SSD and other needed accessories. You also learned how to install the Operating System Raspberry OS 64bit Lite Beta on the SSD and activate SSH for connecting to your Raspberry. Additionally you got insights to use your Key for the SSH connection, instead of username and password. Finally you upgraded the Operating system and did a basic Setup. Your Raspberry Pi is now ready for the first project. I’ll post some of my projects so stay tuned, maybe you are interested in Node-Red, that will be my next blog post, and we will install it on this Raspberry.

If you have any questions or suggestions, or if you would like further information, please let me now in the comments. 

Leave A Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

WordPress Appliance - Powered by TurnKey Linux