[How To] Fix your messed up partition tables.

[How To] Fix your messed up partition tables.

Dealing with hard drive partition scheme is always messy. First of all, many people don’t even understand what the thing is. Secondly, you have to be very cautious while changing anything. A tiny error and you could end up in corrupted data! When it comes to playing with hard drive partitioning problems, results range from absurdly sized partitions to complete data loss. In this tutorial, we are going to handle one such issue. If you have ever used same hard drive to boot some flavor of UNIX like fedora with or Mac along with Windows, chances are that your hard drive has got confusing partition schemes. Let’s fix partition tables.

What are GPT and MBR?

GPT (GUID Partition Table) and MBR (Master Boot Record) are standards for layout of the partition tables. Partition tables are the places where information about how your hard drive is partitioned is stored. MBR is the most common standard. It’s been around for a while now. Almost all operating systems support and use this. GPT is relatively new standard. It is specifically meant to target Intel’s new UEFI system. Though most of the modern operating systems support it, Windows doesn’t go well with combination of BIOS with GPT. It likes to stick with MBR on BIOS disks.

What is the problem?

Well, let us say you take a fresh hard drive and install something like fedora on it. Now, fedora will prefer to use GPT. So, it will write partition table using GPT standard. You later decide that you want to dual boot Ubuntu and Windows. When you install Windows, it will try to overwrite GPT with MBR. However, it’s not very good at completely wiping the GPT out. So, there will be confusing combination of healthy MBR and partially wiped GPT. So, when you boot from Ubuntu installation disk, you won’t be able to see any partitions at all. This is really an annoying problem and causes people to pull their hair out of frustration.

Let’s fix partition tables

Fortunately, solution is simple! All you need is PartedMagic live disc. Even Ubuntu live CD should work just fine. Let’s get started.

  1. First, boot from PartedMagic or Ubuntu disc.
  2. Open terminal and do the following steps there.
  3. If you are using Ubuntu live disk, you’ll need to install a package called ‘gdisk’ first by typing

    sudo apt-get install gdisk

    The package will be downloaded and installed. You can also download it from the official page. Screenshot attached shows everything!

    Installing gdisk
    Installing gdisk
  4. Now, in terminal, launch gdisk by typing

    sudo gdisk /dev/sda

    Here, sda is the hard drive we are dealing with.
    It will ask you whether to use GPT or MBR data. Any one will work as we are going to wipe that data anyway.

    Fix partition tables
    Fix partition tables

    Screenshot shows the process. For me, GPT data was already absent. So, I did not have to wipe it out. However, you should choose appropriate options.

  5. We need to have expert’s mode. Type ‘x’ and command prompt will change to the expert’s mode.
  6. Now, press ‘z’ – this ‘zaps’ i.e., destroys the data. It will clear GPT data. You can also clear MBR data if you wish to clean everything and start fresh.

That’s it. Shut everything down and restart the computer. Both Windows and Ubuntu should be able to see the same MBR data now.

Have got any other tips? Share them via comments.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.