# Making a disk bootable



## balanga (Mar 25, 2020)

Can I make a non-FreeBSD disk/USB stick bootable using something like `gpart bootcode -b /boot/bootxyz da0` for making a DOS or Linux bootable? If FreeBSD doesn't have the appropriate code what could I use instead?


----------



## Paul Floyd (Mar 25, 2020)

Wikipedia has a fairly lengthy article on the MBR. I would expect gpart to work. It would be a good idea to practice on a USB stick that has nothing important on it though.


----------



## SirDice (Mar 25, 2020)

FreeBSD's MBR bootcode only boots FreeBSD, it specifically searches for the other FreeBSD bootstages. You might be able to use boot0cfg(8) though, but it will only work on MBR.


----------



## Ordoban (Mar 25, 2020)

FreeBSD contains a additional MBR bootloader /boot/boot0 who provides a small boot-menu. This can chain-load the boot-sectors of other operating systems as well. I know this working with FreeBSD and Windows.
I don't know if Linux would boot like this, because Linux comes allways with GRUB. Does the Linux loader "LILO" still exist?


----------



## balanga (Mar 25, 2020)

I think I need to run syslinux() which I have successfully done in the past but this time I'm getting an error:-

When running `syslinux --install /dev/da0s1` I get 





> operation not permitted



Not sure why...


----------



## SirDice (Mar 25, 2020)

Probably because you're trying to write an MBR to a slice instead of a disk.


----------



## mindware (Mar 25, 2020)

I have read round there, that GPT it's more efficient. Anyway, search in the handbook. I don't remember it well. I think that it was in the handbook.


----------

