Linux: How to clear (delete) a GUID partition table (GPT)

root's picture

If you attach to linux box a disk partitioned under FreeBSD or OS X, you will find this warning message on fdisk command:
"WARNING: GPT (GUID Partition Table) detected on '/dev/sdc'! The util fdisk doesn't support GPT. Use GNU Parted."

This is not dangerous and you can partition the disk as you please with cfdisk, fdisk or whatever because it will simply work. The only bother will be this warning. But of course, there is a solution for that too. Read on.

root@core:~# fdisk -l /dev/sdc

[color=red]WARNING: GPT (GUID Partition Table) detected on '/dev/sdc'! The util fdisk doesn't support GPT. Use GNU Parted.[/color]


Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes
256 heads, 63 sectors/track, 121126 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00000000

   Device Boot      Start         End      Blocks   Id  System
/dev/sdc1              63  1953525167   976762552+  83  Linux

You can fix this warning with parted but remember: YOU WILL LOOSE EVERYTHING ON THIS DISK SO BE SURE YOU PICK THE RIGHT ONE AND YOU DO NOT NEED ANYTHING FROM IT!

Sorry for CAPS. So if you are sure THIS IS THE RIGHT DISK, move forward and execute parted:

root@core:~# [color=green]parted /dev/sdc[/color]
GNU Parted 2.3
Using /dev/sdc
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) mklabel msdos
Warning: The existing disk label on /dev/sdc will be destroyed and all data on this disk will be lost. Do you want to continue?
Yes/No? [color=green]Yes[/color]                                                               
Warning: /dev/sdc contains GPT signatures, indicating that it has a GPT table.  However, it does not have a valid fake msdos partition table, as it should.  Perhaps it was corrupted -- possibly by a program that doesn't understand GPT partition tables.  Or perhaps you deleted
the GPT table, and are now using an msdos partition table.  Is this a GPT partition table?
Yes/No? [color=green]Yes[/color]
(parted) [color=green]quit[/color]
Information: You may need to update /etc/fstab.

Now you are done:

root@core:~# fdisk -l /dev/sdc

Disk /dev/sdc: 1000.2 GB, 1000204886016 bytes
255 heads, 63 sectors/track, 121601 cylinders, total 1953525168 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x0006d93a

   Device Boot      Start         End      Blocks   Id  System

Thou shalt not steal!

If you want to use this information on your own website, please remember: by doing copy/paste entirely it is always stealing and you should be ashamed of yourself! Have at least the decency to create your own text and comments and run the commands on your own servers and provide your output, not what I did!

Or at least link back to this website.

Recent content

root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root
root