[ODROID-C2 minimal image issue] Cannot boot from USB drive

Post Reply
g000444555
Posts: 25
Joined: Sat Feb 11, 2017 11:47 pm
languages_spoken: english
ODROIDs: 9 x ODROID-C2
Has thanked: 0
Been thanked: 0
Contact:

[ODROID-C2 minimal image issue] Cannot boot from USB drive

Unread post by g000444555 » Tue Jul 18, 2017 4:19 am

Hi,

The ubuntu64-16.04-minimal-odroid-c2-20160815 image with the latest updates is unable to boot from a USB drive. Following are the steps to reproduce the issue:

I flushed the http://de.eu.odroid.in/ubuntu_16.04lts/ ... 815.img.xz to an SD card and a USB drive.

Then I connected the SD card and the USB drive to an ODROID-C2 (rev0.2 20160226) and performed a dist-upgrade:

Code: Select all

apt-get -y update
apt-get -y upgrade
apt-get -y dist-upgrade
apt-get -y install git nano libpam-systemd

I modified the bootargs property inside /media/boot/boot.ini.default as follows (the /dev/sda2 is my USB drive with the flushed OS image)

Code: Select all

bootargs=root=/dev/sda2 rootwait ro ${condev} no_console_suspend hdmimode=${m} ${comde} m_bpp=${m_bpp} vout=${vout} fsck.repair=yes net.ifnames=0 elevator=noop disablehpd=${hpd} max_freq=${max_freq} maxcpus=${maxcpus} monitor_onoff=${monitor_onoff} disableuhs=${disableuhs} mmc_removable=${mmc_removable}
And run the command

Code: Select all

 sudo bootini
When I reboot the screen goes blank even though the blue led keeps blinking. The system will not startup at all and there are no messages whatsoever.

Could you please fix or help me address the issue?
Last edited by g000444555 on Wed Aug 02, 2017 3:32 am, edited 1 time in total.

User avatar
odroid
Site Admin
Posts: 31799
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 86 times
Been thanked: 242 times
Contact:

Re: [ODROID-C2 minimal image issue] Cannot boot from USB dri

Unread post by odroid » Tue Jul 18, 2017 2:05 pm

Did you have no issue before update the system?
Did you update the kernel with "install linux-image-c2" too?
http://odroid.com/dokuwiki/doku.php?id= ... and_system

Also refer this article to add the USB disk UUID into the boot parameter.
https://magazine.odroid.com/wp-content/ ... df#page=34

g000444555
Posts: 25
Joined: Sat Feb 11, 2017 11:47 pm
languages_spoken: english
ODROIDs: 9 x ODROID-C2
Has thanked: 0
Been thanked: 0
Contact:

Re: [ODROID-C2 minimal image issue] Cannot boot from USB dri

Unread post by g000444555 » Tue Jul 18, 2017 7:38 pm

Did you have no issue before update the system?
No, the issue occurs only after update
Did you update the kernel with "install linux-image-c2" too?
Unfortunately, the same issue persist after kernel update too
Also refer this article to add the USB disk UUID into the boot parameter.
https://magazine.odroid.com/wp-content/ ... df#page=34
Both the SD card's and the USB drive's second partitions have the same UUID, so I have to use /dev/sda2 in order to designate them:

Code: Select all

# lsblk -f
NAME        FSTYPE LABEL  UUID                                 MOUNTPOINT
sda
|-sda1      vfat   boot   E2F1-BA72
`-sda2      ext4   rootfs e139ce78-9841-40fe-8823-96a304a09859
mmcblk0
|-mmcblk0p1 vfat   boot   E2F1-BA72                            /media/boot
`-mmcblk0p2 ext4   rootfs e139ce78-9841-40fe-8823-96a304a09859 /

User avatar
odroid
Site Admin
Posts: 31799
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 86 times
Been thanked: 242 times
Contact:

Re: [ODROID-C2 minimal image issue] Cannot boot from USB dri

Unread post by odroid » Wed Jul 19, 2017 9:47 am

Change the UUID of one of the storages.

g000444555
Posts: 25
Joined: Sat Feb 11, 2017 11:47 pm
languages_spoken: english
ODROIDs: 9 x ODROID-C2
Has thanked: 0
Been thanked: 0
Contact:

Re: [ODROID-C2 minimal image issue] Cannot boot from USB dri

Unread post by g000444555 » Wed Jul 19, 2017 7:29 pm

I changed the UUID:

Code: Select all

