• "Special" bootcode.bin usb boot mode

    From bob prohaska@3:770/3 to All on Wed Jul 27 01:38:44 2022
    Is anybody using the "special" bootcode.bin for booting from
    a usb mass storage device? It's described at https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#special-bootcode-bin-only-boot-mod


    I've used it on a Pi2, where it works perfectly. On a Pi3, with
    the usb boot OTP set, its behavior is more complicated and I'm
    looking for any advice available.

    This particular Pi3/disk combo didn't seem to detect
    the USB hard drive reliably, so I tried merely changing the
    version of bootcode.bin on the (bootable) microSD, saving the
    original bootcode.bin to bootcode.bin.microsd to keep it handy
    in case I needed to boot the microSD as a recovery device.

    That didn't work, so I moved all the msdos files into a subdirectory
    named "unused", leaving only the "special" bootcode.bin and timeout
    files visible. That didn't work either, so I pulled out the microSD
    and cycled power. Boot was successful, this time. I'd like it to
    work reliably 8-) The usual failure mode was an immediate attempt
    to netboot.

    If anybody's got tips on how to detect and boot a USB hard
    drive on a Pi 2 or 3 please post! I'm aware the instructions
    say to have only the special bootcode.bin and a timeout file
    on the microSD, but I hoped hiding the un-needed files would
    be sufficient.

    As it happens I'm booting FreeBSD, but I think the present magic
    is entirely within the realm of the RasPiOS gods.

    Thanks for reading,

    bob prohaska

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Andrew Rolfe@3:770/3 to bob prohaska on Wed Jul 27 10:55:02 2022
    On Wednesday, 27 July 2022 at 02:38:45 UTC+1, bob prohaska wrote:
    Is anybody using the "special" bootcode.bin for booting from
    a usb mass storage device? It's described at https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#special-bootcode-bin-only-boot-mod


    I've used it on a Pi2, where it works perfectly. On a Pi3, with
    the usb boot OTP set, its behavior is more complicated and I'm
    looking for any advice available.

    This particular Pi3/disk combo didn't seem to detect
    the USB hard drive reliably, so I tried merely changing the
    version of bootcode.bin on the (bootable) microSD, saving the
    original bootcode.bin to bootcode.bin.microsd to keep it handy
    in case I needed to boot the microSD as a recovery device.

    That didn't work, so I moved all the msdos files into a subdirectory
    named "unused", leaving only the "special" bootcode.bin and timeout
    files visible. That didn't work either, so I pulled out the microSD
    and cycled power. Boot was successful, this time. I'd like it to
    work reliably 8-) The usual failure mode was an immediate attempt
    to netboot.

    If anybody's got tips on how to detect and boot a USB hard
    drive on a Pi 2 or 3 please post! I'm aware the instructions
    say to have only the special bootcode.bin and a timeout file
    on the microSD, but I hoped hiding the un-needed files would
    be sufficient.

    As it happens I'm booting FreeBSD, but I think the present magic
    is entirely within the realm of the RasPiOS gods.

    Thanks for reading,

    bob prohaska

    Hi Bob,

    I had this issue on a Pi3 with a cheap USB/SATA M.2 USB adaptor. Nothing worked, not even the "special" bootcode.bin.

    So I tinkered and the only thing that worked for me was to boot normally from the SDCard and switch the root to the USB drive.

    Format the SDCard as MS-DOS, copy the whole of /boot from USB drive to the SDCard under /boot.

    On the SDCard edit cmdline.txt so that "root=PARTUUID=<uuid of USB drive>".

    For the PARTUUID use lsblk. For me:

    lsblk -o +PARTUUID
    NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS PARTUUID
    sda 8:0 0 223.6G 0 disk
    ├─sda1 8:1 0 43.9M 0 part 7ee80803-01
    └─sda2 8:2 0 223.5G 0 part / 7ee80803-02
    mmcblk0 179:0 0 14.8G 0 disk
    ├─mmcblk0p1 179:1 0 41.5M 0 part /boot 665a62ed-01 └─mmcblk0p2 179:2 0 14.8G 0 part 665a62ed-02

    My cmdline.txt:

    dwc_otg.lpm_enable=0 dwc_otg.fiq_fix_enable=1 console=serial0,115200 console=tty1 root=PARTUUID=7ee80803-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait

    Hope this helps, it's worked reliably for me for years now ;)

    Regards,
    Andrew

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Chris Elvidge@3:770/3 to Andrew Rolfe on Wed Jul 27 21:46:44 2022
    On 27/07/2022 18:55, Andrew Rolfe wrote:
    On Wednesday, 27 July 2022 at 02:38:45 UTC+1, bob prohaska wrote:
    Is anybody using the "special" bootcode.bin for booting from
    a usb mass storage device? It's described at
    https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#special-bootcode-bin-only-boot-mod


    I've used it on a Pi2, where it works perfectly. On a Pi3, with
    the usb boot OTP set, its behavior is more complicated and I'm
    looking for any advice available.

    This particular Pi3/disk combo didn't seem to detect
    the USB hard drive reliably, so I tried merely changing the
    version of bootcode.bin on the (bootable) microSD, saving the
    original bootcode.bin to bootcode.bin.microsd to keep it handy
    in case I needed to boot the microSD as a recovery device.

    That didn't work, so I moved all the msdos files into a subdirectory
    named "unused", leaving only the "special" bootcode.bin and timeout
    files visible. That didn't work either, so I pulled out the microSD
    and cycled power. Boot was successful, this time. I'd like it to
    work reliably 8-) The usual failure mode was an immediate attempt
    to netboot.

    If anybody's got tips on how to detect and boot a USB hard
    drive on a Pi 2 or 3 please post! I'm aware the instructions
    say to have only the special bootcode.bin and a timeout file
    on the microSD, but I hoped hiding the un-needed files would
    be sufficient.

    As it happens I'm booting FreeBSD, but I think the present magic
    is entirely within the realm of the RasPiOS gods.

    Thanks for reading,

    bob prohaska

    Hi Bob,

    I had this issue on a Pi3 with a cheap USB/SATA M.2 USB adaptor. Nothing worked, not even the "special" bootcode.bin.

    So I tinkered and the only thing that worked for me was to boot normally from the SDCard and switch the root to the USB drive.

    Format the SDCard as MS-DOS, copy the whole of /boot from USB drive to the SDCard under /boot.

    On the SDCard edit cmdline.txt so that "root=PARTUUID=<uuid of USB drive>".

    For the PARTUUID use lsblk. For me:

    lsblk -o +PARTUUID
    NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS PARTUUID
    sda 8:0 0 223.6G 0 disk
    ├─sda1 8:1 0 43.9M 0 part 7ee80803-01
    └─sda2 8:2 0 223.5G 0 part / 7ee80803-02
    mmcblk0 179:0 0 14.8G 0 disk
    ├─mmcblk0p1 179:1 0 41.5M 0 part /boot 665a62ed-01 └─mmcblk0p2 179:2 0 14.8G 0 part 665a62ed-02

    My cmdline.txt:

    dwc_otg.lpm_enable=0 dwc_otg.fiq_fix_enable=1 console=serial0,115200 console=tty1 root=PARTUUID=7ee80803-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait

    Hope this helps, it's worked reliably for me for years now ;)

    Regards,
    Andrew


    I've done it a similar way but with a 256MB SD card:

    # lsblk
    NAME FSTYPE LABEL PARTLABEL PARTUUID
    FSSIZE FSUSED MOUNTPOINT
    sda
    ├─sda1 swap swap b32bbadb-3f7d-5146-baee-295fcb1939ca
    [SWAP]
    ├─sda2 ext4 rootfs 72020302-c396-2148-9d13-caf4f68cd18c
    56.4G 6.9G /
    ├─sda3 ext4 root root 7308d719-4f3e-4beb-91af-51e986fc889f
    28.2G 9.2G /mnt/root
    └─sda4 ext4 ebor backup 35171e6a-5845-4ddb-aafe-d2b0a0ff542a
    28.2G 7.1G /mnt/ebor
    mmcblk0
    └─mmcblk0p1 vfat
    241.2M 53M /boot

    # cat /boot/cmdline.txt
    console=tty1 root=PARTUUID=72020302-c396-2148-9d13-caf4f68cd18c
    rootfstype=ext4 fsck.repair=yes rootwait quiet splash plymouth.ignore-serial-consoles net.ifnames=0 biosdevname=0
    usbhid.mousepoll=0 dwc_otg.lpm_enable=0


    --
    Chris Elvidge
    England

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From bob prohaska@3:770/3 to Andrew Rolfe on Wed Jul 27 21:48:57 2022
    Andrew Rolfe <wolfmud@gmail.com> wrote:
    On Wednesday, 27 July 2022 at 02:38:45 UTC+1, bob prohaska wrote:
    Is anybody using the "special" bootcode.bin for booting from
    a usb mass storage device? It's described at
    https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#special-bootcode-bin-only-boot-mod


    I've used it on a Pi2, where it works perfectly. On a Pi3, with
    the usb boot OTP set, its behavior is more complicated and I'm
    looking for any advice available.

    This particular Pi3/disk combo didn't seem to detect
    the USB hard drive reliably, so I tried merely changing the
    version of bootcode.bin on the (bootable) microSD, saving the
    original bootcode.bin to bootcode.bin.microsd to keep it handy
    in case I needed to boot the microSD as a recovery device.

    That didn't work, so I moved all the msdos files into a subdirectory
    named "unused", leaving only the "special" bootcode.bin and timeout
    files visible. That didn't work either, so I pulled out the microSD
    and cycled power. Boot was successful, this time. I'd like it to
    work reliably 8-) The usual failure mode was an immediate attempt
    to netboot.

    If anybody's got tips on how to detect and boot a USB hard
    drive on a Pi 2 or 3 please post! I'm aware the instructions
    say to have only the special bootcode.bin and a timeout file
    on the microSD, but I hoped hiding the un-needed files would
    be sufficient.

    As it happens I'm booting FreeBSD, but I think the present magic
    is entirely within the realm of the RasPiOS gods.

    Thanks for reading,

    bob prohaska

    Hi Bob,

    I had this issue on a Pi3 with a cheap USB/SATA M.2 USB adaptor. Nothing worked, not even the "special" bootcode.bin.


    Did it _never_ work, or did it work intermittently? One of my puzzles
    has been that the disk always shows up within a dozen tries. Sometimes
    the first, usually by the fifth. Power-cycling the disk between attempts
    seems to help, but not in a deterministic way.

    So I tinkered and the only thing that worked for me was to boot normally from the SDCard and switch the root to the USB drive.

    Format the SDCard as MS-DOS, copy the whole of /boot from USB drive to the SDCard under /boot.

    On the SDCard edit cmdline.txt so that "root=PARTUUID=<uuid of USB drive>".

    For the PARTUUID use lsblk. For me:

    lsblk -o +PARTUUID
    NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS PARTUUID
    sda 8:0 0 223.6G 0 disk
    ??sda1 8:1 0 43.9M 0 part 7ee80803-01
    ??sda2 8:2 0 223.5G 0 part / 7ee80803-02
    mmcblk0 179:0 0 14.8G 0 disk
    ??mmcblk0p1 179:1 0 41.5M 0 part /boot 665a62ed-01
    ??mmcblk0p2 179:2 0 14.8G 0 part 665a62ed-02

    My cmdline.txt:

    dwc_otg.lpm_enable=0 dwc_otg.fiq_fix_enable=1 console=serial0,115200 console=tty1 root=PARTUUID=7ee80803-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait

    I believe that's a Linux-specific technique. AIUI, the kernel is loaded from the microSD and then cmdline.txt tells the kernel where to find the root filesystem. Something similar is possible with FreeBSD, but it's cumbersome
    to keep the kernel on microSD in sync with world on USB.

    Another technique is to let the Pi boot from microSD and then mount
    /usr and enable swap from USB. That's actually pretty easy and worked
    well. Root is a read-mostly filesystem. If the "scribble" directories
    are on /usr flash wear and random write speed isn't a huge issue.
    You've given me some food for thought....

    Thanks for writing!

    bob prohaska

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Andrew Rolfe@3:770/3 to bob prohaska on Thu Jul 28 03:11:09 2022
    On Wednesday, 27 July 2022 at 22:48:59 UTC+1, bob prohaska wrote:
    Andrew Rolfe <wol...@gmail.com> wrote:
    On Wednesday, 27 July 2022 at 02:38:45 UTC+1, bob prohaska wrote:
    Is anybody using the "special" bootcode.bin for booting from
    a usb mass storage device? It's described at
    https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#special-bootcode-bin-only-boot-mod


    I've used it on a Pi2, where it works perfectly. On a Pi3, with
    the usb boot OTP set, its behavior is more complicated and I'm
    looking for any advice available.

    This particular Pi3/disk combo didn't seem to detect
    the USB hard drive reliably, so I tried merely changing the
    version of bootcode.bin on the (bootable) microSD, saving the
    original bootcode.bin to bootcode.bin.microsd to keep it handy
    in case I needed to boot the microSD as a recovery device.

    That didn't work, so I moved all the msdos files into a subdirectory
    named "unused", leaving only the "special" bootcode.bin and timeout
    files visible. That didn't work either, so I pulled out the microSD
    and cycled power. Boot was successful, this time. I'd like it to
    work reliably 8-) The usual failure mode was an immediate attempt
    to netboot.

    If anybody's got tips on how to detect and boot a USB hard
    drive on a Pi 2 or 3 please post! I'm aware the instructions
    say to have only the special bootcode.bin and a timeout file
    on the microSD, but I hoped hiding the un-needed files would
    be sufficient.

    As it happens I'm booting FreeBSD, but I think the present magic
    is entirely within the realm of the RasPiOS gods.

    Thanks for reading,

    bob prohaska

    Hi Bob,

    I had this issue on a Pi3 with a cheap USB/SATA M.2 USB adaptor. Nothing worked, not even the "special" bootcode.bin.

    Did it _never_ work, or did it work intermittently? One of my puzzles
    has been that the disk always shows up within a dozen tries. Sometimes
    the first, usually by the fifth. Power-cycling the disk between attempts seems to help, but not in a deterministic way.
    So I tinkered and the only thing that worked for me was to boot normally from the SDCard and switch the root to the USB drive.

    Format the SDCard as MS-DOS, copy the whole of /boot from USB drive to the SDCard under /boot.

    On the SDCard edit cmdline.txt so that "root=PARTUUID=<uuid of USB drive>".

    For the PARTUUID use lsblk. For me:

    lsblk -o +PARTUUID
    NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS PARTUUID
    sda 8:0 0 223.6G 0 disk
    ??sda1 8:1 0 43.9M 0 part 7ee80803-01
    ??sda2 8:2 0 223.5G 0 part / 7ee80803-02
    mmcblk0 179:0 0 14.8G 0 disk
    ??mmcblk0p1 179:1 0 41.5M 0 part /boot 665a62ed-01
    ??mmcblk0p2 179:2 0 14.8G 0 part 665a62ed-02

    My cmdline.txt:

    dwc_otg.lpm_enable=0 dwc_otg.fiq_fix_enable=1 console=serial0,115200 console=tty1 root=PARTUUID=7ee80803-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
    I believe that's a Linux-specific technique. AIUI, the kernel is loaded from the microSD and then cmdline.txt tells the kernel where to find the root filesystem. Something similar is possible with FreeBSD, but it's cumbersome to keep the kernel on microSD in sync with world on USB.

    Another technique is to let the Pi boot from microSD and then mount
    /usr and enable swap from USB. That's actually pretty easy and worked
    well. Root is a read-mostly filesystem. If the "scribble" directories
    are on /usr flash wear and random write speed isn't a huge issue.
    You've given me some food for thought....

    Thanks for writing!

    bob prohaska

    Hi Bob,

    For me, booting never work directly on that one device. However, the Pi3 could boot directly from other devices.

    The none working device used a "Transcend StoreJet 25H3", idVendor=8564, idProduct=7000. Lots of problems reported for that device :(

    The only time I've had intermittent issues booting was when using a low spec, 3rd party power supply. Swapping the power supply immediately solved the booting issues.

    Regards,
    Andrew

    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)
  • From Jim Jackson@3:770/3 to bob prohaska on Thu Jul 28 19:26:41 2022
    On 2022-07-27, bob prohaska <bp@www.zefox.net> wrote:
    Andrew Rolfe <wolfmud@gmail.com> wrote:
    On Wednesday, 27 July 2022 at 02:38:45 UTC+1, bob prohaska wrote:
    Is anybody using the "special" bootcode.bin for booting from
    a usb mass storage device? It's described at
    https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#special-bootcode-bin-only-boot-mod


    I've used it on a Pi2, where it works perfectly. On a Pi3, with
    the usb boot OTP set, its behavior is more complicated and I'm
    looking for any advice available.

    Like a previous respondant, I always boot from an SD card with the PiOS firmware on it, but edit the cmdline.txt file to specify a partition on
    a USB attached hard drive as the root.

    I have 2 Pi3s, a Pi3B and a Pi3B+, one with a WD USB external 2.5inch
    hardrive and one with a WD 3.5inch SATA drive with a StarTec USB3.1
    adapter. They both boot flawlessly. I also mount the SD /boot partition ReadOnly to minimise any SD problems.

    I have a wrapper script for updates whcih remounts the sdcard RW and
    afterwards reverts it to RO

    My approach is make the least changes to the default procedure - then
    there's less to debug when stuff goes wrong.


    This particular Pi3/disk combo didn't seem to detect
    the USB hard drive reliably, so I tried merely changing the
    version of bootcode.bin on the (bootable) microSD, saving the
    original bootcode.bin to bootcode.bin.microsd to keep it handy
    in case I needed to boot the microSD as a recovery device.

    That didn't work, so I moved all the msdos files into a subdirectory
    named "unused", leaving only the "special" bootcode.bin and timeout
    files visible. That didn't work either, so I pulled out the microSD
    and cycled power. Boot was successful, this time. I'd like it to
    work reliably 8-) The usual failure mode was an immediate attempt
    to netboot.

    If anybody's got tips on how to detect and boot a USB hard
    drive on a Pi 2 or 3 please post! I'm aware the instructions
    say to have only the special bootcode.bin and a timeout file
    on the microSD, but I hoped hiding the un-needed files would
    be sufficient.

    As it happens I'm booting FreeBSD, but I think the present magic
    is entirely within the realm of the RasPiOS gods.

    Thanks for reading,

    bob prohaska

    Hi Bob,

    I had this issue on a Pi3 with a cheap USB/SATA M.2 USB adaptor. Nothing worked, not even the "special" bootcode.bin.


    Did it _never_ work, or did it work intermittently? One of my puzzles
    has been that the disk always shows up within a dozen tries. Sometimes
    the first, usually by the fifth. Power-cycling the disk between attempts seems to help, but not in a deterministic way.

    So I tinkered and the only thing that worked for me was to boot normally from the SDCard and switch the root to the USB drive.

    Format the SDCard as MS-DOS, copy the whole of /boot from USB drive to the SDCard under /boot.

    On the SDCard edit cmdline.txt so that "root=PARTUUID=<uuid of USB drive>". >>
    For the PARTUUID use lsblk. For me:

    lsblk -o +PARTUUID
    NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS PARTUUID
    sda 8:0 0 223.6G 0 disk
    ??sda1 8:1 0 43.9M 0 part 7ee80803-01
    ??sda2 8:2 0 223.5G 0 part / 7ee80803-02
    mmcblk0 179:0 0 14.8G 0 disk
    ??mmcblk0p1 179:1 0 41.5M 0 part /boot 665a62ed-01
    ??mmcblk0p2 179:2 0 14.8G 0 part 665a62ed-02

    My cmdline.txt:

    dwc_otg.lpm_enable=0 dwc_otg.fiq_fix_enable=1 console=serial0,115200 console=tty1 root=PARTUUID=7ee80803-02 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait

    I believe that's a Linux-specific technique. AIUI, the kernel is loaded from the microSD and then cmdline.txt tells the kernel where to find the root filesystem. Something similar is possible with FreeBSD, but it's cumbersome to keep the kernel on microSD in sync with world on USB.

    Another technique is to let the Pi boot from microSD and then mount
    /usr and enable swap from USB. That's actually pretty easy and worked
    well. Root is a read-mostly filesystem. If the "scribble" directories
    are on /usr flash wear and random write speed isn't a huge issue.
    You've given me some food for thought....

    Thanks for writing!

    bob prohaska


    --- SoupGate-Win32 v1.05
    * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3)