Windows 7 Forums

Welcome to Windows 7 Forums. Our forum is dedicated to helping you find support and solutions for any problems regarding your Windows 7 PC be it Dell, HP, Acer, Asus or a custom build. We also provide an extensive Windows 7 tutorial section that covers a wide range of tips and tricks.


Windows 7: Recover data from a diskpart > clean command

24 Jun 2014   #71
Anshad Edavana

Windows 7 Ultimate x64
 
 

Quote:
As told before Windows 7 "diskpart clean" only zero's the MBR (so sector 0 so first 512 bytes only) according to documentation
Actually the documentation says "On master boot record (MBR) disks, only the MBR partitioning information and hidden sector information are overwritten".

If a legacy partition tool like XP installer or other tool creates a partition starting at LBA 63, then LBA 1 to LBA 62 are considered as hidden. The same goes to NT 6.x aligned partitioning - LBA 1 to LBA 2047 will be considered as hidden and DISKPART will wipe those sectors.

@lonewolfs

Don't confused by all of this. Just focus on Jumanji's instructions.


My System SpecsSystem Spec
.
24 Jun 2014   #72
Kaktussoft

Microsoft Community Contributor Award Recipient

Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
 
 

I did find articals about external disk on the web a few days ago. They all told me the starting sector is 63.
In #73 is a definition of hidden sectors.... if that's really the definition.... they were not used at all!! Zero them has no side effects.

If MBR has been zeroed and the "hidden sectors"... all partitions are still intact and easily recoverable. I did let him make mbrsect.txt ... indeed all zero's (except "end of mbr marker" and "windows disk signature"0
My System SpecsSystem Spec
24 Jun 2014   #73
Anshad Edavana

Windows 7 Ultimate x64
 
 

Quote:
If MBR has been zeroed and the "hidden sectors"... all partitions are still intact and easily recoverable. I did let him make mbrsect.txt ... indeed all zero's (except "end of mbr marker" and "windows disk signature"0
That is what also confusing me. "Partition Wizard" or "TestDIsk" is supposed to detect the partition withing a few minutes ( in my tests, less than a minute ). May be the partition was actually started at LBA 63 but for some unknown reason DISKPART decided to wipe the first MB ?.
My System SpecsSystem Spec
.

24 Jun 2014   #74
jumanji

Windows 7 Home Premium 32 bit
 
 

Experiment completed. Data I put on sector 2047 wiped out when I ran the clean Command.So clean command wipes from sector 0 to 2047.

( I had PBR on 2048 as in post#66. 2047 got wiped out and also sector 0.) PBR on 2048 in tact.( I can restore sector 0 from the backup I had taken with bootice. No problem.. This is what I have been advising everyone should back up the important sectors shown on bootice - whether MBR or GPT - and when problems arise,they can simply restore those sectors and bring the drive back into life without any necessity of data recovery. In all my experiments with HDDs I do that.)
My System SpecsSystem Spec
24 Jun 2014   #75
Kaktussoft

Microsoft Community Contributor Award Recipient

Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
 
 

Quote   Quote: Originally Posted by jumanji View Post
Experiment completed. Data I put on sector 2047 wiped out when I ran the clean Command.So clean command wipes from sector 0 to 2047.

( I had PBR on 2048 as in post#66. 2047 got wiped out and also sector 0.) PBR on 2048 in tact.( I can restore sector 0 from the backup I had taken with bootice. No problem.. This is what I have been advising everyone should back up the important sectors shown on bootice - whether MBR or GPT - and when problems arise,they can simply restore those sectors and bring the drive back into life without any necessity of data recovery. In all my experiments with HDDs I do that.)
What if partition start sector is 63 and you do the diskpart clean? It only zeroes sector 0-62 I assume
My System SpecsSystem Spec
24 Jun 2014   #76
jumanji

Windows 7 Home Premium 32 bit
 
 

I have carried out that experiment also subsequently and found that diskpart clean zeros from LBA 0 to LBA 2047 wiping out the NTFS at LBA 63. diskpart clean zeros LBA 0 to LBA 2047

So most probably the OP here lost the drive because of it.Most data will still be there in other sectors from LBA 2048 to the end LBA of the drive. Now the question is how to retrieve the data.

Neither PW nor TestDisk can read the start of the partition at LBA 63 when it is zeroed. When zeroed all data in it is lost.
My System SpecsSystem Spec
24 Jun 2014   #77
Kaktussoft

Microsoft Community Contributor Award Recipient

Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
 
 

Quote   Quote: Originally Posted by jumanji View Post
I have carried out that experiment also subsequently and found that diskpart clean zeros from LBA 0 to LBA 2047 wiping out the NTFS at LBA 63. diskpart clean zeros LBA 0 to LBA 2047

So most probably the OP here lost the drive because of it.Most data will still be there in other sectors from LBA 2048 to the end LBA of the drive. Now the question is how to retrieve the data.

Neither PW nor TestDisk can read the start of the partition at LBA 63 when it is zeroed. When zeroed all data in it is lost.
so the documentation is wrong?


On master boot record (MBR) disks, only the MBR partitioning information and hidden sector information are overwritten. On GUID partition table (GPT) disks, the GPT partitioning information, including the Protective MBR, is overwritten. If the ALL parameter is not used, the first 1MB and the last 1MB of the disk are zeroed.

Where can I find information about "hidden sector information"? I don't understand what is meant with it
My System SpecsSystem Spec
24 Jun 2014   #78
jumanji

Windows 7 Home Premium 32 bit
 
 

You may do the experiment yourself and find out.
My System SpecsSystem Spec
24 Jun 2014   #79
gregrocker

 

Would you want to theorize why Clean command works to overcome about half or more of all installation failures? I assume it's because it wipes boot sector and the partition table, one or both of which interferes with attempts to install Win7.

Likewise on multiple occasions we've had drives which failed to boot that traced to a hard drive where the solution was to wipe the drive with Clean command.
My System SpecsSystem Spec
25 Jun 2014   #80
Kaktussoft

Microsoft Community Contributor Award Recipient

Microsoft Windows 7 Home Premium 64-bits 7601 Multiprocessor Free Service Pack 1
 
 

Quote   Quote: Originally Posted by gregrocker View Post
Would you want to theorize why Clean command works to overcome about half or more of all installation failures? I assume it's because it wipes boot sector and the partition table, one or both of which interferes with attempts to install Win7.

Likewise on multiple occasions we've had drives which failed to boot that traced to a hard drive where the solution was to wipe the drive with Clean command.
After the diskpart->clean command the MBR, so master bootcode and partition table, is zeroed. Both are in sector 0. So "logically" the disk is totally empty. It doesn't have boot code and no partitions at all afterwards.
My System SpecsSystem Spec
Reply

 Recover data from a diskpart > clean command




Thread Tools Search this Thread
Search this Thread:

Advanced Search




Similar help and support threads
Thread Forum
Disk - Clean and Clean All with Diskpart Command
How to "Clean" or "Clean All" a Disk with the Diskpart Command This will show you how to use the clean or clean all command on a selected disk to delete all of it's MBR or GPT partitions, volumes, and any hidden sector information on MBR disks is overwritten. The data on the HDD is not...
Tutorials
Recover Partitions from diskpart -> clean command
Hi Guys, I was trying to install windows 7 on my windows 8 laptop (UEFI) and when it didnt allow me to install win7 on partitioned drive I followed YouTube video foolishly and fired diskpart - clean command. everything gone after that. Luckily I didnt do anything after that and referred one of...
Backup and Restore
DISKPART clean performed accidently. how to recover data?
Hello everyone, I had major partition problems and tried fixmbr,fixboot,etc and even rebuilding bcd was not working. I was misguided by one of the other Forums and entered: DISKPART Select Volume 1 DISKPART Clean Volume 1 The Volume has been cleaned where volume 1 was my C...
General Discussion
diskpart / clean, format by accident , need to recover data
Hello, I know it's stupid but i diskpart/clean and formatted while installing windows from cmd, it's a new laptop so i had no other data just (i don't remember exactly) 100GB not more. i installed windows on that formatted disk. I had all data on D Disk (500GB) and now i have only one disk which...
Backup and Restore
Should I clean my HDD with Parted Magic or Diskpart clean all command?
Hi everyone i have a question about HDD Clean and also question about Win 7 64 bit :) I want to wiped out my all HDD data inside i want to delete all information like a brand new HDD. I heard that there is a program called Parted Magic can do this and also Diskpart clean all command too. ...
General Discussion


Our Sites

Site Links

About Us

Find Us

Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd

All times are GMT -5. The time now is 09:09.

Twitter Facebook Google+



Windows 7 Forums

Seven Forums Android App Seven Forums IOS App