[Re: drives]

Matt Graham danceswithcrows@usa.net
14 Sep 2001 11:08:47 EDT


Ben Pfaff <pfaffben@msu.edu> wrote:
> "Marcel Kunath" <kunathma@pilot.msu.edu> writes:
> 
>> Now today I had a drive I had a partition table on and wanted to wipe 
>> and then
>> use the drive once again without partition table but I couldn't figure 
>> out how.
> 
> To wipe a partition table:
> 	dd if=/dev/zero of=/dev/<disk> bs=1024 count=1024

[PEDANTIC] This will get not just the partition table, but the entire first
megabyte of the drive.  The boot sector and partition table for an x86 reside
in the first 512 bytes on the disk.  [/PEDANTIC]

Anyway, a newly purchased IBM IDE drive had nothing but 0x00 in every byte of
the first gig, so dd'ing /dev/zero to a drive should return it to "like new"
condition.  But in most cases you should partition a hard disk.  You don't
gain much space by leaving the thing unpartitioned, and you lose flexibility. 
Certain OSes, partition editors, and maybe even some motherboard BIOSes will
get confused if they see a disk without the magic number in the last two bytes
of the MBR and say, "Do you want to format drive X:?  (Y/y)"  And Cthulhu help
you if by some mischance bytes 510 and 511 of your unpartitioned disk do
contain the magic number... partitioning programs will see this and barf most
heinously.

-- 
Matt G / Dances With Crows
There is no Darkness in Eternity/But only Light too dim for us to see
"I backed up my brain to tape, but tar says the tape contains no data...."