User avatar
PeterO
Posts: 5884
Joined: Sun Jul 22, 2012 4:14 pm

Re: USB boot now working on Pi3

Sun Dec 04, 2016 9:02 am

ravustaja wrote:I have set PARTUUID in cmdline.txt and disk-by-uuid in fstab, so that shouldn't be the problem either. It seems like after connecting the hub, it isn't even trying to boot. Nothing just happens when I turn the power on. Everything works fine when I unplug the hub. Switching them around doesn't work either.
OK, but I think that's all to do with the booted kernel identifying which disk to use to mount the root filesystem. The firmware booting happens before cmdline.txt is read and passed to the freshly loaded kernel.
But if switching the cables over doesn't fix it then there is something else going wrong. You could file a bug on github for the firmware.

PeterO

PS, I can try it myself later on today when I get round to powering up my PIs.
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

ravustaja
Posts: 8
Joined: Thu Oct 13, 2016 11:06 am

Re: USB boot now working on Pi3

Sun Dec 04, 2016 10:09 am

PeterO wrote:PS, I can try it myself later on today when I get round to powering up my PIs.
That would be much appreciated! Let me know how it turns out.

epoch1970
Posts: 5135
Joined: Thu May 05, 2016 9:33 am
Location: Paris, France

Re: USB boot now working on Pi3

Fri Dec 09, 2016 12:27 pm

Just to report I finally tried switching a Pi 3 to usb boot, with a Toshiba Canvio Basics 1TB drive directly attached to the Pi 3.
Following the nice how-to on github, it just worked.
Thanks a lot, that's great!!

One question (sorry if it has been answered above in the thread), does it work the same with a larger drive formatted with a GPT partition scheme?

PS: HDD hardware identification

Code: Select all

root@berck:~# smartctl -a /dev/sda -d scsi
smartctl 6.4 2014-10-07 r4002 [armv7l-linux-4.4.35-v7+] (local build)
Copyright (C) 2002-14, Bruce Allen, Christian Franke, www.smartmontools.org

=== START OF INFORMATION SECTION ===
Vendor:               TOSHIBA
Product:              External USB 3.0
Revision:             5438
Compliance:           SPC-4
User Capacity:        1,000,204,883,968 bytes [1.00 TB]
Logical block size:   512 bytes
Serial number:        20160815011226
Device type:          disk
Local Time is:        Fri Dec  9 11:26:06 2016 CET
SMART support is:     Unavailable - device lacks SMART capability.

=== START OF READ SMART DATA SECTION ===

Error Counter logging not supported

Device does not support Self Test logging
Again, thanks for a great new feature.
"S'il n'y a pas de solution, c'est qu'il n'y a pas de problème." Les Shadoks, J. Rouxel

User avatar
DougieLawson
Posts: 39161
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: USB boot now working on Pi3

Fri Dec 09, 2016 1:55 pm

I don't think there's any support for GPT drives, everything needs an old fashioned partition table.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

User avatar
PeterO
Posts: 5884
Joined: Sun Jul 22, 2012 4:14 pm

Re: USB boot now working on Pi3

Fri Dec 09, 2016 2:51 pm

ravustaja wrote:
PeterO wrote:PS, I can try it myself later on today when I get round to powering up my PIs.
That would be much appreciated! Let me know how it turns out.
Sorry not to have replied, but I'm now reorganising my desk/workspace and my PIs are in boxes for a few days.
PeterO
Discoverer of the PI2 XENON DEATH FLASH!
Interests: C,Python,PIC,Electronics,Ham Radio (G0DZB),1960s British Computers.
"The primary requirement (as we've always seen in your examples) is that the code is readable. " Dougie Lawson

gsh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1557
Joined: Sat Sep 10, 2011 11:43 am

Re: USB boot now working on Pi3

Mon Dec 12, 2016 9:51 pm

Actually GPT should work fine...
--
Gordon Hollingworth PhD
Raspberry Pi - Director of Software Engineering

gsh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 1557
Joined: Sat Sep 10, 2011 11:43 am

Re: USB boot now working on Pi3

Mon Dec 12, 2016 9:58 pm

rhester72 wrote:A few (unanswered, I believe) questions, if I may (hi, Gordon! =):

