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.
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.
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.
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.
Since I installed Windows 7 using an MBR partitioning scheme, the reasonable option to select is “1.” I want to preserve the MBR partitions.
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.
The option we are looking for is “z” (zap (destroy) GPT data structures and exit).
Type “y” to confirm wiping the GPT data structures.
Then “n” to preserve the MBR partitions. That’s it.
I tried to install ubuntu on my computer but I couldnt do it without erasing windows so Im trying your technique to solve it but it says my gpt is not existent and then I received this message:
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory. THIS OPERATION IS POTENTIALLY DESTRUCTIVE! Exit by
typing ‘q’ if you don’t want to convert your MBR partitions
to GPT format!
Command (? for help): ?
b back up GPT data to a file
c change a partition’s name
d delete a partition
i show detailed information on a partition
l list known partition types
n add a new partition
o create a new empty GUID partition table (GPT)
p print the partition table
q quit without saving changes
r recovery and transformation options (experts only)
s sort partitions
t change a partition’s type code
v verify disk
w write table to disk and exit
x extra functionality (experts only)
? print this menu
could you help me? Im running windows 7!
1. Did you install Windows 7 yourself or is did it come with the PC?
2. Is Windows 7 installed on MBR or GPT partitions? If MBR, then you can zap the GPT partitions.
3. Can you see the Windows 7 partition from the advanced disk partitioning tool’s window?
I’m trying to see whether we can install Ubuntu without going through the steps in this article. Whatever you want to do, first backup your data.
If you can, try taking a screenshot of the partitioning type step and the advanced partitioning tool window and post them on a new post at the forum.
1. It came pre-installed on the PC
2. How do I check if it is install on MBR or GPT?
Boot into the live desktop and restart the installation. At the installation type step, choose the Soemthing else option and take a screenshot of the advanced partitioning tool window.
That should show all the partitions the installer detected on the disk. Post the image on a new post on the forum.
I think it’s MBR, but I just want to make sure. Guide to disks and disk partitions in Linux is a good article on this topic.
I posted on the forum
That looks like MBR, but I’d like to see it from the Ubuntu installer.
What’s that 1.7 GB partition in front of the System partition?
The partitioning scheme will be much clearer from Ubuntu’s installer, so let’s see that too.
Hi, when i type in sudo gdisk /dev/sda, i get a list of the partiotion table but it says my MBR is protected and it says ‘Found valid GPT with protective MBR; using GPT.’ and just puts me straight into options, what do i do?
Give me a bit more context. What version are you trying to install, are you attempting a dual-boot with what OS, and is your PC a UEFI system?
I’ve got the same problem here.
I’m trying to install Ubuntu 14.04.1 on dual boot with windows 8.1 (not pre-installed).
My PC is UEFI.
Can you help me ?
Before booting from the installation media, make sure you select the UEFI-aware version from the computers boot menu. Then when you launch the installer, choose the Something else option at the disk partitioning step.
See How to dual-boot Linux Mint 17 and Windows 8 on a PC with UEFI firmware for help.
I was scared that GRUB won’t recognize both Ubuntu and Windows( since Ubiquity does not) but if doesn’t seem to be a problem.
Thx a lot !
You save my life dude, seriously!!! Thx!!
Hi ! I have tried the procedure because Ubuntu installer was enable to detect Windows.
I have tried to installation again and i got this question:
unmount partitions that are in use?
Which I answered yes…. maybe that was a mistake. Ubuntu didnt recogniwe Windows any better so i did not continue installation. I cant boot on Windows now. Would you have any idea on how to get back my windows booting ??
When you try to boot Windows, what happens? And do you have a Windows installation CD?
Also, what version of Ubuntu are you trying to install and on what type of hardware?
wow its works.. thanks
Since 2 months I was trying to dualbooting ubuntu with win 8 with uefi mode. before a month I read this post to resolve issue. but ubuntu installer cd was getting error after using
sudo apt-get install gdisk command. Its saying that gdisk is
only for basic not for gpt.
But today I got direct installer package from… http://www.rodsbooks.com/gdisk/download.html
& installed that gptfdisk_0.8.8-1_i386.deb
Thanks to you to inspire me to give me guidence of “Zap GPT data structures from a disk, while preserving existing MBR partitions”
Because of that I successfully removed gpt structure & get option of Install ubuntu alongside with windows” option.
thanks to forum again.
good day !!
so, I did this and it worked great, except then when I rebooted all I could boot to was the live usb and NOT windows 8.1 (on a lenovo yoga 2 pro) so in the end I just wiped the disk and installed ubuntu over windows. not what i was shooting for, but helped me commit to obliterating windows, so, well, um, thanks i guess??!!??!
Ok, what I need now is a store-bought Windows 8 notebook. Unfortunately, I’m willing to give even 1 cent to MS, just so I can use the PC to write tutorials.
Anybody willing to donate?
thanks for what you have done. maybe i just need to build my own laptop. bought this one due to light weight, thin body, etc. really tired of the windows/mac BS tried to like some dedicated linux machines (system76) but didn’t have the small size/lightweight. i’m feeling pretty comfortable ditching windows…
Then just wipe whatever OS that came with your current box and install any Linux distribution that works for you. Been using Linux exclusively for 15 years. No regrets.
wiped windows and been on Ubuntu ever since and not looking back. used it the last 2 years or so, starting to experiment with others too.
Hey, you didn’t replied to my problem ?!
My hands are tied. Give me a couple of hours, maybe less.
You told me to zap the partition, but will it actually delete the data on my hard disk? I don’t have a backup, so just wanted to know this.!
Thanks a lot.
If you following the procedure described in the article, you will be zapping the GPT data structure, not the actual partition or data in the partition.
Regardless, it is always a good idea whenever you are attempting something like this.
Ok dude. Thanks a lot..!!
I tried the instructions that you gave and I got the following error. Could you please explain me what I should do as I am a kind of noob in all these partitions and all.
Please do reply.
Your screen shot does not show the options that comes after that warning. Post another one showing those options. There should be an option to destroy the invalid GPT data structures, which is the one to select.
But post the screen shot show I can be sure.
After that, it showed:
Command (? for help)
Same as in your screenshot in tutorial.
Well, it only detect a valid MBR partition on the system, so the commands you can run pertain to just that partitioning scheme.
But let’s get back to the beginning. What issues were you having before you embarked on it, and could you provide some info on your hardware?
Well, it’s like, I was trying to install Ubuntu on my Windows 8 laptop(64-bit Non-UEFI) and I have tried it earlier also, where when I booted through the USB and then when I went through the install Ubuntu, it gave me a choice that “Install Ubuntu alongside Windows 8” but now, it’s not showing up maybe because I shifted from 32-bit Windows 8 to a 64 bit one.
2 GB Ram
2.0 GHz Intel Pentium B940
500 GB Hard disk
It’s a laptop so I don’t know much. Hope you can help me as Ubuntu and Windows 8 both are me necessity.
thanks a lot.
Life will be so much better without Windows 8, but that’s a separate discussion.
Ok, if the laptop is OEM, have you checked the Secure Boot settings. Also, if it is OEM and it came with Windows 8, it should be using the 64-bit version and the GPT partitioning scheme.
So switching it to non-UEFI mode before installing Ubuntu will not change all that, which I think is the reason you are seeing a message about invalid GPT data structures even though the output is only showing MBR data structures.
Check the settings, switch back to UEFI and try zapping ZPT to see if it will actually show valid GPT data structures.
I really like the way the terminal windows were captured.
Could you please describe the process?
Your terminal window screenshots are very easy to read and
the background color looks really good too. Slightly brown or purple.
Would seem to be a bug in Ubiquity. If multiple partition tables exist, obviously the non-empty one should be used by default. If multiple partition tables are used, (is this even possible?) then there is a real problem and asking would seem to be required.