# BTX Halted (Reinstall Boot Loader Only)



## AlbyVA (Nov 10, 2014)

I got the error message during a reboot of my FreeBSD box that says BTX halted. My assumption is the the boot loader got corrupted.

So my theoretical solution is to replace/reinstall the boot loader. I have a boot only CD that I've burned. So I can boot to the live disk or shell and do whatever is needed to reinstall a new boot loader on my hard drive. Question is, how do I reinstall the boot loader on the HDD from the CD?

Thanks.


----------



## SirDice (Nov 10, 2014)

AlbyVA said:


> Question is, how do I reinstall the boot loader on the HD from the CD?


You can use the `gpart bootcode` command. You just have to make sure you are referencing the correct drive and partition.


----------



## AlbyVA (Nov 10, 2014)

SirDice said:


> You can use the `gpart bootcode` command. You just have to make sure you are referencing the correct drive and partition.




 Got a sample command line on using `gpart bootcode` to accomplish such a task?


----------



## kpa (Nov 10, 2014)

For installing/replacing the MBR bootcode it goes like:

`gpart bootcode -b /boot/mbr ada0`


----------



## SirDice (Nov 10, 2014)

If it's GPT: `gpart bootcode -p /boot/gptboot -i 1 ada0`


----------

