Booting Ubuntu Server 20.04 on Pi 4 from USB

7,464

Solution 1

As of writing, there is no easy way of booting the preinstalled raspberry pi ubuntu-server image from usb only.

But there is an easy workaround - that worked for me:

  • copy the image to micro-sd-card and usb-stick/harddrive
  • delete the second partition named "writeable" from the micro-sd-card
  • (not necessary - but might avoid later complications) delete the first partition named "system-boot" from the usb-stick/harddrive
  • have both devices plugged in on boot

Since the boot-device selection in the preinstalled-images uses the "Label" option to identify the devices, this works.

Solution 2

You can boot from usb only.
TL,DR : extract vmlinuz to vmlinux in the boot partition of the ubuntu image from their website.

explaination: per the official ubuntu wiki page for arm processors, you need to edit config.txt in the boot partition, and replace the kernel line to kernel=vmlinuz
only problem is vmlinuz is compressed. so you have to decompress it to vmlinux.
(easy way to extract use sudo dd if=vmlinuz bs=1 | zcat > vmlinux)

credit source: raspberry forum, visit this link for step-by-step guide.

EDIT
I wrote the official ubuntu 64bit image for rpi4
I then edited config.txt with kernel=vmlinux instead of using vmlinuz
(don't forget adding initramfs initrd.img followkernel per the wiki page).
then replaced *.elf and *.dat files on the boot partition with the ones from raspberry pi/firmware github repo

Share:
7,464
Guest
Author by

Guest

Updated on September 18, 2022

Comments

  • Guest
    Guest over 1 year

    After Raspberry PI 4 firmware upgrade 15 June, I can boot PI OS on USB and yesterday night after a few attempts and some kernel panics (caused by enable_uart=1 inside the config.txt file in the boot folder) I managed to get a good working version of Manjaro XFCE 20.06. One of the issues was that some of the files in the boot folder were no longer in sync with the 15 June beta firmware update so I had to retrieve old .elf and .dat files, replace them in the boot folder and eventually I got it all working.

    This isn't the case with Ubuntu Server (Arm) 20.04. The Downloaded image fails to boot from USB and the files trick didn't work. It doesn't detect USB, doesn't detect network either and then it just gets stuck at a rudimentary prompt in which I can't type because apparently USB doesn't work.

    Any clues?

    • Nmath
      Nmath almost 4 years
      The raspi preinstalled server images are for flashing to a SD card. It's not like the server install media. The OS is preinstalled for the raspi (armhf or arm64). You're not trying to boot from a flash drive in the USB port are you?
    • Guest
      Guest almost 4 years
      Hmmm... Preinstalled... I think I see what you mean. I will try and see what I manage to do. Thanks!
    • rgas05
      rgas05 over 3 years
      This appears this has been fixed in Ubuntu Server & Desktop 20.10, was able to boot with no issue after many failed attempts with 20.04. Obviously not great if you wanted to stick with 20.04 LTS (I know I did), but it works nonetheless.
    • Thijs
      Thijs almost 3 years
      This is still a problem, only 21.04 written with Raspberry Pi Imager will boot from USB.
  • Guest
    Guest almost 4 years
    Thanks! I will give it a try later in the evening
  • DerWOK
    DerWOK over 3 years
    really clever - and no sweat. it requires the sd card to start, but uses whatever is in the usb connection. I copied the two directories from the sd card to an old harddisk (with gparted - preserves the label!). now i have a rpi4 with 1TB disk...Thanks a lot!
  • wureka
    wureka over 3 years
    I followed your process on Ubuntu 20.10 for ARM8 64bit. Finally I was stock in "sudo dd if=vmlinuz bs=1 | zcat > vmlinu". The message is "not in gzip format".
  • lucassp
    lucassp over 3 years
    Same problem here :|
  • Admin
    Admin over 3 years
    vmlinuz is compressed on the 20.04 version as per the title on the question, Ubuntu team may have corrected this on 20.10 version and now could be unzipped. try changing config.txt and put kernel=vmlinuz then see how it goes