All of the following examples assume it is /dev/sda that you are wanting to mess with. Change the /dev/sda specification to the actual drive you are working on.
WARNING! Do the following AT YOUR OWN RISK. You can easily screw the pooch if you are not extremely careful. I make no guarantees that I have typed the examples below accurately and without error. Read up on the "dd" command so you know what you are doing before trying any of this.
WARNING! Do NOT mix up "if" ("input file") and "of" ("output file") arguments. This is an error that is easy to make, and can be devastating. You get no warning from "dd" when you attempt to do something ill advised. "dd" just does it without question.
=====
Before doing any of this, I would recommend saving your existing MBR to an external place (flashdrive, etc.):
Code:
dd bs=512 count=1 if=/dev/sda of=/path/to/your/flashdrive/mbr.bin
To restore your MBR if you later find you've screwed it up:
Code:
dd bs=512 count=1 if=/path/to/your/flashdrive/mbr.bin of=/dev/sda
======
To wipe only the partition table, leaving the boot code intact:
Code:
dd bs=1 seek=446 count=64 if=/dev/zero of=/dev/sda
To wipe the entire MBR (which is probably what you really want to do):
Code:
dd bs=512 count=1 if=/dev/zero of=/dev/sda
To wipe all of Track Zero (which contains the MBR and possibly a boot loader):
Code:
dd bs=512 count=63 if=/dev/zero of=/dev/sda
By wiping all of Track Zero, you wind up with a "blank" disk, unpartitioned, with no sneaky boot sector viruses. The disk behaves like it did when it came from the factory (assuming it didn't come from the factory already partitioned and formatted - some external disks come this way).
=====
Background:
A sector is 512 bytes long. The first sector of a disk is the MBR (Master Boot Record). The MBR contains 446 bytes of "boot code", followed by 64 bytes of "partition table", followed by two bytes of who-konws-what (not used by Linux). The "partition table" contains four "partition records", each being 16 bytes in length. Track Zero is the first 63 sectors of a disk (and therefore contains the MBR plus 62 additional sectors). These 62 additional sectors are sometimes used to hold a "boot loader", or part thereof. Ill-advised copy protection schemes sometimes use these 62 sectors, often times with disastrous results for the user. Actual "normal" data storage begins on Track One, which immediately follows Track Zero.