Zemanta Related Posts Thumbnail

Zap GPT data structures from a disk, while preserving existing MBR partitions

Using GPT partitions, or a GPT partitioning scheme, takes care of the shortcomings of the MBR partitioning scheme. However, if you are not careful, it could make things difficult for you. But don’t point fingers at the technology itself.

Back in November 2012, while attempting to dual-boot Ubuntu 12.10 and Windows 8 Pro on a solid state drive (SSD), I made an observation which I wrote about in Why is Windows 8 on SSD invisible to Ubuntu 12.10’s installer?. At that time, the most vexing thing was that I could not reproduce the problem on my regular hard disk drives (HDDs). And I could not figure out the solution.

Bartek Juszczak, a reader who commented on that article, suggested a very simple solution. I never bothered to try it out until yesterday when I made a first attempt to triple-boot Windows 7, Ubuntu 12.10 and Fedora 18 on the same SSD.

Even though I was using Windows 7 instead of Windows 8 Pro, it was the same problem all over again; Ubuntu’s installer could not detect the existing Windows 7 on the SSD.

To give you an idea of the nature of the problem, take a look at this screen shot. If you’ve ever installed Ubuntu or any Ubuntu-derived distribution, you know that it’s from the partitioning methods step of Ubiquity, the graphical installation program of Ubuntu Desktop. Though it says that “This computer has no detected operating system,” there is a fresh installation of Windows 7 on it.
Ubuntu Ubiquity Installer

Related Post:  End-to-end Machine Learning with TensorFlow on Google Cloud Platform

Even from the Advanced Partitioning Tool’s window, there is no evidence of any partition on it. Why? Based on Juszczak comment, and from my observation while attempting to implement his fix, it appears that the SSD had GPT partitions on it before Windows was installed. So the GPT data structures were confusing Ubiquity.
Ubuntu Advanced Partitioning Tool

After successfully implementing Juszczak’s fix, Ubiquity’s accurately detected the presence of Windows 7 on the SSD. If you are facing the same problem, this short article gives you a step-by-step guide, with screen shot, on how to remedy it.
GPT Partitions

I made the attempt to fix the problem while installing Ubuntu from the Live desktop. You will be working from a shell terminal, and be using Gdisk to mess with the disk. Since Gdisk is not installed in the Live environment, it will have to be installed using sudo apt-get install gdisk. After that, run the command shown in the screen shot below. The output reveals what the problem is: Presence of MBR and GPT partition tables on the same SSD. That’s why Ubuquity got confused.
GPT Partitions gdisk

Related Post:  Accessing Linux systems remotely

Since I installed Windows 7 using an MBR partitioning scheme, the reasonable option to select is “1.” I want to preserve the MBR partitions.
GTP Partitions Gdisk

Now that I’ve told Gdisk what I don’t want to destroy, it is expecting additional commands. Type “x” to see a list of command options.
GPT Partitions Gdisk

The option we are looking for is “z” (zap (destroy) GPT data structures and exit).
GPT Partitions Gdisk

Type “y” to confirm wiping the GPT data structures.
GPT Partitions Gdisk

Then “n” to preserve the MBR partitions. That’s it.
GPT Gdisk

Please share:
Tags: No tags

35 Responses

Add a Comment

Your email address will not be published. Required fields are marked *