# Fixing "Boot Failure" on Legacy BIOS Systems: Converting GPT to MBR for Older Hardware

## Introduction

If you're running Ubuntu Server on older hardware and experiencing a frustrating "Boot Failure" message despite having a working installation, this guide is for you. I recently encountered this exact issue on a Pentium Dual-Core E5700 system running Ubuntu Server 24.04, and after extensive troubleshooting, discovered the root cause: **GPT partition tables are incompatible with many Legacy BIOS systems from the 2009-2010 era**.

This article documents the complete troubleshooting journey and provides a step-by-step solution to convert your disk from GPT to MBR format, enabling automatic boot on legacy hardware.

---

## The Problem

### System Configuration

* **Hardware:** Pentium Dual-Core E5700 (Intel G41/ICH7 chipset, circa 2009-2010)
    
* **OS:** Ubuntu Server 24.04 (LVM/ext4)
    
* **Boot Mode:** Legacy BIOS (Non-UEFI)
    
* **Storage:** Samsung 232GB (OS drive - /dev/sda), WDC 160GB (Storage - /dev/sdb)
    

### Symptoms

* System displays "Boot Failure" message on power-on
    
* Manual boot via F10 BIOS boot menu works perfectly
    
* Ubuntu runs flawlessly once booted manually
    
* BIOS correctly shows the Samsung drive as first boot device
    