- Given that program_usb_boot_timeout (which is incorrectly documented in bootflow.md and host.md as program_usb_timeout, BTW - caused me no end of confusion at first ;) presumably blows an OTP fuse, is it reasonable to assume that means you can never remove the +5s timeout once set?
Oops... Can you give me a link and I'll update that...

No you can't remove the setting, once set it's set...
rhester72 wrote:A few (unanswered, I believe) questions, if I may (hi, Gordon! =):

- In a similar vein, once program_gpio_bootmode is properly documented (so we know what to set it to to default to/force USB boot instead of having to leave an empty microSD card inserted), if we do set it for USB-only boot, and that blows an OTP fuse, does that mean we can never set the RPi to boot from SD (only) again?
Correct, once you set it to gpio bootmode then you'll have to add a resistor to make it boot from the required boot mode...
rhester72 wrote:A few (unanswered, I believe) questions, if I may (hi, Gordon! =):

- Is there any further information on why the load average goes up to 0.25 (i.e. one core fully utilized) when booting from USB? In Raspbian, it appears related to a kworker thread, but I'm at quite the loss as to what it's actually doing (other than raising my core temp 11C and processing 2x the interrupts and 8x the context switches, as shown by munin).

Much thanks for any insight,

Rodney
Not sure about this, I would guess it's something to do with the USB drive being active, can you link to the discussion?

Thanks

Gordon
--
Gordon Hollingworth PhD
Raspberry Pi - Director of Software Engineering

levelcrow
Posts: 47
Joined: Tue Aug 12, 2014 5:04 pm

Re: USB boot now working on Pi3

Fri Dec 16, 2016 10:19 pm

Hey Gordon,

Will this feature become included in the main RPi firmware once Linux is switched from 4.4 to 4.9?

Also, have the issues with unsupported USB protocols been fixed? Is that even a fixable issue? Or in other words, can USB booting be eventually possible for all USB drives, or will it only be for a subset of USB drives?

User avatar
DougieLawson
Posts: 39161
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: USB boot now working on Pi3

Fri Dec 16, 2016 11:16 pm

levelcrow wrote:
Will this feature become included in the main RPi firmware once Linux is switched from 4.4 to 4.9?
At the moment to get 4.8.13 (highest available) you need to run sudo BRANCH=next rpi-update, the USB/PXE boot is still beta code and only available with BRANCH=next. I suspect when 4.9.xx goes generally available (with apt-get to install it) then the USB/PXE boot stuff will be included.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

User avatar
NickT
Posts: 276
Joined: Mon May 21, 2012 10:43 am
Location: UK

Re: USB boot now working on Pi3

Thu Dec 29, 2016 11:32 am

Once USB booting has been enabled by a change to config.txt and One Time Programmable ROM, does that mean that boot from USB is the permanent method for booting, without giving the user the option to boot from SD card? The 'one time' description implies that it is.

User avatar
DougieLawson
Posts: 39161
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: USB boot now working on Pi3

Thu Dec 29, 2016 11:34 am

It checks all three options SDCard, USB & PXE. There is a config.txt parm to set which gets a preference.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

User avatar
g7ruh
Posts: 68
Joined: Mon Apr 23, 2012 9:49 am
Location: Blackfield UK

Re: USB boot now working on Pi3

Sat Dec 31, 2016 11:03 am

I have been testing USB and Network booting, the logical extension being to network boot off a USB booted SSD based server Pi.

It worked fine with the SD card as the server boot media. With USB booted SSD as the server boot media, it worked fine until power off. After this, the client Pi would not find the NFS. I had to restart NFS server manually

Code: Select all

service nfs-kernel-server restart
and the client boot would continue (if not timed out with kernel panic: no NFS) or would boot fine on restarting the client. Having figured out that the SD card server Pi worked fine and the SSD based server Pi did not until the NFS server was restarted, a potential timing issue???, google being helpful, I found this https://discourse.osmc.tv/t/nfs-kernel- ... -boot/5936 and acted on the code snippet to add a sleep before the export command as per this

Code: Select all

# See how we were called.
case "$1" in
  start)
        sleep 10
        export_files="/etc/exports"


