JaySom
Posts: 2
Joined: Mon Aug 26, 2019 10:24 pm

Ubuntu from SSD - easy method

Fri Mar 20, 2020 9:13 pm

Flash ubuntu to sd and the ssd. Use dd or official imager etc.

Delete partition 2 from sd (fdisk, diskpart, gparted, Windows disk management)

Delete partition1 from ssd.

Plug both in and turn on.

smoore
Posts: 8
Joined: Sun Mar 22, 2020 7:43 pm

Re: Ubuntu from SSD - easy method

Wed Mar 25, 2020 10:43 pm

Hmmm ... this doesn't seem to work. I used Raspberry Pi Imager to write Ubuntu 18.04.4 (Pi 3/4) 64 Server OS onto both an SD card and USB 3.0 flash drive. Using gparted (on a different workstation), I removed partition 2 from the SD card and partition 1 from the USB drive. Then both devices were inserted into the Pi4 and booted. It executes some boot sequences, clears the screen and displays 4 raspberries, then goes into a kernel panic. Game over.

Could you provide a few more clues about your method?

User avatar
procount
Posts: 2035
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: Ubuntu from SSD - easy method

Thu Mar 26, 2020 9:33 am

This only works if the boot partition identifies the location of the rootfs partition using some consistent method, such as by partition label.
(I know Ubuntu Mate uses this approach, which makes it impossible to have more than one instance of the OS on your storage devices.)

Normally the location of the rootfs is stored in /boot/cmdline.txt if it uses the RPi bootloader.
However, some later versions of Ubuntu use U-Boot for the boot loader, and U-Boot has several different methods to boot the OS, including using some boot.scr script files that are often compressed using gzip and cpio. Such OSes are more difficult to relocate to different partitions. Sometimes it is necessary to remove UBoot altogether and use the RPi bootloader instead.
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

smoore
Posts: 8
Joined: Sun Mar 22, 2020 7:43 pm

Re: Ubuntu from SSD - easy method

Thu Mar 26, 2020 12:41 pm

Working.

Mount the boot partition of the SD card using a different computer. Edit /boot/cmdline.txt and change the path to /sda2

Code: Select all

console=ttyAMA0,115200 console=tty1 root=/dev/sda2 rootfstype=ext4 

User avatar
procount
Posts: 2035
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: Ubuntu from SSD - easy method

Thu Mar 26, 2020 12:49 pm

Good work. An easy fix, unlike some of the OSes I come across.
You may want to look at /etc/fstab on sda2 as well and check those references still refer to the correct drives. They may, or may not, need updating.
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

smoore
Posts: 8
Joined: Sun Mar 22, 2020 7:43 pm

Re: Ubuntu from SSD - easy method

Thu Mar 26, 2020 2:44 pm

The fstab looks as follows:

Code: Select all

LABEL=writable     /               ext4  defaults  0  0
LABEL=system-boot  /boot/firmware  vfat  defaults  0  1
This doesn't appear like it needs changing. I did alter the code with UUID=xxxx of the USB drive on the first line but it didn't (apparently) change anything. I'm going for a fresh re-install to make sure I have a disciplined approach.

User avatar
procount
Posts: 2035
Joined: Thu Jun 27, 2013 12:32 pm
Location: UK

Re: Ubuntu from SSD - easy method

Thu Mar 26, 2020 2:57 pm

Fstab is ok. It's using partition label names to determine where the partitions are so no mods needed.
PINN - NOOBS with the extras... https://www.raspberrypi.org/forums/viewtopic.php?f=63&t=142574

Return to “Ubuntu”