Dietpi: RPi | Support for USB write > boot

Created on 21 May 2017  Β·  14Comments  Β·  Source: MichaIng/DietPi

Debian Jessie Enhancement

Most helpful comment

@k-plan

Would be nice to but this into dietpi-config for the users.
You can read out vcgencmd otp_dump | grep 17: and if it is not set (disabled), user can easy change it to enable , so it will put in /DietPi/config.txt once and force a reboot like you do, when changing the hostname.
This would be nice for users!
Do you want a new issue for this

Yep, sounds good, create the ticket πŸ‘

All 14 comments

PARTUUID's required:

  • /boot/cmdline.txt root=PARTUUID=84fa8189-02
  • /etc/fstab
PARTUUID=84fa8189-01  /boot           vfat    defaults          0       2
PARTUUID=84fa8189-02  /               ext4    defaults,noatime  0       1

Changes required to support PARTUUID entries in dietpi-drive_manager and a few in finalize


https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/msd.md

program_usb_boot_mode=1 required in /boot/config.txt.

  • RPi 3 only? Compatible with other devices?
  • Renders SD card boot unavailable?
  • Requires a reboot with program_usb_boot_mode=1, before USB storage can be used? vcgencmd otp_dump | grep 17:

Will boot off USB be also supported on other platforms e.g. Pi Zero?

@Invictaz

Will boot off USB be also supported on other platforms e.g. Pi Zero?

Should be fine. AFAIK this is a RPi feature only, built into kernel/uboot.

@Fourdee Great. Looking forward to it.

@Fourdee

Normally this goes through Uboot?

It's partly possible already. Some code is loaded off SD and some of USB

https://www.raspberrypi.org/forums/viewtopic.php?t=12015&f=66

https://raspberrypi.stackexchange.com/questions/62965/boot-zero-w-from-usb-device

Seems to involve a bootcode.bin

It's not native boot from USB but atleast something.

Starting with the 2017-04-10 release of Raspbian you can install a working Rasbian system to a USB mass storage device by copying the operating system image directly onto your USB device, in the same way that you would for an SD card.

Hmm, I cant get any of my USB mass storage devices to boot with latest Raspbian:
Raspbian Lite 2017-04-10:

  • 🈴 No boot with SanDisk SDCZ43-032G-G46 Ultra Fit USB Flash Drive USB
  • 🈴 No boot with Lexar JumpDrive S45 16 GB

  • 🈯️ Ok, so prior to using USB boot, you must boot the device once with program_usb_boot_mode=1 added to /boot/config.txt (/DietPi/config.txt if powered on). This enables the USB boot loader bit. Afterwards, boot from USB is functional.

New RPi image live with USB boot support (still requires bit set prior https://github.com/Fourdee/DietPi/issues/970#issuecomment-304264851):
http://dietpi.com/downloads/images/DietPi_RPi-armv6-(Jessie).7z

@Fourdee

have you missed this?

  • Yes, USB boot without a SD Card only for RPi3.

  • Yes, you have first to change OTP value to 17:3020000a by adding program_usb_boot_mode=1 to config.txt and reboot.

  • And OTP changes can not undo !!
    _(BTW: -if something goes wrong by changing OTP value, you loosing RPi functionality e.g. onboard WiFi - sadly self tested!)_

  • not all flash drive will work

  • problems with USB-HDD (spinning disk) timeout

  • it will increase boot time about 5 -10 sec.

Yes, it's possible to speed it up by putting a empty FAT formatted SD card in the slot, but so I can as well stay on this, which will work on every RPi.

Yes, you can put only a bootcode.bin on Fat formated SD-Card and let it in your RPi3, so it will be able to boot from more usb devices without problems.

Yes, you can add program_usb_boot_timeout=1 into the config.txt. This improves to around 25% of successful start-ups, but no more than that. And it can speed-up the boot time a little bit.

You can test, if USB R/RW speed come up to a U3 sd card + overclocking the sd to 100 MHz

And you can now test this.

cu and good luck
k-plan

@k-plan

And OTP changes can not undo !!
(BTW: -if something goes wrong by changing OTP value, you loosing RPi functionality e.g. onboard WiFi - sadly self tested!)

Wasn't aware of that! Thanks for the heads up.

I personally wont be using USB boot/rootfs due to USB + Eth bandwidth shared. But, at the very least we need to offer and support this "functionality" to our users with the updated image/sourcecode (which is now completed).

You can test, if USB R/RW speed come up to a U3 sd card + overclocking the sd to 100 MHz

With my Sandisk ultra fit USB3.0, 40MB/s read, same as UHS3 and 100MHz overclock.

Completed.

@Fourdee

Experience and testing results:

───────────────────────────────────────
 DietPi     | 16:59 | Sat 27/05/17
 ───────────────────────────────────────
 V150       | RPi 3 Model B (armv7l)
 ───────────────────────────────────────

root@RPi-3:~# vcgencmd otp_dump | grep 17:
17:1020000a

170527-0001


root@RPi-3_USB:~# vcgencmd otp_dump | grep 17:
17:3020000a

170527-0006


  • with a little bit of RPi 3 over-clocking and sd-card tweaking:

170527-0003

170527-0002

170527-0007

If SD reader went through usb hub, dtoverlay=sdhost,overclock_50=100 will as well overclock usb host.

I don't think so, but you can test it.

Tested now, yes => _busted_ √ πŸ˜ƒ

With my Sandisk ultra fit USB3.0, 40MB/s read, same as UHS3 and 100MHz overclock.

Sorry, not for me.


As well trying to get RPi-3 Boot from Mass Storage Device (MSD) with two different SSD and USB 3.0 to SSD adapter

No luck to get it on work ....

... not with program_usb_boot_timeout=1
... not with a FAT formated sd-card with bootcode.bin πŸ‘Ž


And yes,

Be warned that this feature is experimental and does not work with all USB mass storage devices.
Since 2017-04-10 release ..

I personally wont be using USB boot/rootfs due to USB + Eth bandwidth shared.

Yes! Same here. SD-card with tweaking rocks! πŸ˜„ πŸ‘

But, at the very least we need to offer and support this "functionality" to our users with the updated image/sourcecode.

Anyway πŸ˜‰ .

Would be nice to but this into dietpi-config for the users.

You can read out vcgencmd otp_dump | grep 17: and if it is not set (_disabled_), user can easy change it to _enable_ , so it will put in /DietPi/config.txt once and force a reboot like you do, when changing the hostname.
This would be nice for users!

Do you want a new issue for this❓

_BTW: program_usb_boot_mode=1 will change same more values in otp:_

17:1020000a  =>  3020000a
18:1020000a  =>  3020000a
66:00000000  =>  00009daa

@k-plan

Would be nice to but this into dietpi-config for the users.
You can read out vcgencmd otp_dump | grep 17: and if it is not set (disabled), user can easy change it to enable , so it will put in /DietPi/config.txt once and force a reboot like you do, when changing the hostname.
This would be nice for users!
Do you want a new issue for this

Yep, sounds good, create the ticket πŸ‘

@Fourdee

Yep, sounds good, create the ticket πŸ‘

Done, see: https://github.com/Fourdee/DietPi/issues/983

Was this page helpful?
0 / 5 - 0 ratings

Related issues

MichaIng picture MichaIng  Β·  64Comments

tenrek picture tenrek  Β·  176Comments

Fourdee picture Fourdee  Β·  86Comments

Fourdee picture Fourdee  Β·  57Comments

Fourdee picture Fourdee  Β·  113Comments