lynnejohn
Posts: 8
Joined: Fri Mar 23, 2018 6:29 pm

Ubuntu image for the Raspberry Pi 3 B not booting via USB

Tue Mar 27, 2018 7:26 pm

I've been trying for the past week to get Ubuntu Mate 16.04.2 booting on a Pi 3 (Model B v1.2) via USB(using a Pi desktop module) with no luck. You can see my earlier attempts here:

https://askubuntu.com/questions/1018547 ... -3-via-usb

Using information from this thread I've tried this first :
----------------------------------------------------------------------------------------
Using a Ubuntu VM machine on a Window 7 PC image Ubuntu mate on USB(sdb is mounted on the VM)
sudo ddrescue -D --force /mnt/hgfs/PC_Downloads/ubuntu-mate-16.04.2-desktop-armhf-raspberry-pi.img /dev/sdb

--------Mount the Ubuntu Mate image USB onto the VM(device is /media/john/PI_BOOT and PI_ROOT) -----
--------Mount the latest Raspbian image USB onto the VM(device is /media/john/boot and rootfs) -----
--------Copy the files/directories mentioned in this thread-----
sudo cp -r /media/john/rootfs/lib/modules/4.9.80+ /media/john/PI_ROOT/lib/modules/
sudo cp -r /media/john/rootfs/lib/modules/4.9.80-v7+ /media/john/PI_ROOT/lib/modules/
sudo cp /media/john/rootfs/lib/firmware/brcm/brcmfmac43455-sdio.txt /media/john/PI_ROOT/lib/firmware/brcm
sudo cp /media/john/rootfs/lib/firmware/brcm/brcmfmac43455-sdio.clm_blob /media/john/PI_ROOT/lib/firmware/brcm
sudo cp /media/john/rootfs/lib/firmware/brcm/brcmfmac43455-sdio.bin /media/john/PI_ROOT/lib/firmware/brcm

sudo cp /media/john/boot/bootcode.bin /media/john/PI_BOOT
sudo cp /media/john/boot/fixup.dat /media/john/PI_BOOT
sudo cp /media/john/boot/start.elf /media/john/PI_BOOT
sudo cp /media/john/boot/bcm2710-rpi-3-b-plus.dtb /media/john/PI_BOOT
sudo cp /media/john/boot/kernel.img /media/john/PI_BOOT
sudo cp /media/john/boot/kernel7.img /media/john/PI_BOOT

-----Change cmdline.txt on PI_BOOT to have root=/dev/sda2
Using this method and booting the USB you will see the rainbow, then the four raspberries but nothing after that(sits forever.)
----------------------------------------------------------------------------------------
My second attempt I've tried this:
----------------------------------------------------------------------------------------
Using a Ubuntu VM machine on a Window 7 PC image Ubuntu mate on USB(sdb is mounted on the VM)
sudo ddrescue -D --force /mnt/hgfs/PC_Downloads/ubuntu-mate-16.04.2-desktop-armhf-raspberry-pi.img /dev/sdb

