I have some partitions on /dev/sda. I want to remove them all of them programatically. One way is to list all partitions and then delete them one by one. Another way is to just execute
dd if=/dev/zero of=/dev/sda
The first option failed when I got some problem with my partition table due to which the listing of the current partitions was not giving any output thereby I was unable to delete any current partition.
The second method is taking too long. Is there any "quick way" to just set the whole hard disk (/dev/sda) as unpartitioned from a shell script?