Since I added the 'sleep', the NFS starts every time at server Pi power up and the client always finds the NFS server.

I don't know if the "incompatibilities" discussed in the above URL still apply, but the "sleep" fixed my problem.

Posted this just in case anyone else has experienced similar issues.

Roger

User avatar
g7ruh
Posts: 68
Joined: Mon Apr 23, 2012 9:49 am
Location: Blackfield UK

Re: USB boot now working on Pi3

Sat Dec 31, 2016 11:36 am

Client booted Pi is slow, much slower than I would expect:
e.g.

Code: Select all

#time sudo  apt-get update
takes 1 minute 50 (approx, average of several tests) when the same command run on the server Pi (USB SSD booted) takes 15 seconds (first run in each Pi ignored)

In addition, using the client GUI and browsing the web with Chromium, loading complex web pages is very slow.

In the network boot tutorial the NFS mount added to /etc/exports is as follows

Code: Select all

/nfs/client1 *(rw,sync,no_subtree_check,no_root_squash)

the 'sync' is to ensure safety and to ensure all disk commands are completed before returning control to the client Pi ***. This helps avoid issues with data loss should the server Pi be stopped. I agree with the use of this to ensure clean handling of the remote media for the client Pi. However it does slow down the client Pi somewhat. When 'async' is used, the 'apt-get' test takes approx 28 second and web page loading is much smoother.

I realise this is a risk / reward issue and each case is different, just posted here in case anyone wants to test performance in a different but more risky way.


*** MAN page reproduced here for sync / async

Code: Select all

async

This option allows the NFS server to violate the NFS protocol and reply to requests before any changes made by that request have been committed to stable storage (e.g. disc drive).
Using this option usually improves performance, but at the cost that an unclean server restart (i.e. a crash) can cause data to be lost or corrupted.
sync

Reply to requests only after the changes have been committed to stable storage (see async above). 

Roger

RustyKnight
Posts: 10
Joined: Sun Feb 14, 2016 11:02 am

Re: USB boot now working on Pi3

Sat Dec 31, 2016 12:24 pm

Hi All

Sorry to be a pain, can someone please explain in laymans terms for a relative beginner how I can get my Pi3 to boot from the USB flash drive after I've updated?

It was all working fine, then I made the "mistake" of doing sudo apt-get upgrade and now it won't boot from the USB drive.

I don't want to lose everything and start again.

Thanks in advance.
So much for the official forum being helpful - if you ask a question they send you threatening messages and warnings - I'm leaving

BlackKnight_UK
Posts: 94
Joined: Mon Jan 02, 2017 10:51 am

Re: USB boot now working on Pi3

Mon Jan 02, 2017 11:53 am

Take the USB flash drive and plug it into your PC. Copy all the files to a microSD card, check the cmdline.txt file has root=/dev/sda2

Plug the flash drive back into the Pi and insert the microSD card in the Pi and boot.

It worked for me.

User avatar
framp
Posts: 34
Joined: Sun Jan 27, 2013 7:03 pm
Location: Stuttgart, Germany
Contact: Website

Re: USB boot now working on Pi3

Mon Jan 02, 2017 7:36 pm

PeterO wrote:
ravustaja wrote:I have set PARTUUID in cmdline.txt and disk-by-uuid in fstab, so that shouldn't be the problem either. It seems like after connecting the hub, it isn't even trying to boot. Nothing just happens when I turn the power on. Everything works fine when I unplug the hub. Switching them around doesn't work either.
OK, but I think that's all to do with the booted kernel identifying which disk to use to mount the root filesystem. The firmware booting happens before cmdline.txt is read and passed to the freshly loaded kernel.
But if switching the cables over doesn't fix it then there is something else going wrong. You could file a bug on github for the firmware.
I experienced the same issue. Used PARTUUID in cmdline.txt - switched the cables - and still get the rainbow. Which github repo should I use to create a report?
"Really, I'm not out to destroy Microsoft. That will just be a completely unintentional side effect." Linus Torvalds, 28.9.2003

User avatar
DougieLawson
Posts: 39161
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: USB boot now working on Pi3

Mon Jan 02, 2017 7:43 pm

What happens if you use a UUID? Have you got rootdelay=nn to give things a chance to settle before you try to mount them?

