In Linux, how do you delete the partition table from a disk?
7,370
You can just write some zeros to the first sector of the disk in question, for example you want to erase partition table of sda:
dd if=/dev/zero of=/dev/sda bs=512 count=1
That would fill first 512 bytes of the disk with zeros, and in effect erase the partition table.
Related videos on Youtube
![Bender the Greatest](https://i.stack.imgur.com/8Zc84.jpg?s=256&g=1)
Author by
Bender the Greatest
Husband, father, engineer, musician, and retrocomputing-enthusiast
Updated on September 18, 2022Comments
-
Bender the Greatest almost 2 years
In Linux, how would I go about removing the GPT or MBR partition table on a disk? To be clear, I don't want to immediately format with a new partition table, I want to be able to remove the partition table completely.
-
sawdust over 7 yearsYou have the block size and count numbers swapped.
-
SparedWhisle over 7 yearsyeah. but I think either way should work, only bs=512 is better?
-
sawdust over 7 yearsIf you're convinced that your original answer is good, then you should have left it alone.