![](https://cdn.hashnode.com/res/hashnode/image/upload/v1768749765301/2c14f469-dba9-4d45-b64b-fbd8a7bbf979.jpeg align="center")

### Initial Troubleshooting Attempted (All Unsuccessful)

1. **CMOS Battery:** Replaced with new CR2032 - settings now persistent
    
2. **BIOS Configuration:** Disabled PXE boot, set Hard Disk as #1 priority
    
3. **Physical Ports:** Moved Samsung OS drive to SATA Port 0
    
4. **GRUB Repair:** Ran `grub-install /dev/sda` and `update-grub` - both reported success
    

Despite all these steps, the automatic boot still failed.

---

## Root Cause Analysis

### Discovering the Real Issue

The first clue came from checking the partition table type:

```bash
sudo fdisk -l /dev/sda
```

**Output:**

```bash
Disk /dev/sda: 232.89 GiB, 250059350016 bytes, 488397168 sectors
Disk model: SAMSUNG HD250HJ 
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: DC0B9FCE-C277-414C-8943-AB3356E74D95

Device       Start       End   Sectors   Size Type
/dev/sda1     2048      4095      2048     1M BIOS boot
/dev/sda2     4096   4198399   4194304     2G Linux filesystem
/dev/sda3  4198400 488394751 484196352 230.9G Linux filesystem
```

**Key finding:** `Disklabel type: gpt`

The disk was using a **GPT (GUID Partition Table)** instead of MBR (Master Boot Record).

### Why GPT Fails on Older BIOS

Further investigation with `gdisk` confirmed the issue:

```bash
sudo gdisk /dev/sda
```

**Output:**

```bash
GPT fdisk (gdisk) version 1.0.10

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.
```

**The smoking gun:** `MBR: protective`

GPT disks include a "protective MBR" that marks the entire disk as type `0xEE`. This is designed to prevent older tools from accidentally modifying GPT disks. However, **many vintage BIOSes from the Pentium Dual-Core era see this protective MBR, find no bootable partition, and refuse to hand off execution to the bootloader**—even though GRUB is correctly installed.

### Why the Boot Flag Didn't Help

I initially tried setting the GPT "LegacyBIOSBootable" attribute:

```bash
sudo fdisk /dev/sda
# Expert mode (x), then toggle attribute (A) on partition 1
```

This set the GPT attribute bit 2 on the BIOS boot partition. However, this didn't work because the BIOS never examines GPT attributes—it only sees the protective MBR and gives up before ever looking at the GPT structure.

---

## The Solution: Convert GPT to MBR

Since the disk had only 3 partitions (well under MBR's 4-primary limit) and was 232GB (well under MBR's 2TB limit), converting to MBR was the cleanest solution.

### Prerequisites

* Boot into your system using the F10 (or equivalent) manual boot menu
    
* Root or sudo access
    
* Understanding that this modifies partition table metadata (data remains intact)
    

---

## Step-by-Step Conversion Process

### Step 1: Backup Current GPT Partition Table

Before making any changes, create a backup of your current GPT layout:

```bash
sudo sgdisk --backup=/root/sda-gpt-backup.bin /dev/sda
```

**Expected output:**

```bash
The operation has completed successfully.
```

**What this does:**

* `sgdisk` is a GPT partition table utility
    
* `--backup` creates a binary copy of the entire GPT structure
    
* The backup file is saved to `/root/sda-gpt-backup.bin`
    

**Why this matters:** If anything goes wrong, you can restore with:

```bash
sudo sgdisk --load-backup=/root/sda-gpt-backup.bin /dev/sda
```

---

### Step 2: Open gdisk for Conversion

Launch the gdisk utility:

```bash
sudo gdisk /dev/sda
```

**Expected output:**

```bash
GPT fdisk (gdisk) version 1.0.10

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.

Command (? for help):
```

This confirms:

* `MBR: protective` — The problematic protective MBR
    
* `GPT: present` — Your actual partition data
    

---

### Step 3: Enter Recovery/Transformation Menu

At the `Command (? for help):` prompt, type:

```bash
r
```

**Expected output:**

```bash
Recovery/transformation command (? for help):
```

This menu contains tools for converting between partition table formats.

---

### Step 4: Start GPT to MBR Conversion

At the `Recovery/transformation command (? for help):` prompt, type:

```bash
g
```

**Expected output:**

```bash
MBR command (? for help):
```

You're now in the MBR conversion submenu.

---

### Step 5: View Proposed MBR Layout

Check what gdisk proposes for the conversion:

```bash
p
```

**Expected output:**

```bash
** NOTE: Partition numbers do NOT indicate final primary/logical status,
** unlike in most MBR partitioning tools!

** Extended partitions are not displayed, but will be generated as required.

Disk size is 488397168 sectors (232.9 GiB)
MBR disk identifier: 0x00000000
MBR partitions:

                                                   Can Be   Can Be
Number  Boot  Start Sector   End Sector   Status   Logical  Primary   Code
   1                  2048         4095   primary     Y        Y      0xEF
   2                  4096      4198399   primary              Y      0x83
   3               4198400    488394751   primary              Y      0x83
```

**Analysis:**

* Partition 1 (1M BIOS boot) — Type `0xEF` — **Needs to be omitted**
    
* Partition 2 (/boot, 2G) — Type `0x83` (Linux) — Correct
    
* Partition 3 (Main/LVM, 230.9G) — Type `0x83` (Linux) — Correct
    

---

### Step 6: Omit the BIOS Boot Partition

The 1M BIOS boot partition (partition 1) is only needed for GPT+BIOS setups. With MBR, GRUB installs directly into the space between the MBR and the first partition.

Type:

```bash
o
```

When prompted for partition number:

```bash
Partition to omit: 1
```

---

### Step 7: Verify Partition 1 is Omitted

Check the updated layout:

```bash
p
```

**Expected output:**

```bash
Disk size is 488397168 sectors (232.9 GiB)
MBR disk identifier: 0x00000000
MBR partitions:

                                                   Can Be   Can Be
Number  Boot  Start Sector   End Sector   Status   Logical  Primary   Code
   1                  2048         4095   omitted     Y        Y      0xEF
   2                  4096      4198399   primary     Y        Y      0x83
   3               4198400    488394751   primary              Y      0x83
```

Partition 1 now shows **"omitted"** status.

---

### Step 8: Set Boot Flag on /boot Partition

Type:

```bash
a
```

When prompted:

```bash
Toggle active flag for partition: 2
```

---

### Step 9: Verify Boot Flag is Set

Check the layout again:

```bash
p
```

**Expected output:**

```bash
Disk size is 488397168 sectors (232.9 GiB)
MBR disk identifier: 0x00000000
MBR partitions:

                                                   Can Be   Can Be
Number  Boot  Start Sector   End Sector   Status   Logical  Primary   Code
   1                  2048         4095   omitted     Y        Y      0xEF
   2      *           4096      4198399   primary     Y        Y      0x83
   3               4198400    488394751   primary              Y      0x83
```

The `*` in the Boot column confirms the boot flag is set on partition 2.

---

### Step 10: Write Changes to Disk

**⚠️ This is the critical step that modifies your disk.**

Type:

```bash
w
```

**Expected output:**

```bash
Converted 2 partitions. Finalize and exit? (Y/N):
```

Type:

```bash
Y
```

**Expected output:**

```bash
Warning: The kernel is still using the old partition table.
The new table will be used at the next reboot or after you
run partprobe(8) or kpartx(8)
GPT data structures destroyed! You may now partition the disk using fdisk or
other utilities.
```

The conversion is complete.

---

### Step 11: Update Kernel Partition Table

Inform the kernel about the new partition layout:

```bash
sudo partprobe /dev/sda
```

No output means success.

---

### Step 12: Verify the New MBR Partition Table

Confirm the conversion:

```bash
sudo fdisk -l /dev/sda
```

**Expected output:**

```bash
Disk /dev/sda: 232.89 GiB, 250059350016 bytes, 488397168 sectors
Disk model: SAMSUNG HD250HJ 
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000

Device     Boot   Start       End   Sectors   Size Id Type
/dev/sda2  *       4096   4198399   4194304     2G 83 Linux
/dev/sda3       4198400 488394751 484196352 230.9G 83 Linux
```

**Key confirmations:**

* `Disklabel type: dos` — MBR format ✓
    
* Boot flag (`*`) on `/dev/sda2` ✓
    
* Two partitions (sda2 and sda3) ✓
    
* Partition 1 omitted (not listed) ✓
    

---

### Step 13: Reinstall GRUB for MBR

Install GRUB into the MBR:

```bash
sudo grub-install --target=i386-pc /dev/sda
```

**Expected output:**

```bash
Installing for i386-pc platform.
Installation finished. No error reported.
```

**What this does:**

* Installs GRUB bootloader into the MBR (first 512 bytes)
    
* Installs GRUB's core image in the gap between MBR and first partition
    
* `--target=i386-pc` specifies Legacy BIOS mode (not UEFI)
    

---

### Step 14: Update GRUB Configuration

Regenerate the GRUB configuration:

```bash
sudo update-grub
```

**Expected output:**

```bash
Sourcing file `/etc/default/grub'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-6.8.0-90-generic
Found initrd image: /boot/initrd.img-6.8.0-90-generic
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
done
```

The warnings are harmless:

* **os-prober warning** — Only matters for dual-boot systems
    
* **UEFI Firmware Settings** — Leftover entry that won't affect Legacy BIOS boot
    

---

### Step 15: Full Power Cycle Test

Perform a complete power off (not reboot):

```bash
sudo poweroff
```

**Important:** Old BIOSes can cache boot information, so a full power cycle is necessary.

After the system powers off:

1. Wait 5-10 seconds
    
2. Power on the machine
    
3. **Do NOT press F10** — let it boot automatically
    

**Result:** The system should now boot to Ubuntu automatically without manual intervention.

---

## Summary of Commands

For quick reference, here's the complete sequence of commands:

```bash
# 1. Backup current GPT
sudo sgdisk --backup=/root/sda-gpt-backup.bin /dev/sda

# 2. Convert GPT to MBR using gdisk
sudo gdisk /dev/sda
# Inside gdisk:
#   r       (recovery menu)
#   g       (GPT to MBR)
#   p       (preview)
#   o       (omit partition)
#   1       (omit partition 1)
#   a       (toggle boot flag)
#   2       (set boot on partition 2)
#   p       (verify)
#   w       (write)
#   Y       (confirm)

# 3. Update kernel
sudo partprobe /dev/sda

# 4. Verify conversion
sudo fdisk -l /dev/sda

# 5. Reinstall GRUB
sudo grub-install --target=i386-pc /dev/sda
sudo update-grub

# 6. Power cycle
sudo poweroff
```

---

## Key Takeaways

1. **GPT and Legacy BIOS don't mix well** on older hardware (pre-2011). The protective MBR confuses vintage BIOSes.
    
2. **Manual boot working but automatic boot failing** is a classic symptom of partition table incompatibility.
    
3. **MBR is still viable** for disks under 2TB with 4 or fewer partitions.
    
4. **Converting GPT to MBR preserves data** — only the partition table metadata changes, not your files.
    
5. **Always backup the partition table** before making changes using `sgdisk --backup`.
    
6. **The BIOS boot partition is GPT-specific** and should be omitted during MBR conversion.
    
7. **Set the boot flag** on your `/boot` partition for Legacy BIOS compatibility.
    
8. **Full power cycle** (not reboot) is essential after partition table changes on older systems.
    

---

## Restoration (If Needed)

If something goes wrong and you need to restore the original GPT:

```bash
sudo sgdisk --load-backup=/root/sda-gpt-backup.bin /dev/sda
sudo partprobe /dev/sda
sudo grub-install --target=i386-pc /dev/sda
sudo update-grub
```

---

## Conclusion

While modern hardware handles GPT seamlessly, legacy systems from the late 2000s often require MBR for reliable automatic booting. This conversion process is safe, preserves your data, and finally enables your older server to boot without manual intervention.

If you're maintaining legacy hardware for home labs, development environments, or specialized applications, understanding these partition table fundamentals can save hours of frustrating troubleshooting.
