Wiping a HD

Muse

Lifer
Jul 11, 2001
38,980
9,027
136
I probably don't but might have a rootkit and/or other malware on my laptop's HD. It's currently partitioned into OS and Data drives, with about 32GB data on the data partition, the rest (over 400GB free). I'll likely copy off the data to a USB HD for restoration later.

To make sure the drive is clean, I figure I'll boot from my DBAN CD I made around a year ago. Is this sensible enough before I do another fresh install of Win7 Ultimate 64 bit?
 

razel

Platinum Member
May 14, 2002
2,337
90
101
DBAN is overkill. I wouldn't even touch DBAN especially if your HDD's drive manufacturer already has a zero-ing utility.

After you have cleaned up and backed up your stuff all you'll need to do is clear the boot sector and partition table. During your Win7 install, when you get to the 'choose disk' screen press CTRL-F10 (or F11, I forgot) to get to a command prompt. then run diskpart. Do: list disk, choose disk # (where # is your disk), list disk (double check you got the right one), then clean.

Clean will zero the beginning and end of the disk. Exit command prompt, refresh the 'choose disk' screen, then continue with the Win7 install. Have fun.
 

Muse

Lifer
Jul 11, 2001
38,980
9,027
136
DBAN is overkill. I wouldn't even touch DBAN especially if your HDD's drive manufacturer already has a zero-ing utility.
I am not seeing a formatting or zero-ing utility for this Samsung HM640JJ HD. Evidently they're with Seagate now, don't see such a utility. Just Seatools, really.

Maybe I'll just trust Windows 7 install disk to adequately clear things out. Or, I could run DBAN first, why not?
 
Last edited:

Coup27

Platinum Member
Jul 17, 2010
2,140
3
81
What razel suggested is perfectly fine for cleaning a disk and starting again. All you are going to do beyond that is write crap over every sector which is only useful from a security / data recovery perspective.

Also I don't agree with removing or bypassing the reserved partitions Windows makes. It clearly makes them for a reason and while you can navigate around them I don't see the point.
 

Muse

Lifer
Jul 11, 2001
38,980
9,027
136
What razel suggested is perfectly fine for cleaning a disk and starting again. All you are going to do beyond that is write crap over every sector which is only useful from a security / data recovery perspective.

Also I don't agree with removing or bypassing the reserved partitions Windows makes. It clearly makes them for a reason and while you can navigate around them I don't see the point.
I figure it's there for a reason but read the linked page. There are a great many reasons explained there for not having the hidden 200MB partition. A lot of things can go wrong when utilizing that. I don't currently have it.

Then again, one of the comments further down that page says this:

WhitePaw Rolls September 12, 2011 at 12:02 pm

Ok for those wanting to do without this partition I have discovered a few more facts you might want to think about. the new sp1 will NOT install without it. The genuine advantage thingy don't like it not being there, and without those 2 you can't use xp mode. I found this out the hard way after doing the install without the partition, and had to reinstall WITH it to use those things.
- - -
Perhaps I'll just do the default installation. I can't remember my reasoning for wanting not to have that, it's been around a year and a half.
 
Last edited:

billyb0b

Golden Member
Nov 8, 2009
1,270
5
81
DBAN on a single pass is sufficient as well for what you're looking to do. It is overkill but it will wipe everything.
 

Coup27

Platinum Member
Jul 17, 2010
2,140
3
81
The 100MB or 200MB system partition does a lot more than I think people know about. Most people say it's purely for bitlocker, however the installer will put the boot files there as well. This does make life a lot easier when dealing with multi-booting OS's from the same disk as the boot files are not contained on an actual OS partition.

Also when installing in UEFI/GPT mode Windows makes an EFI partition, MSR reserved and the data partition. I believe the boot files go into the EFI partition and I'm not sure what MS do with the MSR partition but it doesn't actually have a file system and is left as RAW.
 

iluvdeal

Golden Member
Nov 22, 1999
1,975
0
76
I figure it's there for a reason but read the linked page. There are a great many reasons explained there for not having the hidden 200MB partition. A lot of things can go wrong when utilizing that. I don't currently have it.

Then again, one of the comments further down that page says this:

WhitePaw Rolls September 12, 2011 at 12:02 pm

