Raspberry Pi Boot from USB

Raspberry Pi 4 Boot with USB

Raspberry Pi 4 Boot from USB M.2 SSD is a really fast and secure way of running your RPi on your Astro rig. This removes the longevity and reliability problems of a SD card and gives you a performance boost. Its easy if you follow this guide…

 

Written by Jonathan Eames
January 8, 2021

Why is it worth doing?

There are many advantages haveing your Astroberry or Stellarmate Rapsberry Pi boot from from a USB connected SSD or M2 hard drive, here are some of them:

  • Speed – you will find an SSD much faster to read and write to/from – When I tested my SD Card with the hdparm utility on my RPi, I got a read speed of around 44mb/sec from the SD card. Now compare that to a normal SSD – 115mb/sec (more than double) or my M.2 SSD drive 327mb/sec (about 7.5 times faster) – write speed is great when you are saving large image files in a session (u you can still use use a removable USB SD Card holder formatted to NTFS if you want for convienence – just copy them across next day)
  • Disk space – most SSD/M.2 drive sizes start at 128mb upwards so you get a lot of free space to save your images;
  • Size – I recommend a USB drive holder – they are small, rugged and light on your rig;
  • Portability – easy to unplug and bring inside;
  • Price – this doesn’t have to be an expensive upgrade, I just bought an M.2 128mb drive for €23 and a USB M.2 drive holder for €15.

So my recommendation for all of the above is a M.2 sata drive, minimum 128gb with a USB drive holder. Make sure you choose compatible drives and holders – look for an Aluminum Case for M.2 (NGFF) to USB 3.0 Aluminum which supports supports UASP & EC-M2MC. The M2 SSD drive should be of the Sata III type – usually sized as “2280” which are the longer ones. The golden rule is you pay more for write speed and storage space so thats up to you to work out if its worth spending more.

NB You cannot use M key, or any PCIE / Nvme SSD interface with RPi currently – avoid those drives as they are not compatible and will not fit your sata enclosure anyway.

Before you spend, be aware that power can be an issue running an external drive so the drive is best connected to a USB powered hub (as I use on my rigs) – this then solves any RPi power shortage issues.

Step 1 – Before you start

  1. Backup your SD card (just in case you copy over it in error!)
  2. Update your RPi (using the SD card)  to the latest versions of software – use Terminal to run “sudo apt update”  to download updates for the os as well as the hardware followed by “sudo apt full-upgrade -y”  to upgrade your RPi – then reboot!
  3. Install your M.2 drive in the USB holder so its ready…

Step 2 – Copy the SD card contents to your new M.2 SSD USB drive

Plug your new SSD drive into a USB 3 socket on your RPi – you can check it is running (other than the led light on the case) by running in terminal “sudo fdisk -l” this should show both the new SSD and the old SD card;

usb boot

 

 

 

 

 

 

 

Next we need to copy the SD card over to the drive using the built in card copy application in the RPi – go to the Accessories menu and choose “SD Card Copier”. Once you have entered your password (e.g. “astroberry”) you will get the following dialog:

SD Card Copy

 

 

 

 

 

Now this is why I suggested you back up your SD Card in step 1 just in case… If you select the wrong source and destination you will end up with… er well, nothing on either crycry If you are unsure, use fdisk again and make sure you know what each drive is a called and check Card Copier carefully.

Now press start and confirm – its time for another cup of tea I think!

 

Step 3 – Set up your RPi to boot from USB

Only later versions of the Raspberry Pi operating system allow you to select USB as a boot option so this guide assumes you did a full update before starting!

Before we boot to the USB drive, first let’s double-check that our Raspberry Pi is set up to boot from USB if there is no microSD card inserted. Using terminal, type “sudo raspi-config” to open the configuration utility:

 

Step 3 – Set up your RPi to boot from USB

Only later versions of the Raspberry Pi operating system allow you to select USB as a boot option so this guide assumes you did a full update before starting!

Before we boot to the USB drive, first let’s double-check that our Raspberry Pi is set up to boot from USB if there is no microSD card inserted. Using terminal, type “sudo raspi-config” to open the configuration utility and follow the steps in the images below:

Press ENTER to hit OK on the final screen. Then choose ‘Finish’ on the Raspi-config screen. You will be asked to reboot. Choose ‘Yes’ to reboot the Pi.

When the Raspberry Pi comes back up, we’re now going to want to test out the USB boot. Do a graceful shutdown – “sudo shutdown -h now” in Terminal or use the GUI menu command.

Power off the Raspberry Pi, remove the SD card, and then power it back on. If everything was done correctly, your Raspberry Pi will boot back into Raspbian without a microSD card – this means you’re successfully running on your USB 3 drive!

Normal rules apply though, you should back up your SSD regularly – I found a great you tube video on some great Rapsberry Pi tools to help you – use this link to view

You may also like…

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *

©2022 IoAstro.com - Astronomy Automation.

IO Astro