Remove GPT - Default back to MBR
That link you posted looks like a very ugly hack type solution.
However, according to the man page, gdisk
, which is used to convert MBR -> GPT, also has an option in the "recovery & transformation" menu (press r
to get that) to convert GPT -> MBR; the g
key will:
Convert GPT into MBR and exit. This option converts as many partitions as possible into MBR form, destroys the GPT data structures, saves the new MBR, and exits. Use this option if you've tried GPT and find that MBR works better for you. Note that this function generates up to four primary MBR partitions or three primary partitions and as many logical partitions as can be generated. Each logical partition requires at least one unallocated block immediately before its first block.
I'd try that first.
Most of the previous respondents are correct when they say that you can usually do what you need with a GPT partition table layout, but since there are valid reasons for wanting to use MBR, I think I will just answer your question instead of assuming you are wrong for asking.
To get rid of the GPT, you need to remember that with this format, there is a partition table written to the end of the drive, where it will remain if you just try to delete it with fdisk or a non-GPT aware file system tool. What you did with parted did not address this partition table.
To erase GPT, you need to use something like gdisk. Enter gdisk
as root at the prompt, and then tell gdisk what device you want to look at (i.e. /dev/sd??). Use gdisk to write a protective MBR to the disk just to make sure you have access to some MBR data structure. Then you can navigate to the expert options section (press ?
at the different program prompts to see the options available to you at different times) and find the option that says "Zap (destroy) the GPT data structures and exit." The program will prompt for confirmation, then ask you if you want to preserve the MBR structure. Do preserve this.
After that, it should be as simple as rebooting your computer (because the kernel will still be using the old partition table and it needs a restart to update), and then firing up fdisk and deleting the remnant of the GPT partition. You will still see the same warning about using GNU Parted that you saw before, but you can ignore it this time, as it will go away when you delete the partition.
This will give you an MBR partition table system on a blank drive onto which you can reinstall an OS. If you are attempting to do this with existing partitions, it is quite a bit more complicated and in some cases not even possible, so I would recommend that you simply back up your data and do it this way.
Use gdisk /dev/sda
Note: /dev/sda
is in the case of the person who asked this question but change it to your drive name.
Once you are inside with gdisk use:
x extra functionality (experts only)
then when you type p
to see all the options, you will see this:
Expert command (? for help): ?
a set attributes
c change partition GUID
d display the sector alignment value
e relocate backup data structures to the end of the disk
g change disk GUID
h recompute CHS values in protective/hybrid MBR
i show detailed information on a partition
l set the sector alignment value
m return to main menu
n create a new protective MBR
o print protective MBR data
p print the partition table
q quit without saving changes
r recovery and transformation options (experts only)
s resize partition table
t transpose two partition table entries
u Replicate partition table on new device
v verify disk
w write table to disk and exit
z zap (destroy) GPT data structures and exit
? print this menu
Use z
Expert command (? for help): z
About to wipe out GPT on /dev/xvdf. Proceed? (Y/N): Y
GPT data structures destroyed! You may now partition the disk using fdisk or
other utilities.
Blank out MBR? (Y/N): Y