I hear that a problem with RPI is the limited lifespan of the SD cards from which it runs. So I looked into making my RPI model 4 run from a USB SSD I had laying around. After much research and trial and error, I now have my RPI4 running from the SSD. It is much faster also! RPI4 doesn't support booting directly from the SSD, so a SD card is needed, but only to boot it. Here's how to do it:
Here’s how to set it up.
Plug your drive into one of the Blue USB ports. These are the USB3 ports and provide more power and speed than the black ports.
Start up your RPI, if it’s not already running.
From the RPI desktop, click the start button, Accessories, SD Card Copier.
The From Device will be your SD card (probably /dev/mmcblk0)
The To Device will be your new drive (probably /dev/sda)
Select New Partition UUIDs
Click Start. This copied everything from the SD card onto the new drive.
When this is finished, open a terminal window.
Enter sudo nano /boot/cmdline.txt
Paste the following text at the end of the first (and likely only) line of cmdline.txt (after a space). root=/dev/sda1 rootfstype=ext4 rootwait
Then CTRL-X, Y when prompted to save, and ENTER to confirm.
Reboot your RPI (type sudo reboot in the terminal)
RPI will then be running from the hard drive. You still need the SD card to boot as RPI cannot boot from a hard disk. But once running, the SD card is not used.
If you have a problem, you can take the SD card out of the RPI, put it in a PC, and edit out the change in cmdline.txt. It will then operate from the SD card again.
If this SD card ever crashes, you can just make a new one using the RPI configuration, change the cmdline.txt file, and you are all set.
If you already have a system up an running simply format your drive to ext4, mount it somewhere, rsync your mem card over to the partition, edit your cmdline.txt and replace the root line with the dev location of the SSD, reboot. If your system is up to date you should already have the rootfs and rootwait commands in line.
Really simple.
Bonus points, multiple partitions and systems set up, which are easily swapped between with a quick comment and uncomment of a line in cmdline.txt. Use rsync to backup your system to one every so often and you have a fallback should your main system ever get borked.
I've had a 500G SSD running entirely off the USB3 port for quite some time now. The speed difference alone makes it worth it.
Note: Depending on your drive you may need to enable quirks on your drive to get good speed out of it
Are those cards any "better" than the regular? I was looking at them when I bought a couple of PI4's. I have had mostly good luck with sdcards anyway. With the PI3 the usb is slow so external HD solutions can be problematic but maybe okay for headless operation and simple server stuff.
Can I make an SBC suggestion? Look into the Odroid SBCs. They're slightly more expensive than their Pi equivalents, but run circles around them. Plus, they come with eMMC support - so data reliability is way better than with SDs.
I've used both Odroid XU4s and Odroid N2s with Ubuntu 18.04 - the XU4 is arm32 (so comparable to the Pi3, and the N2 is aarch64 (so comparable to the Pi4).
The XU4 has an octacore Samsung Exynos 5422 CPU. The N2 has a hexacore Amlogic S922X CPU
Here's some CPU benchmarks comparing the Pi3, XU4 and N2:
Here's the kicker to push you even more in that direction - unlike the Chinese RPi-clones (like the BananaPi and OrangePi line of SBCs), the Odroids have well documented pinouts and the hardware is super reliable. They also release GPU drivers ...... so rock-solid 4K video (with the N2).
Wow @aaiyar Odroid N2s get into NUC territory pretty fast. Cool, but they seem a bit pricey. Admittedly, I couldn't resist 128GB of eMMC, but I hit $176 before I could blink! Lol
The thing is very fast. I read a post - I think on the Odroid forums that by early next year, they're expecting a cluster version of the N2, much like the MC1 is a cluster version of the XU4.
No, the text goes at the end of the line, not on a new line. And it doesn't replace the old line.
I am far from an expert on Linux, so someone else might be able to help you.
Also - if you are running an earlier RPI than the model 4, you can boot directly from the SSD. There are a number of articles describing this.
Ok, moved it to end of 1st line and also changed to SDA2 because when I tried SDA1, it never booted. Now, i have the 116.GiB Total under /root. Thank you. This is a RPi 4 running my Node Red. Now, I need to figure out why I can't do the same on my other RPi 4. It's having an RPi problem with the external drive; nothing to do with your instructions.