format and Erasing an hard disk drive

Programming, for all ages and all languages.
ravi_chobey
Posts: 13
Joined: Mon Apr 14, 2008 2:32 am
Location: Pune,India

format and Erasing an hard disk drive

Post by ravi_chobey »

Hi All,

I want to know the basic difference between erasing and formatting an hard disk drive from sector point of view.

As u all know that first sector is called MBR(Master Boot Record).As far as my research is concerned i came to know,In erase operation the data on disk is fully erased including MBR.But in cased of format MBR and partition is left out and rest every sector is erased.
Looking for your suggestions.

Regards,
Ravi chobey
Korona
Member
Member
Posts: 1000
Joined: Thu May 17, 2007 1:27 pm
Contact:

Post by Korona »

Format creates a file system on a partition. It does not "clear" any sectors at all (it just overwrites the sectors that store file system information and metadata) If you want to get rid of all data (all data and not all files; if you want to delete all files just overwrite the entry in the partition table or the file system superblock / root directory) you will have to write zeros to every sector of the partition.
Last edited by Korona on Fri May 16, 2008 10:03 am, edited 1 time in total.
User avatar
bewing
Member
Member
Posts: 1401
Joined: Wed Feb 07, 2007 1:45 pm
Location: Eugene, OR, US

Post by bewing »

The MBR contains partition information for the drive. A drive can (usually) have up to 4 partitions.

So: you can erase or format either individual partitions, or the entire drive.

Erasing a partition or complete drive almost never means writing 0's to every sector. That would take a VERY long time. Erasing a partition just means overwriting all of the filesystem information on that partition, as Korona said. "Erasing" a complete drive just means overwriting the MBR.

Formatting a partition means erasing the partition (see above) and then writing a new set of filesystem information to the partition.

Formatting a complete drive just means writing a good MBR to the drive,
unless you are talking about SCSI disks. SCSI disks have a "low level formatting function" that should be called before writing an MBR. But I know that you are not using SCSI disks.
User avatar
Solar
Member
Member
Posts: 7615
Joined: Thu Nov 16, 2006 12:01 pm
Location: Germany
Contact:

Post by Solar »

bewing wrote:SCSI disks have a "low level formatting function" that should be called before writing an MBR.
Old (outdated) knowledge. Modern SCSI drives require a low-level format only once (at the factory), and in fact most of them don't even interpret the corresponding command anymore, but merely skip it.
Every good solution is obvious once you've found it.
User avatar
JackScott
Member
Member
Posts: 1031
Joined: Thu Dec 21, 2006 3:03 am
Location: Hobart, Australia
Contact:

Post by JackScott »

The easiest way to erase a drive (write zeros to the whole lot) is with SeaTools, a program made by Seagate to test disks. You can download an ISO from their website. It's called SeaTools for DOS (but comes as an ISO).
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Post by Brynet-Inc »

Yayyak wrote:The easiest way to erase a drive (write zeros to the whole lot) is with SeaTools, a program made by Seagate to test disks. You can download an ISO from their website. It's called SeaTools for DOS (but comes as an ISO).
I have a copy of SeaTools burned onto a CD, it's rather helpful actually, it can repair(remap) damaged sectors on both Segate/Maxtor drives. (Great way to extend a drives life for a few more years.. instead of tossing it away, as most people tend to do.).
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
jal
Member
Member
Posts: 1385
Joined: Wed Oct 31, 2007 9:09 am

Post by jal »

Erasing a drive is not writing all zeroes per se. If you want to erase it safely (so that no data is left behind), you must write semi-random garbage several times to each sector.


JAL
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Post by Brynet-Inc »

It's a myth that you need to overwrite a sector more then a single time, I've yet to find evidence that data can be restored after that.

Blind faith is blind faith, until I find a document showing proof data can be restored.. one pass will suffice, any more simply means you're paranoid.. ;)
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Post by AJ »

If anyone's still paranoid, have a look at Darik's Boot and Nuke :)

Cheers,
Adam
oscoder
Member
Member
Posts: 59
Joined: Mon Mar 27, 2006 12:00 am
Location: UK

Post by oscoder »

Brynet-Inc wrote:It's a myth that you need to overwrite a sector more then a single time, I've yet to find evidence that data can be restored after that.

Blind faith is blind faith, until I find a document showing proof data can be restored.. one pass will suffice, any more simply means you're paranoid.. ;)
That's shifting the burden of proof! Rather, I should say: you have blind faith in your method of erasing data. Anyhow, IIRC one pass should suffice for most day-to-day usage, since the time and equipment needed (i.e. electron microscope), are beyond the means of an average identity theif! Unless the data is likely to be a target of industrial espionage or law enforcement, there is little point in 'securely' destroying data, unless for hobbyist enjoyment sake.

OScoder
User avatar
Zacariaz
Member
Member
Posts: 1069
Joined: Tue May 22, 2007 2:36 pm
Contact:

Post by Zacariaz »

IMHO it should suffice, whether or not anyone has a electron microscope or not, to do a 3 pass. first writes all zeros, second writes all ones, and third zeros or garbage.
This was supposed to be a cool signature...
Korona
Member
Member
Posts: 1000
Joined: Thu May 17, 2007 1:27 pm
Contact:

Post by Korona »

Wikipedia says that it might be possible to recover data from old hard disks: Gutmann method
It also says that it's unlikely that data can be restored from modern hard disks after the sectors have been overwritten with zeros.
User avatar
suthers
Member
Member
Posts: 672
Joined: Tue Feb 20, 2007 3:00 pm
Location: London UK
Contact:

Post by suthers »

Its possible to get data of a disk thats been erased nulled in two main ways, though these would only be used by law enforcement agencies to recover data of confiscated computers:
1) The head is always slightly inaccurate and its possible with a reader that is much more accurate to read of the 'edge' left which still contains the data.
2) magnetism measurements, the head doesn't completely neutralize the different magnetic polarizations, so there is still a slight difference in polarity between a zero that's been overwritten by a zero and a one thats been overwritten by a zero (and vise versa). Though again this uses equipment out off the reach of the average person...
Jules
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Post by Combuster »

To permanently erase data:

Melt the actual disk. :D

Heat removes magnetism, and melting deforms it into something you can't read anyways.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
User avatar
suthers
Member
Member
Posts: 672
Joined: Tue Feb 20, 2007 3:00 pm
Location: London UK
Contact:

Post by suthers »

Combuster wrote:To permanently erase data:

Melt the actual disk. :D

Heat removes magnetism, and melting deforms it into something you can't read anyways.
hehehehe....

Jules
Post Reply