USB Boot Mode Question

I am reading this _HOW TO BOOT FROM A USB MASS STORAGE DEVICE ON A RASPBERRY PI 3_ guide from

It mentioned "Once this bit (OTP memory in the RPi SoC) has been set, the SD card is no longer required. Note that any change you make to the OTP is permanent and cannot be undone."

My question is, once this OTP bit is set to enable the USB Mass Storage Device boot, will this RPi lose the capacity to boot from SD card?

Thanks.

Reply to
abc
Loading thread data ...

Since OTP is 'one time programmable', that appears so.

Theo

Reply to
Theo

No, it can boot also from SD-Card. But first boot device is the USB Mass Storage Device, if it isn't bootable, RasPi looks for the next, this is the SD-Card.

HTH

Reply to
Uwe K.

Theo,

You can't make that conclusion just from the OTP-nes of that bit.

The question is rather valid :

Setting that bit :

1) changes the booting sequence to USB only (disabeling the booting from SD)

-OR-

2) inserts an attempt to boot from USB before the default booting from SD (creating a fall-back sequence) ?

Either of those has its use.

Regards, Rudy Wieser

Reply to
R.Wieser

I'm sure you already know, but you don't have to do this to boot from a USB device. You just need an SD card big enough to hold the DOS partition containing the kernel, and the rest of the filing system is on the USB drive.

---druck

Reply to
druck

Actually, I am not very versed in Linux, I need to learn how to do this on the DOS partition. I suppose I need to modify the DOS partition so that the root partition will be mounted from the USB mass storage device?

Thanks.

Reply to
abc

I think its more a case that the damned thing will BOOT from the USB mass storage

but I may well be wrong

--
Of what good are dead warriors? ? Warriors are those who desire battle  
more than peace. Those who seek battle despite peace. Those who thump  
 Click to see the full signature
Reply to
The Natural Philosopher

Yes, that is done in file /boot/cmdline.txt in the root= parameter.

Example:

dwc_otg.lpm_enable=0 console=serial0,115200 console=tty1 root=PARTUUID=4d7e5657-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait (all on one line)

In this case the USB drive has 3 partitions :

pi@rp3:~ $ lsblk -o name,size,type,fstype,partuuid,mountpoint NAME SIZE TYPE FSTYPE PARTUUID MOUNTPOINT sda 931.5G disk

+-sda1 41.8M part vfat 4d7e5657-01 +-sda2 16G part ext4 4d7e5657-02 / +-sda3 915.5G part ext4 4d7e5657-03 /extra mmcblk0 7.4G disk +-mmcblk0p1 41.8M part vfat caba7423-01 /boot +-mmcblk0p2 7.4G part ext4 caba7423-02

sda1 is a copy of mmcblk0p1, for easy recovery if the SD card dies. sda2 contains the os and /home/pi sda3 contains homedirs for all other users mmcblk0p2 is not used.

pi@rp3:~ $ cat /etc/fstab # device mountpoint fstype options dump fschk proc /proc proc defaults 0 0 # USBdisk PARTUUID=4d7e5657-01 /mnt/usbdsk/boot vfat defaults,noatime,noauto 0 0 PARTUUID=4d7e5657-02 / ext4 defaults,noatime 0 1 PARTUUID=4d7e5657-03 /extra ext4 defaults,noatime 0 2 # SDcard PARTUUID=caba7423-01 /boot vfat defaults,noatime 0 2 PARTUUID=caba7423-02 /mnt/sdcard/root ext4 defaults,noatime,noauto 0 2 # a swapfile is not a swap partition, no line here # use dphys-swapfile swap[on|off] for that

pi@rp3:~ uname -a Linux rp3 4.14.34-v7+ #1110 SMP Mon Apr 16 15:18:51 BST 2018 armv7l GNU/Linux

Note: The initial cmdline.txt on a fresh raspbian image contains a parameter that causes the root partition to be expanded: init=/usr/lib/raspi-config/init_resize.sh That is not always what you want.

HTH

--
Regards, 
Kees Nuyt
Reply to
Kees Nuyt

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.