Code: Select all

root=UUID=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx rootfstype=ext4 
[/s]

Edit: just tried this on my RPi3B and I can't get that one to boot.
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

levelcrow
Posts: 47
Joined: Tue Aug 12, 2014 5:04 pm

Re: USB boot now working on Pi3

Sat Jan 07, 2017 11:54 pm

Hey Gordon,

Is there any chance that the bootcode.bin method of enabling USB boot will be fixed for the Raspberry Pi 1B?

Is that even a possibility?

And also, what of previously unsupported USB drives due to the way their protocols work? Will those eventually be supported through the bootcode.bin file?

alkaidas12
Posts: 1
Joined: Mon Jan 09, 2017 5:48 am

Re: USB boot now working on Pi3

Mon Jan 09, 2017 5:53 am

so...
what are the benefits of a full USB boot?
I was thinking speed, but not looking that way

User avatar
RaTTuS
Posts: 10559
Joined: Tue Nov 29, 2011 11:12 am
Location: North West UK
Contact: Twitter YouTube

Re: USB boot now working on Pi3

Mon Jan 09, 2017 8:06 am

levelcrow wrote:Hey Gordon,

Is there any chance that the bootcode.bin method of enabling USB boot will be fixed for the Raspberry Pi 1B?

Is that even a possibility?

And also, what of previously unsupported USB drives due to the way their protocols work? Will those eventually be supported through the bootcode.bin file?
no - NAFAIK - it will need a new SOC to be produced
How To ask Questions :- http://www.catb.org/esr/faqs/smart-questions.html
WARNING - some parts of this post may be erroneous YMMV

1QC43qbL5FySu2Pi51vGqKqxy3UiJgukSX
Covfefe

exander
Posts: 13
Joined: Fri Feb 06, 2015 12:25 pm

Re: USB boot now working on Pi3

Mon Jan 09, 2017 2:38 pm

Not working for me.

Tcpdump:

Code: Select all

15:29:25.705381 IP 0.0.0.0.bootpc > 255.255.255.255.bootps: BOOTP/DHCP, Request from b8:27:eb:59:6f:88 (oui Unknown), length 320
15:29:25.705868 IP xxx.bootps > 255.255.255.255.bootpc: BOOTP/DHCP, Reply, length 314
Syslog:

Code: Select all

Jan  9 15:29:25 xxx dnsmasq-dhcp[26606]: 653460281 available DHCP subnet: 10.9.8.255/255.255.255.0
Jan  9 15:29:25 xxx dnsmasq-dhcp[26606]: 653460281 vendor class: PXEClient:Arch:00000:UNDI:002001
Jan  9 15:29:25 xxx dnsmasq-dhcp[26606]: 653460281 PXE(eth0) b8:27:eb:59:6f:88 proxy
Jan  9 15:29:25 xxx dnsmasq-dhcp[26606]: 653460281 tags: eth0
Jan  9 15:29:25 xxx dnsmasq-dhcp[26606]: 653460281 broadcast response
Jan  9 15:29:25 xxx dnsmasq-dhcp[26606]: 653460281 sent size:  1 option: 53 message-type  2
Jan  9 15:29:25 xxx dnsmasq-dhcp[26606]: 653460281 sent size:  4 option: 54 server-identifier  10.9.8.7
Jan  9 15:29:25 xxx dnsmasq-dhcp[26606]: 653460281 sent size:  9 option: 60 vendor-class  50:58:45:43:6c:69:65:6e:74
Jan  9 15:29:25 xxx dnsmasq-dhcp[26606]: 653460281 sent size: 17 option: 97 client-machine-id  00:44:44:44:44:44:44:44:44:44:44:44:44:44...
Jan  9 15:29:25 xxx dnsmasq-dhcp[26606]: 653460281 sent size: 32 option: 43 vendor-encap  06:01:03:0a:04:00:50:58:45:09:14:00:00:11...
Jan  9 15:29:28 xxx dnsmasq-tftp[26606]: file /srv/tftpboot/bootsig.bin not found
Jan  9 15:29:28 xxx dnsmasq-tftp[26606]: sent /srv/tftpboot/bootcode.bin to 10.9.8.112
And then nothing. Raspi does not boot, no other files are requested on TFTP.

