Ubuntu – Can I boot Ubuntu Server 19.10 on a Raspberry Pi 4 from a USB SSD

ssd

And if so, are there any tutorials?

Total noobie here; I know nothing about scripting, bash, foo.

All I know is 'sudo' and how to edit a file in with nano without making a total hash of things.

Will this excerpt from this tutorial Can you install Ubuntu on the Raspberry Pi 4 still work?

Solid State Drive (SSD) Configuration (Optional)

USB booting has not been added into the Raspberry Pi 4 firmware yet
but is being worked on right now. In the mean time you can use your
micro SD card as a bootloader and still boot the whole operating
system (rootfs) from the solid state drive giving you the full USB 3.0
speed increases system wide. Once the Pi USB booting is officially
released you should be able to boot directly from the device without
any makeshift bootloader SD card necessary.

First create a fully imaged and booting micro SD card following the
earlier steps in the tutorial. After you have created the micro SD
installation you should now image your SSD / USB drive with the same
Ubuntu image you used to create the SD card.

Now navigate to the “boot” partition on the newly created SSD / USB
drive and remove everything in there just like we did with the SD card
earlier. Now copy the “boot” folder from the micro SD card to the
solid state drive. This is necessary because even though the files in
“boot” are read off our micro SD card initially some firmware files in
the later load stages are read off the mounted drive and if the
necessary firmware files are missing the system won’t boot.

Now that you’ve created the SSD / USB drive partitions and copied the
“boot” partition from the SD card to your new drive we need to update
your SD card’s cmdline.txt to point to the SSD / USB drive’s
partition.

dwc_otg.fiq_fix_enable=2 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4

rootwait rootflags=noload net.ifnames=0

The key part we need to change here is the root=/dev/mmcblk0p2
section. mmcblk0p2 is a hardware identifier for micro SD storage. We
need to change this to the device your storage is detected as.

If you are using a USB to solid state drive adapter it’s very likely
your drive will be addressed as /dev/sda2. Therefore we will change
the root=/dev/mmcblk0p2 to root=/dev/sda2

root=/dev/sda2

The final line will be:

dwc_otg.fiq_fix_enable=2 console=ttyAMA0,115200 kgdboc=ttyAMA0,115200 console=tty1 root=/dev/sda2 rootfstype=ext4

rootwait rootflags=noload net.ifnames=0

Plug both the micro SD and the solid state drive into the Pi and boot
it up.

Remember: the first boot can take 2-3 minutes for first startup so
give it some time before assuming it didn’t work.

Best Answer

I flashed the Ubuntu Server 19.10 for Raspberry Pi image to a microSD card and a SSD, and connected them both to my Raspberry Pi 4B.

To my surprise loading Ubuntu Server from the SSD worked immediately and without any reconfiguration at all. The initial boot process relies on the microSD card /boot volume, but then the linux root volume on the SSD is used to load Ubuntu Server. I even deleted the linux root volume from the microSD card to make sure it wasn't being accessed in any way.

I'm a linux/Raspberry Pi noob myself, but after looking at the contents of the boot volume and checking the README file, I found that, by default, the /boot/nobtcmd.txt file is invoked during bootup to mount the root volume and contains the following line:

net.ifnames=0 dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=LABEL=writable rootfstype=ext4 elevator=deadline rootwait fixrtc

The root=LABEL=writable part defines the volume to mount, and in this case is mounting a volume based on the volume label name instead of a device name like sda1. The microSD and SSD are flashed from the same image, and they each contain two volumes with the labels 'system-boot' and 'writable'. It would appear the SSD controller has a higher priority than the microSD controller, and the 'writable' volume on the SSD is the first to be found when initially mounting root by volume label during the boot process.

Related Question