# startup.nsh



## balanga (Apr 20, 2021)

I have a FreeBSD box hasn't been running for some time, although when it does run I never have any trouble with it. The problem I have is that I can't get to the boot menu. I get an EFI Shell version 2.32 [15.8]

Whatever key sequence I try i get *startup.nsh* and then a

Shell>

prompt. What can I put in there to get the system booting? Is there any way to edit/view  startup.nsh? Not exactly sure where it lives.
The system is home built using a Supermicro X10SBA-L  motherboard.

I did manage to get it started booting once but it just hung after the FreeBSD boot men saying Booting...

Is this a motherboard failure?


----------



## SirDice (Apr 20, 2021)

balanga said:


> Is there any way to edit/view startup.nsh? Not exactly sure where it lives.


It's on the EFI partition but it shouldn't really be needed. You might need to fiddle a bit with efibootmgr(8) because it sounds like your system is set up to boot something that doesn't exist any more.

By default UEFI will look for a EFI/BOOT/BOOTX64.EFI on the efi partition (which is just a FAT filesystem, you can mount it with msdosfs(5)). Unless those variables have been changed, maybe by a previously installed Windows or Linux installation. That's where efibootmgr(8) comes in handy, you can add/remove/change what gets booted and the order. 

In any case:

```
mount -t msdosfs /dev/ad0p1 /mnt # assuming p1 is the efi partition
mkdir -p /mnt/EFI/BOOT
cp /boot/loader.efi /mnt/EFI/BOOT/BOOTX64.efi
```
If you do have a startup.nsh file already in EFI/BOOT, just make sure it has BOOTx64.efi in there, nothing else.

Upper/Lower-case doesn't matter, FAT is not case-sensitive.


----------



## balanga (Apr 20, 2021)

I get this shell when I disconnect the disks,

I guess it must be somewhere in the BIOS,,,


----------



## SirDice (Apr 20, 2021)

Hit del to get into the BIOS/UEFI. Tab "Save & exit", at the bottom of that page you can choose "Boot override".


----------