pws
Posts: 92
Joined: Mon Apr 11, 2016 4:16 pm

Re: USB boot now working on Pi3

Wed Jan 11, 2017 1:35 am

I just updated the SSD on mine today and it won't boot either. Too bad - it has been running for weeks and is kept up to date. This is he first time I have had any issues at all with the USB/Boot setup.
DougieLawson wrote:
Edit: just tried this on my RPi3B and I can't get that one to boot.

aupi
Posts: 14
Joined: Wed Jan 11, 2017 9:07 am

Re: USB boot now working on Pi3

Wed Jan 11, 2017 9:25 am

Has anybody tested booting off USB with a Lexar S45, specifically the 128GB version? Keen to hear if you have, as I'm looking at buying some for this purpose.

asavah
Posts: 373
Joined: Thu Aug 14, 2014 12:49 am

Re: USB boot now working on Pi3

Wed Jan 11, 2017 8:16 pm

It seems that it's currently broken.

https://github.com/raspberrypi/firmware ... f57ddbe727
Does not work, neither usb or pxe.
USB:
Reads the USB drive (seen by activity led on the pendrive) and then rainbow screen forever.
PXE:

Code: Select all

Jan 11 22:01:16 nas2 in.tftpd[9652]: RRQ from 192.168.36.178 filename bootcode.bin
Jan 11 22:01:16 nas2 in.tftpd[9656]: RRQ from 192.168.36.178 filename config.txt
Jan 11 22:01:16 nas2 in.tftpd[9658]: RRQ from 192.168.36.178 filename start.elf
Jan 11 22:01:17 nas2 in.tftpd[9659]: RRQ from 192.168.36.178 filename fixup.dat
Network link on pi goes down and rainbow screen.
It doesn't seem to request cmdline and kernel7.img at least no such requests can be seen in tftpd-hpa log or in tcpdump.

https://github.com/raspberrypi/firmware ... 74e978bb0f
Both USB and PXE work flawlessly for me.

Code: Select all

Jan 11 22:02:53 nas2 in.tftpd[10295]: RRQ from 192.168.36.178 filename bootcode.bin
Jan 11 22:02:53 nas2 in.tftpd[10301]: RRQ from 192.168.36.178 filename start.elf
Jan 11 22:02:55 nas2 in.tftpd[10303]: RRQ from 192.168.36.178 filename fixup.dat
Jan 11 22:02:55 nas2 in.tftpd[10305]: RRQ from 192.168.36.178 filename config.txt
Jan 11 22:02:55 nas2 in.tftpd[10308]: RRQ from 192.168.36.178 filename config.txt
Jan 11 22:02:55 nas2 in.tftpd[10310]: RRQ from 192.168.36.178 filename cmdline.txt
Jan 11 22:02:55 nas2 in.tftpd[10317]: RRQ from 192.168.36.178 filename kernel7.img
Jan 11 22:02:55 nas2 in.tftpd[10322]: RRQ from 192.168.36.178 filename kernel7.img
Jan 11 22:02:58 nas2 in.tftpd[10323]: RRQ from 192.168.36.178 filename bcm2710-rpi-3-b.dtb
Jan 11 22:02:58 nas2 in.tftpd[10324]: RRQ from 192.168.36.178 filename config.txt

User avatar
DougieLawson
Posts: 39161
Joined: Sun Jun 16, 2013 11:19 pm
Location: A small cave in deepest darkest Basingstoke, UK
Contact: Website Twitter

Re: USB boot now working on Pi3

Thu Jan 12, 2017 12:06 pm

pws wrote:I just updated the SSD on mine today and it won't boot either. Too bad - it has been running for weeks and is kept up to date. This is he first time I have had any issues at all with the USB/Boot setup.
DougieLawson wrote:
Edit: just tried this on my RPi3B and I can't get that one to boot.
https://github.com/Hexxeh/rpi-firmware/issues/134
Note: Any requirement to use a crystal ball or mind reading will result in me ignoring your question.

Criticising any questions is banned on this forum.

Any DMs sent on Twitter will be answered next month.
All non-medical doctors are on my foes list.

Return to “General discussion”