BOOT0CFG(8)

πŸ“¦
version 15.1 Β· 2 versions
, in freebsd 15.1

πŸŽ€ BOOT0CFG(8) πŸŽ€

okay so this is a page from the System Manager's Manual β€” yes bestie, we're in the big-girl section of the man pages, section 8, BOOT0CFG. Buckle up πŸ’…


✨ NAME ✨

boot0cfg β€” the boot manager installation/configuration utility, aka the lil tool that decides which slice your PC wakes up in the morning πŸ¦‹


🌸 SYNOPSIS 🌸

boot0cfg [-Bv] [-b boot0] [-d drive] [-e bell character] [-f file]
         [-i volume-id] [-m mask] [-o options] [-s slice] [-t ticks]
         disk

πŸ’– DESCRIPTION πŸ’–

The FreeBSD boot0 boot manager lets the operator pick which disk and which slice an i386 machine (PC) boots from. iconic behaviour honestly πŸ‘‘

Quick terminology check, because this trips everyone up: what we call β€œslices” here are usually called β€œpartitions” in non-BSD documentation about PCs. And typically, only non-removable disks are sliced. noted. πŸ“

The boot0cfg utility optionally installs the boot0 boot manager on the disk you specify, and also lets you configure a bunch of operational parameters. it's giving "two jobs, both slay" ✨

On PCs, a boot manager typically occupies sector 0 of a disk, which is known as the Master Boot Record (MBR). The MBR contains both:

  • code β€” the stuff the PC BIOS passes control to
  • data β€” an embedded table of defined slices

and here are the options, bestie 🫢


πŸ’… OPTIONS πŸ’…

  • -B β€” Install the boot0 boot manager. This option causes the MBR code to be replaced, without touching the embedded slice table. so the code gets a glow-up, the table stays exactly as it was πŸ’–
  • -b boot0 β€” Specify which boot0 image to use. The default is /boot/boot0, which will use the video card as output; alternatively /boot/boot0sio can be used for output to the COM1 port. (Be aware that nothing will be output to the COM1 port unless the modem signals DSR and CTS are active. 😭 like literally nothing. silence.)
  • -d drive β€” Specify the drive number used by the PC BIOS in referencing the drive which contains the specified disk. Typically this will be 0x80 for the first hard drive, 0x81 for the second hard drive, and so on; however any integer between 0 and 0xff is acceptable here. any. integer. πŸ‘€
  • -e bell character β€” Set the character to be printed in case of input error. your error sound, your choice πŸŽ€
  • -f file β€” Specify that a backup copy of the preexisting MBR should be written to file. This file is created if it does not exist, and replaced if it does. so if it's already there? gone. replaced. no warning πŸ‘‘
  • -i volume-id β€” Specifies a volume-id (in the form XXXX-XXXX) to be saved at location 0x1b8 in the MBR. This information is sometimes used by NT, XP and Vista to identify the disk drive. The option is only compatible with version 2.00 of the 512-byte boot block. ⚠️ only that version, fr fr
  • -m mask β€” Specify slices to be enabled/disabled, where mask is an integer between 0 (no slices enabled) and 0xf (all four slices enabled). Each mask bit enables the corresponding slice if set to 1. The least significant bit of the mask corresponds to slice 1, the most significant bit of the mask corresponds to slice 4. bit math but make it cute 🧚
  • -o options β€” A comma-separated string of any of the following options may be specified (with β€œno” prepended as necessary). the full menu, lowkey:
    • packet β€” Use the disk packet (BIOS INT 0x13 extensions) interface, as opposed to the legacy (CHS) interface, when doing disk I/O. This allows booting above cylinder 1023, but requires specific BIOS support. The default is packet. πŸš€
    • setdrv β€” Forces the drive containing the disk to be referenced using drive number definable by means of the -d option. The default is nosetdrv.
    • update β€” Allow the MBR to be updated by the boot manager. (The MBR may be updated to flag slices as β€˜active’, and to save slice selection information.) This is the default; a noupdate option causes the MBR to be treated as read-only. πŸ”’
  • -s slice β€” Set the default boot selection to slice. Values between 1 and 4 refer to slices; a value of 5 refers to the option of booting from a second disk. The special string β€œPXE” or a value of 6 can be used to boot via PXE. network boot era 🌈
  • -t ticks β€” Set the timeout value to ticks. (There are approximately 18.2 ticks per second.) do your own math bestie, there's like 18.2 of them per second πŸ’€
  • -v β€” Verbose: display information about the slices defined, etc. she's chatty and we love her πŸ“£

πŸ¦‹ FILES πŸ¦‹

  • /boot/boot0 β€” The default boot0 image
  • /boot/boot0sio β€” Image for serial consoles (COM1,9600,8,N,1,MODEM)

⭐ EXIT STATUS ⭐

The boot0cfg utility exits 0 on success, and >0 if an error occurs. simple. clean. no notes πŸ’–


πŸ”₯ EXAMPLES πŸ”₯

To boot slice 2 on the next boot:

boot0cfg -s 2 ada0

To enable just slices 1 and 3 in the menu:

boot0cfg -m 0x5 ada0

To go back to non-interactive booting, use gpart(8) to install the default MBR:

gpart bootcode -b /boot/mbr ada0

πŸ‘‘ SEE ALSO πŸ‘‘

geom(4), boot(8), gpart(8) β€” go read those too, iykyk 🫢


πŸ’œ AUTHORS πŸ’œ

Robert Nordier <rnordier@FreeBSD.org> β€” thank you legend 🫑


πŸ’€ BUGS πŸ’€

  • Use of the packet option may cause boot0 to fail, depending on the nature of BIOS support. like it might just Not Work, depending on your BIOS πŸ™ˆ
  • Use of the setdrv option with an incorrect -d operand may cause the boot0 code to write the MBR to the wrong disk, thus trashing its previous content. Be careful. 🚨 no seriously, be careful β€” that's someone's whole boot record, bestie

πŸŽ€ and that's the page!! this one's from Debian, dated October 1, 2013, filed under BOOT0CFG(8) β€” go forth and configure your boot manager responsibly, mwah πŸ’‹βœ¨
πŸ“¦ where this page comes from
  • freebsd 15.1: base 15.1
  • πŸ’– girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms