Skip to content
daniel@cosenza:~/blog
FreeBSDFix July 3, 2026 2 min read

Fixing a Corrupted GPT Boot Partition on FreeBSD

FreeBSD won't boot and the loader can't find the boot partition. Here's how to inspect and repair the GPT partition table from a live/rescue environment.

A FreeBSD system that drops straight to a firmware error or an empty prompt instead of booting normally often has a damaged GPT partition table rather than a corrupted filesystem — this is diagnosable and often fixable from a live/rescue image.

Step 1: boot from installation/rescue media

Boot the FreeBSD installer or a live image and drop into a shell (Live CD option from the installer menu).

Step 2: inspect the disk’s partition table

gpart show

Look for a disk showing no scheme at all, or a CORRUPT label — this confirms the GPT table itself is damaged, distinct from a filesystem-level problem within an otherwise-intact partition.

Step 3: check for a backup GPT header

GPT deliberately stores two copies of its partition table — one at the start of the disk, one at the end — specifically so one can be reconstructed from the other:

gpart recover ada0

gpart recover attempts exactly this: rebuilding a damaged primary table from the backup copy at the end of the disk.

Step 4: verify the recovered table looks correct

gpart show ada0

Confirm the recovered partitions (efi/freebsd-boot/freebsd-zfs or freebsd-ufs, freebsd-swap) match what you expect for this system, with reasonable sizes and no overlaps.

Step 5: confirm the boot partition itself has the right content

mount -t msdosfs /dev/ada0p1 /mnt
ls /mnt/EFI/BOOT/

For an EFI system, confirm BOOTX64.EFI (or the FreeBSD-specific loader) is actually present — a correctly-shaped partition with missing boot files needs the loader reinstalled, not just the partition table repaired.

Step 6: reinstall the boot loader if needed

gpart bootcode -p /boot/gptboot -i 1 ada0

Step 7: reboot and confirm normal startup

Remove the rescue media and reboot — a successful boot back to the normal FreeBSD environment confirms the repair held.

Why GPT’s redundancy makes this recoverable at all

Unlike the older MBR scheme, GPT’s deliberate primary-plus-backup design means a damaged partition table is often reconstructible without needing a full reinstall or backup restore — gpart recover’s existence as a standard tool reflects that this redundancy was a designed-in recovery path, not an accidental convenience.