Nanobsd 2.3.1_1 to 2.3.1_5 upgrade failed - need help to recover



  • All,
    i was a bit uncautious upgrading an Alix nanobsd install without a fall-back.
    After reboot, the box never came back to live.
    Serial console shows:

    BIOS drive C: is disk0
    BIOS 640kB/261120kB available memory
    
    FreeBSD/x86 bootstrap loader, Revision 1.1
    (root@ce23-i386-builder, Tue May 17 19:19:55 CDT 2016)
    Loading /boot/defaults/loader.conf
    /boot/kernel/kernel text=0x121f21a inflate: invalid code lengths set
    
    readin failed
    
    elf32_loadimage: read failed
    can't load file '/boot/kernel/kernel': input/output error
    can't load file '/boot/kernel/kernel': input/output error
    |
    Hit [Enter] to boot immediately, or any other key for command prompt.
    Booting [/boot/kernel/kernel]...
    /boot/kernel/kernel text=0x121f21a inflate: invalid code lengths set
    
    readin failed
    
    elf32_loadimage: read failed
    can't load 'kernel'
    
    Type '?' for a list of commands, 'help' for more detailed help.
    OK
    
    

    Can I recover the box by switching back to the working boot slice on that command prompt? If so how?

    thanks so much for help!



  • Have the console working at the speed set in the BIOS (t might be spitting out the BIOS stuff at 9600 baud). Then watch where it says it is booting from slice 1 or 2 (I think it says F1 or F2 at that point). Press the opposite number to select the other slice. You need to press the ordinary number (1 or 2 key), not the F1 or F2 key.



  • Thanks Phil!
    That worked and will be noted in my knowledge-base for future reference.
    Before trying this again, I wanted to manually duplicate the slice and check both work well. However duplicating in the web interface times out, there is no progress bar or anything for it.
    I have therefore followed a hint I found by googling to use the command line as follows:

    nanobsd_detect_slice_info();
    global $TOFLASH, $COMPLETE_PATH, $COMPLETE_BOOT_PATH;
    echo "Will clone FROM $COMPLETE_BOOT_PATH TO $TOFLASH\n";
    if(nanobsd_clone_slice($COMPLETE_PATH)) { echo "SUCCESS\n"; } else { echo "FAILURE\n"; }
    nanobsd_detect_slice_info();
    exec
    

    I hope that does the same thing.
    best!



  • So to be on the safer side I have kicked of a new upgrade attempt on the console which failed like this:

    [38/39] Upgrading pfSense-base-nanobsd from 2.3.1_1 to 2.3.1_5...
    ===> Keeping a copy of current version mtree
    [38/39] Extracting pfSense-base-nanobsd-2.3.1_5:
    pkg: archive_read_extract() errno -1: Lzma library error: Corrupted input data
    [38/39] Extracting pfSense-base-nanobsd-2.3.1_5... done
    [38/39] Deleting files for pfSense-base-nanobsd-2.3.1_5: ..... done
    >>> Locking package pfSense-kernel-pfSense_wrap... done.
    pkg: open(/bin/sh): No such file or directory
    pkg: open(/bin/sh): No such file or directory
    pkg: Unable to determine ABI
    pkg: Cannot parse configuration file!
    pkg: open(/bin/sh): No such file or directory
    pkg: open(/bin/sh): No such file or directory
    pkg: Unable to determine ABI
    pkg: Cannot parse configuration file!
    

    any hint?



  • You're missing files that are a key core part of the system. Seems likely your CF is flaky.