Ok for those wanting to do without this partition I have discovered a few more facts you might want to think about. the new sp1 will NOT install without it. The genuine advantage thingy don't like it not being there, and without those 2 you can't use xp mode. I found this out the hard way after doing the install without the partition, and had to reinstall WITH it to use those things.
- - -
Perhaps I'll just do the default installation. I can't remember my reasoning for wanting not to have that, it's been around a year and a half.

I disabled the 200MB partition for my Win 7 Pro and never had any issues at all with windows updates/service packs and can run the XP mode just fine.
 

murphyc

Senior member
Apr 7, 2012
235
0
0
ATA Secure Erase.
http://mackonsti.wordpress.com/2011/11/22/ssd-secure-erase-ata-command

If I were giving the disk away, maybe I'd consider Enhanced Secure Erase. *shrug* But for what you're doing it's a.) faster than writing zeros through the interface, since this is the drive firmware doing it and b.) it will blow away data in sectors removed from use that have no LBA, and thus an application based erase can't even address to zero.

But it's a good idea, actually, to wipe a disk periodically. Only during a persistent failed write to a sector will the disk firmware remove the sector from use. And bad sectors are common.
 

Muse

Lifer
Jul 11, 2001
38,980
9,027
136
DBAN is overkill. I wouldn't even touch DBAN especially if your HDD's drive manufacturer already has a zero-ing utility.

After you have cleaned up and backed up your stuff all you'll need to do is clear the boot sector and partition table. During your Win7 install, when you get to the 'choose disk' screen press CTRL-F10 (or F11, I forgot) to get to a command prompt. then run diskpart. Do: list disk, choose disk # (where # is your disk), list disk (double check you got the right one), then clean.

Clean will zero the beginning and end of the disk. Exit command prompt, refresh the 'choose disk' screen, then continue with the Win7 install. Have fun.
It's Shift+F10 to get the command prompt. Then diskpart, then list disk. Then you have to enter select disk # (where # is your disk). I'd already deleted the partitions and restarted from the Windows disk, couldn't tell what was going on. So now I have just one disk, 0. After entering select disk 0, it said "Disk 0 is now the selected disk." You can enter Help clean to get instructions. I entered CLEAN ALL, WTH. It's just sitting there after that the machine is unresponsive after about 10 minutes (I can scroll up and down the command window using the mouse, keystrokes are ignored), don't know if it's doing anything. Well, if I'm less than certain, I can run DBAN afterward, then install Windows. DBAN is for me kind of confusing, which options to go with, there are several. I could run it automatic, I suppose that would be fine, but don't know for sure.
 
Last edited:

exdeath

Lifer
Jan 29, 2004
13,679
10
81
Light it on fire, throw it in a 2000 horsepower industrial shredder... twice. Sell the scap metal, and put it torwards an SSD :p
 

Muse

Lifer
Jul 11, 2001
38,980
9,027
136
Light it on fire, throw it in a 2000 horsepower industrial shredder... twice. Sell the scap metal, and put it torwards an SSD :p
I need around 4 SSD's. TBH, I'm not sure I've ever been within 100 yards of one, but how would I know? I'm sick and tired of waiting on Windows.

Well, here I am, having given the command "clean all" 3 times now and each time the window just sits there interminably. Maybe if I wait a day or two it will say "disk cleaned" but I have the feeling it will sit there just like it is until Christmas. The only things I can do is scroll the window, resize it, or go shift+F10 again and get another command window and go through the whole rigamarole again. I did enter "clean" one time and it said it had cleaned that stuff, but it's just the first and last MB of the disk, evidently. I don't know for sure that that's adequate. Absent further assurances from Windows or someone here, I am going to run DBAN.
 

exdeath

Lifer
Jan 29, 2004
13,679
10
81
You are doing sector by sector writes with a mechanical storage device. Basically wiping terrabytes of space at 100s of kilobytes per second. It's going to take a while...

A multi pass secure wipe like a DoD 3 pass overwrite could take 10s of hours.
 

murphyc

Senior member
Apr 7, 2012
235
0
0
Well, here I am, having given the command "clean all" 3 times now and each time the window just sits there interminably

~432GB drive based on your first post. That's roughly 2 hours to erase with zeros. It's probably more like 30-50 minutes if you used the ATA Secure Erase feature in the disk's firmware. So yes, the behavior you're reporting is normal.
 

murphyc

Senior member
Apr 7, 2012
235
0
0
You are doing sector by sector writes with a mechanical storage device. Basically wiping terrabytes of space at 100s of kilobytes per second. It's going to take a while...