# tune2fs /dev/sda2 -U 48aa5a49-0d5b-428e-9493-b7c7f3a2f03c
# lsblk -f
NAME        FSTYPE LABEL  UUID                                 MOUNTPOINT
sda
|-sda1      vfat   boot   E2F1-BA72
`-sda2      ext4   rootfs 48aa5a49-0d5b-428e-9493-b7c7f3a2f03c
mmcblk0
|-mmcblk0p1 vfat   boot   E2F1-BA72                            /media/boot
`-mmcblk0p2 ext4   rootfs e139ce78-9841-40fe-8823-96a304a09859 /
Edited the bootargs property inside /media/boot/boot.ini.default:

Code: Select all

bootargs=root=UUID=48aa5a49-0d5b-428e-9493-b7c7f3a2f03c rootwait ro ${condev} no_console_suspend hdmimode=${m} ${comde} m_bpp=${m_bpp} vout=${vout} fsck.repair=yes net.ifnames=0 elevator=noop disablehpd=${hpd} max_freq=${max_freq} maxcpus=${maxcpus} monitor_onoff=${monitor_onoff} disableuhs=${disableuhs} mmc_removable=${mmc_removable}
Edited fstab in both the SD Card AND the USB drive:

Code: Select all

# UNCONFIGURED FSTAB FOR BASE SYSTEM
LABEL=boot /media/boot vfat defaults 0 0
UUID=48aa5a49-0d5b-428e-9493-b7c7f3a2f03c / ext4 defaults 0 0

UUID=48aa5a49-0d5b-428e-9493-b7c7f3a2f03c / ext4 errors=remount-ro,noatime 0 1
Run the command bootini in order to apply the changed in /media/boot/boot.ini

Code: Select all

# bootini
# cat /media/boot/boot.ini | grep bootargs
setenv bootargs "root=UUID=48aa5a49-0d5b-428e-9493-b7c7f3a2f03c rootwait ro ${condev} no_console_suspend hdmimode=${m} ${comde} m_bpp=${m_bpp} vout=${vout} fsck.repair=yes net.ifnames=0 elevator=noop disablehpd=${hpd} max_freq=${max_freq} maxcpus=${maxcpus} monitor_onoff=${monitor_onoff} disableuhs=${disableuhs} mmc_removable=${mmc_removable}"
Again, when I reboot the screen goes blank even though the blue led keeps blinking. The system will not startup at all and there are no messages whatsoever. The ethernet port's orange led is on, and the green led is off. The fing command will not discover the board in the LAN, therefore it's not a screen issue and the system does not startup at all.

User avatar
odroid
Site Admin
Posts: 31799
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 86 times
Been thanked: 242 times
Contact:

Re: [ODROID-C2 minimal image issue] Cannot boot from USB dri

Unread post by odroid » Wed Jul 19, 2017 8:22 pm

The UUID looks fine.

How did you copy the root file system from the SD to the USB disk?
What happens if you place the SD card UUID in the bootargs? Does it boot from SD card?

g000444555
Posts: 25
Joined: Sat Feb 11, 2017 11:47 pm
languages_spoken: english
ODROIDs: 9 x ODROID-C2
Has thanked: 0
Been thanked: 0
Contact:

Re: [ODROID-C2 minimal image issue] Cannot boot from USB dri

Unread post by g000444555 » Thu Jul 20, 2017 2:41 am

How did you copy the root file system from the SD to the USB disk?
After upgrade (apt-get update; apt-get upgrade; apt-get dist-upgrade; apt-get install linux-image-c2), I cloned the SD card to the USB disk

Code: Select all

umount /dev/mmcblk0p1
umount /dev/mmcblk0p2
sudo dd bs=10M count=463 if=/dev/mmcblk0 | gzip > os.img.gz
sync
sync
umount /dev/sdb1
umount /dev/sdb2
gunzip --stdout os.img.gz | sudo dd bs=10M of=/dev/sdb
sync
sync
The same problem occurs if I simply flush the same ubuntu64-16.04-minimal-odroid-c2-20160815.img.xz image to the USB disk:

Code: Select all

umount /dev/sdb1
umount /dev/sdb2
xzcat ubuntu64-16.04-minimal-odroid-c2-20160815.img.xz | sudo dd bs=10M status=progress of=/dev/sdb
sync
sync
sync
What happens if you place the SD card UUID in the bootargs? Does it boot from SD card?
Yes

The SD card's UUID was the default configuration to begin with and it is booting fine:

Code: Select all

