Skip to content

Instantly share code, notes, and snippets.

View alphanso's full-sized avatar

Rishabh Singhal alphanso

View GitHub Profile
@rgl
rgl / mbr-to-gpt.md
Last active March 24, 2023 04:27
BIOS: Convert from MBR to GTP

MBR to GPT Conversion

This is a three step procedure:

  1. Use gdisk to convert the partition type from MBR to GPT (without data loss).
  2. Use gdisk to add a new BIOS boot partition (EF02 type).
  3. Use grub-install to install the boot loader into the new BIOS boot partition.

MBR to GPT

@cjyar
cjyar / mbr-to-gpt-uefi.md
Last active June 9, 2024 06:53
Convert a disk from MBR to GPT+UEFI, in Linux.

Before starting, make sure you have a backup, and make sure to have a linux live boot ready to rescue your system. It's easy to mess this up!

  1. Use gdisk to convert the partition table to GPT.

    gdisk /dev/sda

  2. Create the "BIOS boot" partition that GRUB needs.

    n to create a new partition. Needs to be about 1MB. You can probably squeeze this in from sectors 34-2047. Use L or l to look up the code for "BIOS boot" (ef02).

  3. Write the new partition table.

    w

  4. Reload the partition table. > partprobe /dev/sda