linux

how to erase a GPT partition table under linux

  • Install sgdisk if you don’t already have it:
    apt-get install sgdisk
  • Figure out which disk you are working on (here we assume sdb):
    dmesg|grep sd
    umount /dev/sdb*
  • To just get rid of the GPT:

    sgdisk -z /dev/sdb
  • To get rid of the GPT and MBR:

    sgdisk -Z /dev/sdb