LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Hardware
User Name
Password
Linux - Hardware This forum is for Hardware issues.
Having trouble installing a piece of hardware? Want to know if that peripheral is compatible with Linux?

Notices

Reply
 
Search this Thread
Old 10-26-2007, 02:41 AM   #1
almon
Member
 
Registered: May 2007
Location: india
Distribution: ubuntu7
Posts: 73

Rep: Reputation: 15
formating Hard disk


I am planning to complete format my hard disk.as my windows is filled with lots of viruses,spyware ,trojans so i dont want to format it.Instead i want to zero fill it.

is there any command to do so??
 
Old 10-26-2007, 04:05 AM   #2
DiBosco
Member
 
Registered: Nov 2001
Location: Manchester, UK
Distribution: Mandriva, Mandriva, Mandriva. (Three different releases depending on the computer)
Posts: 710

Rep: Reputation: 35
I think this is a non-Linux issue and that you have to find a manufacturer specific program to do this. Have a Google search for your drive (manufacturer) and "zero fill" or "low level format". When I did that in the past I had to run a proprietary program from a floppy!
 
Old 10-26-2007, 04:20 AM   #3
almon
Member
 
Registered: May 2007
Location: india
Distribution: ubuntu7
Posts: 73

Original Poster
Rep: Reputation: 15
hmmm......but what dd commands does????
 
Old 10-26-2007, 04:25 AM   #4
DiBosco
Member
 
Registered: Nov 2001
Location: Manchester, UK
Distribution: Mandriva, Mandriva, Mandriva. (Three different releases depending on the computer)
Posts: 710

Rep: Reputation: 35
man dd

should give you an idea.

Last edited by DiBosco; 10-27-2007 at 03:08 AM.
 
Old 10-26-2007, 05:47 AM   #5
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
dd can be used to fill the drive with zeros or random numbers. It would have to be run from a different drive, live CD, etc.

If your disk (as seen from the livecd) is /dev/hda:

dd if=/dev/zero of=/dev/hda
dd if=/dev/urandom of=/dev/hda

Takes several hours for an 80GB drive--maybe faster if you specify a larger block size (eg bs=4096) I've never really tested this.

You can also use something like dban
 
Old 10-26-2007, 07:57 AM   #6
almon
Member
 
Registered: May 2007
Location: india
Distribution: ubuntu7
Posts: 73

Original Poster
Rep: Reputation: 15
basically I wanted to do zero fill becoz some virus are very strong and they are not removed even by full format.
do dd command will do??

also pls tell me is data recovery possible even after i issue dd command to my hard disk??
 
Old 10-26-2007, 11:07 AM   #7
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
Quote:
Originally Posted by almon View Post
basically I wanted to do zero fill becoz some virus are very strong and they are not removed even by full format.
do dd command will do??

also pls tell me is data recovery possible even after i issue dd command to my hard disk??
Yes, dd will do this---did you read my other post?

If you do one pass with dd or similar, data is not recoverable by any normal means. Apparently, there is a small residual which might allow some recovery---this is why the secure "wipe" routines do multiple passes.

To just kill the viruses, one pass with either zeros or random will be fine.
 
Old 10-26-2007, 11:20 AM   #8
jiml8
Senior Member
 
Registered: Sep 2003
Posts: 3,171

Rep: Reputation: 114Reputation: 114
dd is actually quite fast if you use a large enough block size. I routinely write a zero-filled file to my various partitions to fill them, thus zeroing out any unused blocks (which might contain data from previous writes/deletes), and I can fill 10 gigs in about a minute.

I just write the file until dd bombs because the hd is full, then I delete the file.
 
Old 10-26-2007, 12:35 PM   #9
MQMan
Member
 
Registered: Jan 2004
Location: Los Angeles
Distribution: Slack64 13.37
Posts: 536

Rep: Reputation: 36
Quote:
Originally Posted by almon View Post
basically I wanted to do zero fill becoz some virus are very strong and they are not removed even by full format.
Just a "quick" format of the drive, followed by a reinstall will "kill" them. Even if the virus code is still on the disk, it isn't going to be able to run.

Cheers.
 
Old 10-26-2007, 01:04 PM   #10
almon
Member
 
Registered: May 2007
Location: india
Distribution: ubuntu7
Posts: 73

Original Poster
Rep: Reputation: 15
k....than
so i will use the dd command to format my disk.....also tell me is gparted gui version of dd command??
 
Old 10-26-2007, 01:24 PM   #11
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
dd does not do formatting--it only reads and writes raw bytes.

GParted is a partitioning tool--it will not create file systems, nor will it do anything that dd does.

At least in the Windows world, "Formatting" commonly means to partition and set up the filesystem.


Starting with a disk drive with no data on it (eg all zeros written by dd):

The partitioning tool writes a partition table in the MBR which simply gives the addresses of the partitions. If there is an extended partition + logical partitions, then additional partition tables are created in the first sector of some partitions.

A filesystem is created with a utility (eg mkfs) that writes filesystem information to a specific partition. Only then can you read and write data with normal commands.

a utility such as dd reads and writes data regardless of partitioning, filesystems, or anything else.
 
Old 10-26-2007, 11:07 PM   #12
almon
Member
 
Registered: May 2007
Location: india
Distribution: ubuntu7
Posts: 73

Original Poster
Rep: Reputation: 15
....next post.......

Last edited by almon; 10-26-2007 at 11:34 PM.
 
Old 10-26-2007, 11:32 PM   #13
almon
Member
 
Registered: May 2007
Location: india
Distribution: ubuntu7
Posts: 73

Original Poster
Rep: Reputation: 15
Basically I just wanted to format my pc.I tell u my requirement:
1.It should erase data permanently so that its impossible to recover data back
2.My pc was infected with viruses.I doubt that it may contain some boot viruses.I want to remove them completely.
do the command dd do what we call "zero fill" in hard disk manufactures langauge.or i have to go to them in order to zero fill it??


So whats the solution of that.....one more thing...gparted also contained the options of formating the hard disk in any format...ie ext3 ntfs etc...so according to gparted its more than a partitioner
thanx in advance
 
Old 10-27-2007, 05:01 AM   #14
almon
Member
 
Registered: May 2007
Location: india
Distribution: ubuntu7
Posts: 73

Original Poster
Rep: Reputation: 15
Angry

hmmm...no reply
 
Old 10-27-2007, 06:24 AM   #15
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Arch/XFCE
Posts: 17,802

Rep: Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728Reputation: 728
See post #5

dd does "zero fill"---that's what you get with /dev/zero

If you need secure erase, you can do multiple passes with dd and urandom or you can use something like DBAN
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Hard drives, formating help K-Hole Linux - Hardware 1 09-08-2005 04:29 PM
formating a disk onionkn1ght Linux - Software 2 10-14-2004 10:31 AM
Formating hard drive? jnassiri Linux - Newbie 5 08-04-2004 12:11 AM
Formating Hard Drive Zakane Linux - Newbie 20 08-25-2003 12:13 PM
Formating 2 hard drive Tenchi147 Linux - Hardware 1 05-31-2003 05:01 PM


All times are GMT -5. The time now is 04:29 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration