dd command to clear start of harddrive

Andy Green andy at warmcat.com
Wed Oct 24 20:24:10 UTC 2007


Somebody in the thread at some point said:
> This is not directly Fedora related.
> 
> I connect to the Internet through my Smoothwall, and a serial modem. Recently 
> the machine that the Smoothwall is running on has been playing up. Harddrive 
> spinning up and down. I have another older machine (1.33GHz, 64MB RAM, and 
> 6GB harddrive) which had Win 2000 pro on it, and was trying to install a 
> backup Smoothwall on it. The Smoothwall installs ok, and lilo is installed, 
> but when I reboot the BIOS does the memory check, and all I get next is half 
> a screenfull of "40's" printed out. they remain for a few seconds, then I 
> just get a prompt that I can't do anything with.
> 
> I am wondering if something has been left behind on the harddrive from the Win 
> 2000 install, that linux has not been able to remove.
> 
> I've seen a few times a dd command that can get rid of stuff at the start of a 
> drive, but stupidly have not written down the info.
> 
> Could someone kindly give the required dd command to make sure that the 
> harddrive is clear of all data.

You can take a dump on it like this -- make sure everything from sdbX is
unmounted --

# dd if=/dev/zero of=/dev/sdb bs=1024 count=5000

for example that will crap on the first 5MBytes on your /dev/sdb drive,
erasing the partition table, bootloader and probably the start of the
first partition.  Obviously take care to change sdb to your actual drive.

You'll need to run partprobe and fdisk it afterwards and reformat as usual.

-Andy




More information about the fedora-list mailing list