# Boot failure after upgrade to 11.4 BTX halted



## jwdevel (Aug 9, 2021)

I am doing a source upgrade from 11.3 to 11.4. Now that I have installed the new userland, reboot is failing.

Roughly, these are the steps I have done so far (as I have done on previous updates; nothing new here):

 get latest source from SVN
 make buildworld
 make kernel
 reboot - this was succesful. I saw the new kernel active, with the old userland
 in single-user mode:
adjkerntz -i
mergemaster -p
make installworld
reboot

And at this point, the reboot fails (consistently).

This is what shows onscreen:


```
BTX loader 1.00 BTX version is 1.02
Console: internal video/keyboard
BIOS drive A: is fd0
... (more drive info)

<dump of registers w/hex values; I can provide it if anyone wants, but can't copy/paste since it's on the physical console>

BTX halted
```

And that's where I'm at.
Does anyone know what I might try to fix this?

I have searched around for "BTX halted" and found various issues, but no clear solutions that would apply to me...

Maybe I need to rewrite the boot code as indicated in this other post?

I'll try building a live cd/usb stick, so I can investigate the filesystem further.

Some system info:

amd64
booting from UFS, no ZFS or anything fancy. I do have a hardware raid card, but that seems to initialize fine before it gets to the failure.
this is a pretty old system, incrementally updated from 6.x days


----------



## Emrion (Aug 9, 2021)

Rewrite the boot codes, indeed.








						Update of the bootcodes for a GPT scheme
					

This how-to is about the update of the bootcodes on FreeBSD as it's little to no documented.  It only covers the GPT scheme and is intended for people with little knowledge of FreeBSD.  When to update? At each upgrade of the system whenever it's a minor or a major one.  In general, the system is...




					forums.freebsd.org


----------



## jwdevel (Aug 9, 2021)

Interestingly, I made a boot USB stick from FreeBSD-11.4-RELEASE-amd64-memstick.img, booted from that, and got the same failure.
So, that's a clean system that should have the proper boot loader...

Maybe the 11.4 boot loader is incompatible with my system?
I'm going to try making a similar memstick for 11.3 and maybe 12.x and see if it's just 11.4 that's bad.

Also: from researching some, `make installworld` should update the bootcode too. So I imagine I already have the latest, there. This is consistent with the memstick boot failure...


----------



## jwdevel (Aug 9, 2021)

I tried making a 12.2 boot stick as well. It also fails to boot, but instead of "BTX halted", I get a screen full of garbage ASCII text.
I think I will be filing a bug report...


----------



## jwdevel (Aug 9, 2021)

Create bug over here: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=257722

Will see if that gets any traction.
But happy to get any input from other people here, too!


----------



## covacat (Aug 10, 2021)

i speculate that /boot/loader is too large for some setups and it bombs
try to interrupt early boot and change
Default: 0:ad(0,a)/boot/loader
Default: 0:ad(0,a)/boot/loader.old

see if it works


----------



## jwdevel (Aug 10, 2021)

covacat said:


> > i speculate that /boot/loader is too large for some setups and it bombs



The system has 8G ram, so I think that shouldn't be the problem.
From discussion on the bug report, it seems like this is a regression that is specific to MBR booting. Haven't tracked down the exact cause yet.

But yes, you are right that previous loaders do work successfully. For instance, I can copy the /boot/loader from a 11.3 memory stick, and it works.

I am curious: what is "loader.old"?  I notice that it is significantly smaller than the normal one (224K vs 328K).
Is that not just a copy of the previous OS's loader?


----------



## SirDice (Aug 10, 2021)

jwdevel said:


> Also: from researching some, `make installworld` should update the bootcode too.


It updates the files /boot/loader, /boot/gptboot, /boot/gptzfsboot, etc. It does NOT touch the installed bootloader that's in your freebsd-boot partition. You need to update that yourself (`gpart bootcode -p /boot/gptboot -i 1 ada0` for example).


----------



## covacat (Aug 10, 2021)

i had the same experience with pxeboot, did not trace the exact problem but older binaries work, newer ones bomb
you can try loader_lua, loader_4th (one of them should already be hard linked to loader) 
also you can create a /boot.config to boot /boot/loader.good (11.3?) instead of default


----------



## grahamperrin@ (Aug 13, 2021)

Is EFI boot an option with your hardware?


----------



## jwdevel (Aug 14, 2021)

grahamperrin said:


> Is EFI boot an option with your hardware?


Alas, no.
It's probably a 15 year old motherboard, at this point


----------