Fair point that if it's actually doing it in block sizes of 512 bytes, rather than in blocks of 4K or larger, it could take 6+ hours.
 

Muse

Lifer
Jul 11, 2001
38,980
9,027
136
~432GB drive based on your first post. That's roughly 2 hours to erase with zeros. It's probably more like 30-50 minutes if you used the ATA Secure Erase feature in the disk's firmware. So yes, the behavior you're reporting is normal.
Ah, I didn't see anything about ATA Secure Erase in the link you had there, looked down that long list of DISKPART commands.

The drive (Samsung HM640jj), is ~640GB, less usable, of course (diskpart reports the partition is 596 GB). the DISKPART> clean all command leaves something to be desired. It could flash a little message, "cleaning" or something, or a progress bar would be so nice. Just a blinking cursor had me concerned. I actually started another diskpart window and issued the command again. There may even be two going on, argh! Well, I'll wait and check the machine in an hour, then every 1/2 hour at least waiting for a "succeeded" message, I'm told that will appear at the end. I just registered at http://www.sevenforums.com, there's a whole thread there on clean and clean all DISKPART issues: How to "Clean" or "Clean All" a Disk with the Diskpart Command
 
Last edited:

murphyc

Senior member
Apr 7, 2012
235
0
0
Ah, I didn't see anything about ATA Secure Erase in the link you had there, looked down that long list of DISKPART commands.

2nd attempt
ATA Secure Erase
http://mackonsti.wordpress.com/2011/11/22/ssd-secure-erase-ata-command


The drive (Samsung HM640jj, diskpart reports the partition is 596 GB) is ~640GB, less usable, of course.

Disks have highly variable performance depending on how many simultaneous sectors they're addressing. Using dd on linux, a block size of 1MB vs the default of 512 bytes is quite significant. 2MB/s vs 110MB/s for my internal Caviar Black laptop drive. So it's hard to estimate how long it's going to take in your case, I have no idea how diskpart is accessing the disk. But hours is to be expected.

There may even be two going on, argh!

That will slow it down by 1/2. Unless it's over the half way point, which you have no way of knowing most likely, it's worth aborting and starting over. I personally would download a LiveCD, make a boot stick, and use hdparm off linux to access the Secure Erase command.
 

murphyc

Senior member
Apr 7, 2012
235
0
0
Just in case it's confusing, yes the article is predicated on SSD, but the ATA Secure Erase command has existed in (P/S)ATA disks since ~2000. So your disk can do it.

The pisser is that many/most USB bridge chipsets suck donkey balls, and don't pass through either ATA Secure Erase or SMART commands. So except for casual use (convenience), I do not consider USB (or Firewire for the same reason) to be used for storing data I actually care about losing without notice—because of course, there's no way to monitor the disk for impending doom even if you were willing to go to the effort of regularly SMART monitoring the drive.
 

Muse

Lifer
Jul 11, 2001
38,980
9,027
136
I'm just going to wait it out. I just don't remember the sequence of events. There could be one, maybe two DISKPART procedures running. I'll wait. Probably by morning it will be complete, I think just as likely within the next 3-4 hours... or maybe less.

People said here that DBAN would be overkill, well if my reading of online info is correct, what I'm doing is quite a bit more thorough than DBAN. It's OK, I'm not hurting. I have several other machines here.
 
Last edited:

Muse

Lifer
Jul 11, 2001
38,980
9,027
136
What razel suggested is perfectly fine for cleaning a disk and starting again. All you are going to do beyond that is write crap over every sector which is only useful from a security / data recovery perspective.

Also I don't agree with removing or bypassing the reserved partitions Windows makes. It clearly makes them for a reason and while you can navigate around them I don't see the point.
I've decided to go with the default Windows 7 configuration this time. Of course, I'll have my data partition, however. I used Windows 7 without the 200MB hidden boot partition for almost a year and a half, encountered a variety of difficulties. Maybe I'll have less difficulties having it their way.
 

razel

Platinum Member
May 14, 2002
2,337
90
101
I'm lost, but you do not need to do 'clean all.' Clean all deletes the entire drive. You just needed to do 'clean', which is the beginning and end of the disk. it's also very important that you double check that you chose the right disk.

Yes, there is an easy way to get around Win7 creating two partitions by default. After you have deleted all partitions. On the choose disk screen, allow windows to create the two partitions and you will see it on that screen. Delete the 2nd partition, then extend the 1st to cover the entire disk.

However, from the sound of things. You're done. :)