--------Mount the Ubuntu Mate image USB onto the VM(device is /media/john/PI_BOOT and PI_ROOT) -----
--------Delete all the files on PI_BOOT
--------Unmount the Ubuntu Mate USB from the VM
--------Format the PI_BOOT partition under windows 7 as a FAT32
--------Mount the Ubuntu Mate image USB onto the VM(device is /media/john/PI_BOOT and PI_ROOT) -----
--------Mount the latest Raspbian image USB onto the VM(device is /media/john/boot and rootfs) -----
--------Copy all the the Raspbian image boot files/directories onto the newly formatted PI_BOOT partition-----
sudo cp -r /media/john/boot/* /media/john/PI_BOOT/

--------Copy the Raspbian image root partition files/directories to the Ubuntu Mate partition -----
sudo cp -r /media/john/rootfs/lib/modules/4.9.80+ /media/john/PI_ROOT/lib/modules/
sudo cp -r /media/john/rootfs/lib/modules/4.9.80-v7+ /media/john/PI_ROOT/lib/modules/
sudo cp /media/john/rootfs/lib/firmware/brcm/brcmfmac43455-sdio.txt /media/john/PI_ROOT/lib/firmware/brcm
sudo cp /media/john/rootfs/lib/firmware/brcm/brcmfmac43455-sdio.clm_blob /media/john/PI_ROOT/lib/firmware/brcm
sudo cp /media/john/rootfs/lib/firmware/brcm/brcmfmac43455-sdio.bin /media/john/PI_ROOT/lib/firmware/brcm

This method will boot and display the Ubuntu Mate logo but then fail at the emergency mode prompt. It also says "Failed to start Load Kernel Modules".

So both methods do seem to see the USB drive as the root partition and my preference would be to use the method described earlier in this thread.

Is there any way to get Ubuntu Mate to spit out things during the boot process so I could figure out what is not working with the method described in this thread?

If that is to difficult is there any way to figure out why method two(where I just copy the Raspbian boot onto PI_BOOT) is complaining about the kernel modules not being loaded?

Thanks,
John C.

User avatar
DougieLawson
Posts: 33314
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Ubuntu image for the Raspberry Pi 3 B not booting via USB

Wed Mar 28, 2018 11:24 am

Have you changed the /boot/cmdline.txt and /etc/fstab entries to allow USB booting?

The rootfs is defined on /dev/mmcblk0p? in both places. /boot is defined on /dev/mmcblk0p? in /etc/fstab

All of those references need to point to /dev/sd? or PARTUUID to boot from USB.

Here's that stuff from Raspbian

Code: Select all

[email protected]:~ # cat /boot/cmdline.txt
dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=86c71275-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles
[email protected]:~ #

Code: Select all

[email protected]:~ # cat /etc/fstab
proc            /proc           proc    defaults          0       0
PARTUUID=86c71275-01  /boot           vfat    defaults          0       2
PARTUUID=86c71275-02  /               ext4    defaults,noatime  0       1
# a swapfile is not a swap partition, no line here
#   use  dphys-swapfile swap[on|off]  for that
[email protected]:~ #
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

lynnejohn
Posts: 8
Joined: Fri Mar 23, 2018 6:29 pm

Re: Ubuntu image for the Raspberry Pi 3 B not booting via USB

Wed Mar 28, 2018 12:41 pm

I had changed the PI_BOOT/cmdline.txt to have a "root=/dev/sda2". I definitely did not change the PI_ROOT/etc/fstab file. I tried fstab as this with no luck:

proc /proc proc defaults 0 0
/dev/sda2 / ext4 defaults,noatime 0 1
/dev/sda2 /boot/ vfat defaults 0 2

Should the ext4 partition(PI_ROOT) be sda3? Without being able to run a df command on the system I'm just guessing as to the device names(I'm no Linux expert.)

Thanks.

User avatar
DougieLawson
Posts: 33314
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Ubuntu image for the Raspberry Pi 3 B not booting via USB

Wed Mar 28, 2018 12:58 pm

How can you be sure that your USB stick appears at /dev/sda?
Use PARTUUID (discovered with a sudo blkid command) it's more reliable.

/boot will be on /dev/sda1 since it needs to be on a seperate FAT formatted partition or it won't work.

Try writing a copy of Raspbian to a USB stick and booting that so you can take a look at how it's set-up and how things like blkid work.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

lynnejohn
Posts: 8
Joined: Fri Mar 23, 2018 6:29 pm

Re: Ubuntu image for the Raspberry Pi 3 B not booting via USB

Wed Mar 28, 2018 1:54 pm

Took forever to try an get the Raspbian image loaded(issues using ddrescue.) Here is the output of sudo blkid:

/dev/sda1: LABEL="boot" UUID="A75B-DC79" TYPE="vfat" PARTUUID="46b09bf9-01"
/dev/sda2: LABEL="rootfs" UUID="485ec5bf-9c78-45a6-9314-32be1d0dea38" TYPE="ext4" PARTUUID="46b09bf9-02"

I'll go back in and sda1/sda2 in fstab.

User avatar
DougieLawson
Posts: 33314
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Ubuntu image for the Raspberry Pi 3 B not booting via USB

Wed Mar 28, 2018 2:22 pm

You can't use /dev/sda? as that may not be the device that's emumerated by the kernel.

Stick

Code: Select all

root=PARTUUID=46b09bf9-02
in /boot/cmdline.txt
Stick

Code: Select all

proc            /proc           proc    defaults          0       0
PARTUUID=46b09bf9-01  /boot           vfat    defaults          0       2
PARTUUID=46b09bf9-02  /               ext4    defaults,noatime  0       1
in /etc/fstab and you should be good to go.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

lynnejohn
Posts: 8
Joined: Fri Mar 23, 2018 6:29 pm

Re: Ubuntu image for the Raspberry Pi 3 B not booting via USB

Wed Mar 28, 2018 3:18 pm

So changing PI_BOOT/cmdline.txt and PI_ROOT/etc/fstab to use sda2 and sda1/sda2 did not work. Just getting the four raspberries and a blinking green drive light.

When I swap out the entire PI_BOOT files with those of the Raspbian image boot, the system will boot but fail later on. This makes me think there is something else missing on the normal PI_BOOT that gets the USB to work(maybe some USB or Broadcomm driver file?)

lynnejohn
Posts: 8
Joined: Fri Mar 23, 2018 6:29 pm

Re: Ubuntu image for the Raspberry Pi 3 B not booting via USB

Wed Mar 28, 2018 3:30 pm

Modified PI_ROOT/etc/fstab to:
proc /proc proc defaults 0 0
PARTUUID=46b09bf9-01 /boot/ vfat defaults 0 2
PARTUUID=46b09bf9-02 / ext4 defaults,noatime 0 1

Modified PI_BOOT/cmdline.txt to:
root=PARTUUID=46b09bf9-02


Still not happy. Rainbow, four raspberries and blinking green led. What do the 1 and 2 mean(at the end of the line) in the fstab file?

User avatar
DougieLawson
Posts: 33314
Joined: Sun Jun 16, 2013 11:19 pm
Location: Basingstoke, UK
Contact: Website

Re: Ubuntu image for the Raspberry Pi 3 B not booting via USB

Wed Mar 28, 2018 5:51 pm

They are the partition numbers. Take a look with sudo fdisk -l to see how your device is partitioned.
Microprocessor, Raspberry Pi & Arduino Hacker
Mainframe database troubleshooter
MQTT Evangelist
Twitter: @DougieLawson

2012-18: 1B*5, 2B*2, B+, A+, Z, ZW, 3Bs*3, 3B+

Any DMs sent on Twitter will be answered next month.

feelslikeautumn
Posts: 242
Joined: Wed Aug 09, 2017 9:51 pm

Re: Ubuntu image for the Raspberry Pi 3 B not booting via USB

Wed Mar 28, 2018 7:21 pm

I'm not sure why this got moved, but I answered it where you originally posted it - viewtopic.php?f=63&t=208538&start=75

I would use /dev/sda when first trying to get it to boot, but it is probably a good idea to switch to uuid once you have it booting.

feelslikeautumn
Posts: 242
Joined: Wed Aug 09, 2017 9:51 pm

Re: Ubuntu image for the Raspberry Pi 3 B not booting via USB

Wed Mar 28, 2018 7:24 pm

lynnejohn wrote:
Wed Mar 28, 2018 12:41 pm
I had changed the PI_BOOT/cmdline.txt to have a "root=/dev/sda2". I definitely did not change the PI_ROOT/etc/fstab file. I tried fstab as this with no luck:

proc /proc proc defaults 0 0
/dev/sda2 / ext4 defaults,noatime 0 1
/dev/sda2 /boot/ vfat defaults 0 2

Should the ext4 partition(PI_ROOT) be sda3? Without being able to run a df command on the system I'm just guessing as to the device names(I'm no Linux expert.)

Thanks.
You don't want both lines to have /dev/sda2. The last line should be /dev/sda1

feelslikeautumn
Posts: 242
Joined: Wed Aug 09, 2017 9:51 pm

Re: Ubuntu image for the Raspberry Pi 3 B not booting via USB

Wed Mar 28, 2018 7:32 pm

lynnejohn wrote:
Wed Mar 28, 2018 3:18 pm
So changing PI_BOOT/cmdline.txt and PI_ROOT/etc/fstab to use sda2 and sda1/sda2 did not work. Just getting the four raspberries and a blinking green drive light.

When I swap out the entire PI_BOOT files with those of the Raspbian image boot, the system will boot but fail later on. This makes me think there is something else missing on the normal PI_BOOT that gets the USB to work(maybe some USB or Broadcomm driver file?)
As I said on the other thread, you need to update the bootloader files in Ubuntu-mate. You must have bootloader files from after April 2017. So copy across the latest bootcode.bin, fixup.dat and start.elf files.

lynnejohn
Posts: 8
Joined: Fri Mar 23, 2018 6:29 pm

Re: Ubuntu image for the Raspberry Pi 3 B not booting via USB

Wed Mar 28, 2018 8:17 pm

Finally have reached the installation portion of Ubuntu Mate(hard to tell if it is frozen or just running slowly from the USB at this point.) I went back to using sda1/sda2(out of desperation.)

PI_ROOT/etc/fstab:
proc /proc proc defaults 0 0
/dev/sda2 / ext4 defaults,noatime 0 1
/dev/sda1 /boot vfat defaults 0 2

PI_BOOT/cmdline.txt:
root= /dev/sda2

I also added these files to the PI_BOOT from the Raspbian img(don't really know if they are part of the answer at this point):
sudo cp /media/john/boot/bcm2708-rpi-0-w.dtb /media/john/PI_BOOT
sudo cp /media/john/boot/bcm2708-rpi-b.dtb /media/john/PI_BOOT
sudo cp /media/john/boot/bcm2708-rpi-b-plus.dtb /media/john/PI_BOOT
sudo cp /media/john/boot/bcm2708-rpi-cm.dtb /media/john/PI_BOOT
sudo cp /media/john/boot/bcm2709-rpi-2-b.dtb /media/john/PI_BOOT
sudo cp /media/john/boot/bcm2710-rpi-3-b.dtb /media/john/PI_BOOT
sudo cp /media/john/boot/bcm2710-rpi-3-b-plus.dtb /media/john/PI_BOOT
sudo cp /media/john/boot/bcm2710-rpi-cm3.dtb /media/john/PI_BOOT

I'll update once I have completed the upgrade process. Thanks for all the help...

lynnejohn
Posts: 8
Joined: Fri Mar 23, 2018 6:29 pm

Re: Ubuntu image for the Raspberry Pi 3 B not booting via USB

Thu Mar 29, 2018 1:02 pm

All is running from the USB. I ran the "sudo apt-get update" and "sudo apt-get dist-upgrade" and everything went well. I'm going to summarize the procedure for others but it should be noted that the only way I got this to work on a Windows PC was by having a virtual machine running Ubuntu 14.04 so I could copy and edit files.

A 2018-03-13-raspbian-stretch.img file to a USB stick(I did this via Win32DskImager.)
A ubuntu-mate-16.04.2-desktop-armhf-raspberry-pi.img to a USB stick(I did this via Win32DskImager.)

Using a Ubuntu 14.04 virtual machine mount both USB drives. You should see four disks: PI_BOOT, PI_ROOT, boot and rootfs.

Run the following commands for copying files(you will need to change the "john" portion of the path to match the location on your virtual machine):
sudo cp -r /media/john/rootfs/lib/modules/4.9.80+ /media/john/PI_ROOT/lib/modules/
sudo cp -r /media/john/rootfs/lib/modules/4.9.80-v7+ /media/john/PI_ROOT/lib/modules/
sudo cp /media/john/rootfs/lib/firmware/brcm/brcmfmac43455-sdio.txt /media/john/PI_ROOT/lib/firmware/brcm
sudo cp /media/john/rootfs/lib/firmware/brcm/brcmfmac43455-sdio.clm_blob /media/john/PI_ROOT/lib/firmware/brcm
sudo cp /media/john/rootfs/lib/firmware/brcm/brcmfmac43455-sdio.bin /media/john/PI_ROOT/lib/firmware/brcm

sudo cp /media/john/boot/bootcode.bin /media/john/PI_BOOT
sudo cp /media/john/boot/fixup.dat /media/john/PI_BOOT
sudo cp /media/john/boot/start.elf /media/john/PI_BOOT
sudo cp /media/john/boot/bcm2710-rpi-3-b-plus.dtb /media/john/PI_BOOT
sudo cp /media/john/boot/kernel.img /media/john/PI_BOOT
sudo cp /media/john/boot/kernel7.img /media/john/PI_BOOT

I'm not positive that these files are necessary...
sudo cp /media/john/boot/bcm2708-rpi-0-w.dtb /media/john/PI_BOOT
sudo cp /media/john/boot/bcm2708-rpi-b.dtb /media/john/PI_BOOT
sudo cp /media/john/boot/bcm2708-rpi-b-plus.dtb /media/john/PI_BOOT
sudo cp /media/john/boot/bcm2708-rpi-cm.dtb /media/john/PI_BOOT
sudo cp /media/john/boot/bcm2709-rpi-2-b.dtb /media/john/PI_BOOT
sudo cp /media/john/boot/bcm2710-rpi-3-b.dtb /media/john/PI_BOOT
sudo cp /media/john/boot/bcm2710-rpi-3-b-plus.dtb /media/john/PI_BOOT
sudo cp /media/john/boot/bcm2710-rpi-cm3.dtb /media/john/PI_BOOT

To edit the next files you need to be super user so launch gedit from the command line with "sudo gedit":
From gedit change the /media/john/PI_BOOT/cmdline.txt file so that "root=/dev/sda2"

From gedit change the /media/john/PI_ROOT/etc/fstab file to:
proc /proc proc defaults 0 0
/dev/sda2 / ext4 defaults,noatime 0 1
/dev/sda1 /boot vfat defaults 0 2

I'm also including the outputs to a couple commands that Lawson had requested in this thread:
---------sudo fdisk -l-------------
Disk /dev/sda: 14.6 GiB, 15664676864 bytes, 30595072 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x1d8c09f0

Device Boot Start End Sectors Size Id Type
/dev/sda1 2048 131071 129024 63M c W95 FAT32 (LBA)
/dev/sda2 131072 30595071 30464000 14.5G 83 Linux


-----------sudo blkid-----------------------
/dev/sda1: SEC_TYPE="msdos" LABEL="PI_BOOT" UUID="EAD0-90DA" TYPE="vfat" PARTUUID="1d8c09f0-01"
/dev/sda2: LABEL="PI_ROOT" UUID="9d97a4df-a4eb-4b09-92b6-bb1ccfade0ee" TYPE="ext4" PARTUUID="1d8c09f0-02"
/dev/sdb1: LABEL="ESD-ISO" UUID="28FD-99AA" TYPE="vfat" PARTUUID="000aad08-01"

Thanks again Lawson for all the help getting this working!

Now I'm off to see if I can get a msata drive to work(via a Pi Desktop interface card.)

John C.

lynnejohn
Posts: 8
Joined: Fri Mar 23, 2018 6:29 pm

Re: Ubuntu image for the Raspberry Pi 3 B not booting via USB

Thu Mar 29, 2018 1:13 pm

feelslikeautumn wrote:
Wed Mar 28, 2018 7:32 pm
lynnejohn wrote:
Wed Mar 28, 2018 3:18 pm
So changing PI_BOOT/cmdline.txt and PI_ROOT/etc/fstab to use sda2 and sda1/sda2 did not work. Just getting the four raspberries and a blinking green drive light.

When I swap out the entire PI_BOOT files with those of the Raspbian image boot, the system will boot but fail later on. This makes me think there is something else missing on the normal PI_BOOT that gets the USB to work(maybe some USB or Broadcomm driver file?)
As I said on the other thread, you need to update the bootloader files in Ubuntu-mate. You must have bootloader files from after April 2017. So copy across the latest bootcode.bin, fixup.dat and start.elf files.
autum,
For some reason I was not seeing your replies till now. I did show the bootloader files being copied in the first post where I copy between boot and PI_BOOT drives(it was a very long post.)

John C.

djchewmacca
Posts: 1
Joined: Wed Apr 04, 2018 5:00 am

Re: Ubuntu image for the Raspberry Pi 3 B not booting via USB

Wed Apr 04, 2018 5:07 am

I've got a working version for the B+. However the built in WiFi doesn't work. It's a noobs image so you can multiboot it with other OS's.

Here's the link: https://www.dropbox.com/s/t3w33mxh8e09l ... s.zip?dl=0

Return to “Other”

Who is online

Users browsing this forum: No registered users and 3 guests