# cat /media/boot/boot.ini | grep bootargs
setenv bootargs "root=UUID=e139ce78-9841-40fe-8823-96a304a09859 rootwait ro ${condev} no_console_suspend hdmimode=${m} ${cmode} m_bpp=${m_bpp} vout=${vout} fsck.repair=yes net.ifnames=0 elevator=noop disablehpd=${hpd} max_freq=${max_freq} maxcpus=${maxcpus} monitor_onoff=${monitor_onoff} disableuhs=${disableuhs} mmc_removable=${mmc_removable} usbmulticam=${usbmulticam} ${hid_quirks}"
As described previously, the problem occurs when switching to the USB disk's UUID.

Once I switch to the USB disk's UUID in boot.ini.default and run bootini then manually reverting back to the SD card UUID in the boot.ini does not work either. The only way to revert after that is to copy the original backup of the boot partition back to the SD card. Then it boots normally from the SD card.

Last but not least mind that:
  • The problem only occurs after updating the ubuntu64-16.04-minimal-odroid-c2-20160815.img.xz image
  • I have tried to do the same with the debian image http://oph.mdrjr.net/meveric/images/Jes ... -C2.img.xz and it worked fine. However, I need to use the officially supported ubuntu image at this point.

User avatar
odroid
Site Admin
Posts: 31799
Joined: Fri Feb 22, 2013 11:14 pm
languages_spoken: English
ODROIDs: ODROID
Has thanked: 86 times
Been thanked: 242 times
Contact:

Re: [ODROID-C2 minimal image issue] Cannot boot from USB dri

Unread post by odroid » Thu Jul 20, 2017 10:31 am

Instead of dd command, use "rsync" to copy the rootfs to pre-formatted(EXT4) USB storge as explained in the Magazine article I pointed.
Or this original guide.
viewtopic.php?f=52&t=23925

brad
Posts: 957
Joined: Tue Mar 29, 2016 1:22 pm
languages_spoken: english
ODROIDs: C2 N1 N2 H2 (64 bit ftw)
Location: Australia
Has thanked: 14 times
Been thanked: 30 times
Contact:

Re: [ODROID-C2 minimal image issue] Cannot boot from USB dri

Unread post by brad » Sun Jul 30, 2017 10:43 am

g000444555 wrote: I flushed the http://de.eu.odroid.in/ubuntu_16.04lts/ ... 815.img.xz to an SD card and a USB drive.

Then I connected the SD card and the USB drive to an ODROID-C2 (rev0.2 20160226) and performed a dist-upgrade:

Code: Select all

apt-get -y update
apt-get -y upgrade
apt-get -y dist-upgrade
apt-get -y install git nano libpam-systemd

I modified the bootargs property inside /media/boot/boot.ini.default as follows (the /dev/sda2 is my USB drive with the flushed OS image)
I think this is the part that is causing the confusion.

I suspect you have both sd & usb mounted and the updates are updating the sdcard bootloader but is updating the fat partition on the usb drive with the kernel, devicetree & boot.ini causing a mismatched boot environment.

Would be interesting to see how /media/boot is mounted before you perform an update and if it is mounted to the sdcard..

Code: Select all

root@odroid64:~# mount | grep /media
/dev/mmcblk0p1 on /media/boot type vfat (rw,nosuid,nodev,relatime,fmask=0000,dmask=0000,allow_utime=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,flush,errors=remount-ro)

g000444555
Posts: 25
Joined: Sat Feb 11, 2017 11:47 pm
languages_spoken: english
ODROIDs: 9 x ODROID-C2
Has thanked: 0
Been thanked: 0
Contact:

Re: [ODROID-C2 minimal image issue] Cannot boot from USB dri

Unread post by g000444555 » Wed Aug 02, 2017 3:45 am

I gave up for the time being with the issue. I will let you know if I look into it in the future. The issue seems too trivial to exist in first place more so to be "difficult" to fix, therefore I gave up with the official distro altogether.

You have got a point but I don't think that was the issue neither do I think it was a problematic copy (dd, rsync or whatever) because other distros don't have this issue (tried Debian and ArchLinux).

If I remember correctly, I did the upgrade without having the USB disk mounted and only afterwards I did a dd-copy (with the updates) to the USB disk and plugged it in.

One issue I observed was that the ubuntu distro uses LABEL=boot in fstab and both the SD card and USB drive had the same label and UUID for the boot partition. I changed the UUID and tried mounting with UUID instead of label, but still the issue was there.

I suspect the issue is in the `bootini` utility or in the updated kernel or the ramdisk or the u-boot.

Post Reply

Return to “Ubuntu”

Who is online

Users browsing this forum: No registered users and 2 guests