SG-1100 'run usbrecovery' gives 'efi_load_pe: Invalid DOS Signature'



  • I'm trying to install pfsense fresh on a SG-1100. I got to the Marvell>> prompt and entered 'run usbrecovery', the result was:

    Marvell>> run usbrecovery
    ** First descriptor is NOT a primary desc on 1:1 **
    switch to partitions #0, OK
    mmc1(part 0) is current device
    
    MMC erase: dev # 1, block # 0, count 4194304 ... 4194304 blocks erased: OK
    ** Bad device usb 0 **
    ** Bad device usb 0 **
    ## Starting EFI application at 05000000 ...
    efi_load_pe: Invalid DOS Signature
    ## Application terminated, r = -2
    Marvell>> 
      base bdinfo blkcache boot bootd bootefi bootelf booti bootm bootp bootvx
      bubt cmp coninfo cp crc32 dcache dhcp ...
    

    Now the device doesn't boot. Any idea what went wrong and how to fix? Thanks.


  • Rebel Alliance Developer Netgate

    What image are you attempting to boot? Are you certain it was written to the USB drive properly?



  • @jimp said in SG-1100 'run usbrecovery' gives 'efi_load_pe: Invalid DOS Signature':

    What image are you attempting to boot?

    pfSense-netgate-SG-1100-recovery-2.4.4-RELEASE-p3-aarch64.img.bz2

    Uncompressed, the sha256 of the .img file is 187778ceda966df280eb3a2319d1b538a5e49890ec5bdd74d337aba7d8f141cf

    Are you certain it was written to the USB drive properly?

    Certain-ish. :)

    I used dd on macOS per instructions here:

    https://docs.netgate.com/reference/create-flash-media.html

    on macOS, diskutil list shows the resulting disk:

    /dev/disk5 (external, physical):
       #:                       TYPE NAME                    SIZE       IDENTIFIER
       0:     FDisk_partition_scheme                        *8.0 GB     disk5
       1:                       0xEF                         819.2 KB   disk5s1
       2:                 DOS_FAT_32 DTBFAT0                 35.8 MB    disk5s2
       3:                    FreeBSD                         1.5 GB     disk5s3
    

    Which looks reasonable to me... but maybe it is somehow wrong...


  • Rebel Alliance Developer Netgate

    If you decompressed it to an .img file before writing it, then it should be OK. The partition scheme looks OK at a glance but I don't have a recovery image handy to double check.

    It's also possible there is a problem with the drive itself, you might try another one. Or at least maybe do a complete wipe of the drive before writing the image out to be safe.



  • @jimp I erased the "disk" (a USB key) and this time used 'dd' from a linux box. The resulting disk seems basically the same:

    Disk /dev/sdd: 7.5 GiB, 8039481344 bytes, 15702112 sectors
    Units: sectors of 1 * 512 = 512 bytes
    Sector size (logical/physical): 512 bytes / 512 bytes
    I/O size (minimum/optimal): 512 bytes / 512 bytes
    Disklabel type: dos
    Disk identifier: 0x00000000
    
    Device     Boot Start     End Sectors  Size Id Type
    /dev/sdd1           1    1600    1600  800K ef EFI (FAT-12/16/32)
    /dev/sdd2        1601   71612   70012 34.2M  b W95 FAT32
    /dev/sdd3       71613 3001300 2929688  1.4G a5 FreeBSD
    

    The result of trying to boot that was basically the same, but slightly more output:

    Marvell>> run usbrecovery
    ** First descriptor is NOT a primary desc on 1:1 **
    switch to partitions #0, OK
    mmc1(part 0) is current device
    
    MMC erase: dev # 1, block # 0, count 4194304 ... 4194304 blocks erased: OK
    ** Bad device usb 0 **
    ** Bad device usb 0 **
    libfdt fdt_check_header(): FDT_ERR_BADMAGIC
    No FDT memory address configured. Please configure
    the FDT address via "fdt addr <address>" command.
    Aborting!
    No FDT memory address configured. Please configure
    the FDT address via "fdt addr <address>" command.
    Aborting!
    ## Starting EFI application at 05000000 ...
    WARNING: Invalid device tree, expect boot to fail
    efi_load_pe: Invalid DOS Signature
    ## Application terminated, r = -2
    Marvell>> 
    

    Is there anything I can type at the Marvell>> prompt to verify that the USB key is mounted/readable/etc.?


  • Netgate Administrator

    Try usb reset. That will reset the usb system and show you the detected USB devices. You should see a USB storage device listed. If you do not that try a different USB device.

    Steve



  • Thanks Steve! Whatever magic usb reset does worked! After that running run usbrecovery succeeded.

    Great timing too. I'm at the office this weekend to reformat my SG-4860 as ZFS, and my SG-1100 is my backup, so with it borked, I was pretty worried about touching the SG-4860!

    Maybe usb reset should be added as a note here:
    https://docs.netgate.com/pfsense/en/latest/solutions/sg-1100/reinstall-pfsense.html


  • Netgate Administrator

    It should not really be needed as the 'usbrecovery' command includes 'usb reset'. However recently I have found some USB sticks that are not initially recognised can be found if usb reset is run a number of times.

    Steve


Log in to reply