We help IT Professionals succeed at work.

restore boot partition windows 7 after formatting

nobus
nobus asked
on
a client formatted his windows 7 boot partition by accident.
what is the best - FREE - way to restore it?
will a repair from win7 cd  work?
Comment
Watch Question

Tom CieslikIT Engineer
Distinguished Expert 2017

Commented:
You have 3 Methods of repairing:

FIRST
1. Start Windows 7 installation from DVD or bootable USB drive go to repair
 
2. Open a cmd prompt
 
3. Navigate to DVD drive letter
 
4. <dvd letter>:\boot\bootsect.exe /nt60 <vhd system drive letter>: /force
 

5. Reboot your computer, with DVD inside and try again but this time select Boot repair.
Windows should repair your boot partition.


SECOND

1. Start computer from installation DVD/USB, go into the repair mode (recovery console/DOS prompt).
2. Type C: to go to the C (boot) drive of your Windows 7
3. Simply type the following command at the recovery console DOS prompt:
 
bootsect.exe /nt60 all /force
 
4. type EXIT and then reboot the machine.

THIRD

1. Start computer from DVD/USB go to repair / command prompt
2. Run Diskpart
List disk
Select Disk 0
List Partition
- Windows will list all partitions, check number for small partition, this should be your boot partition
Activate 1st partition using Diskpart

Select partition 1
Active

3. Restart computer and start from DVD/USB again go to Repair / command prompt
4. use this commands:

Assign drive letter to Boot (System)Partition
Run Diskpart
Select Disk 0
Select Partition 1
Assign N:
Exit

format N: /FS:FAT32
Now copy boot files to new boot partition

in Command Prompt run commands:

bcdboot C:\windows /l en-us /s N: /f UEFI

bootrec /rebuildbcd
bootrec /fixmbr
bootrec /fixboot

Exit

Now you can boot computer and all should be OK
Top Expert 2013

Author

Commented:
maybe i did not explain very well
originally the deleted boot partition was E:, not C:
does this change much ?
Tom CieslikIT Engineer
Distinguished Expert 2017

Commented:
Because windows enumerated it itself
Boot partition should NOT have any drive letter, should be hidden
GO to step 3
Top Expert 2013

Author

Commented:
Tom, tx for your support, but what do you mean with "Because windows enumerated it itself" ?
>>  Boot partition should NOT have any drive letter, should be hidden  <<  right - but it was not, it even showed in explorer as a separate drive with drive letter ( or should i say volume?)

i have some questions for you :
1- your suggestions above - they restore the bootsector - but not the boot partition - right?
2- is there  anyway to restore the boot partiton you know ?
Tom CieslikIT Engineer
Distinguished Expert 2017

Commented:
Because you've said "Client formatted boot partition" so he did NOT delete it.
Boot partition was only formatted so windows naturally assigned a drive letter to it.

If you'll fallow instruction then all will work OK
Top Expert 2013

Author

Commented:
no it is NOT deleted it is there, but quick formatted and shows with the name New E: (when connected to a working system which has drive C: and DVD drive D: )
The windows partition shows as F:
i have a question for your commands :https://www.experts-exchange.com/questions/29169490/restore-boot-partition-windows-7-after-formatting.html#
in FIRST you say " <vhd system drive letter>:   is that the Boot drive letter  - or the windows drive letter ?
in Second :  "<vhd system drive letter>: ""  - same Q
Tom CieslikIT Engineer
Distinguished Expert 2017

Commented:
Sorry nobus, I have copied this resolution from my previous comment in other topic about restoring boot partition on VHDX drive an I did forget to delete comment about VHD :)
It's just about to copy all files to your boot partition whatever drive letter has now
Top Expert 2013

Author

Commented:
could you post the exact command plse for first ? now you see the partition letter, assuming 200MB partition = D: and  windows partition is C:
sorry to ask, but i want to have it correct
tx for supporting me on this
right now i'm in the command prompt in the BOOT partition of the USB stick
IT Engineer
Distinguished Expert 2017
Commented:
If your Boot partition has drive letter-D

copy boot files to new boot partition

in Command Prompt run commands:

bcdboot C:\windows /l en-us /s D: /f UEFI

bootrec /rebuildbcd
bootrec /fixmbr
bootrec /fixboot

After that run diskpart
select disk 0
remove letter=D:
Exit
this will delete drive letter from boot partition



Reboot computer and check if all is working. It should
Top Expert 2013

Author

Commented:
you posted : "bcdboot C:\windows /l en-us /s D: /f UEFI"  is that for an ENGLISH windows version?  i'm using a Dutch one, sorry
and what is the /s D:/UEFI for?
Tom CieslikIT Engineer
Distinguished Expert 2017

Commented:
OH yes, if you have Dutch version then you have to use your country code, :)
/s <volume letter> Specifies the volume letter of the system partition. In your case D:
/f <firmware type> Specifies the firmware type. Valid values include UEFI, BIOS, and ALL

You can use ALL instead UEFI
Top Expert 2013

Author

Commented:
it looks much like the making of a bootable usb stick  -but i must say i never had to use the /s option - is that really needed?
Tom CieslikIT Engineer
Distinguished Expert 2017

Commented:
No. BCDBOOT looking for active partition so if your D partition is still default/ active you don't have to use it /s option but if you are not sure then you should use it to point to right partition.

In other hand if your D partition is not active you must activate it using let say diskpart
Top Expert 2013

Author

Commented:
i assume this works for all windows 7 versions ?  this is an ULTIMATE
Tom CieslikIT Engineer
Distinguished Expert 2017

Commented:
This works for all Windows 7 and above versions
Top Expert 2013

Author

Commented:
well that was my idea also -but i ask because i used the windows install cd - repair function - startup repair
that seemed to work ok - but after a reboot it said windows not genuine - so i was thinking it recognised another version maybe…this leads to a licence cost...
very strange

FYI - i first made a disk copy to another similar SSD -  to test on, so i still have the Original untouched
Tom CieslikIT Engineer
Distinguished Expert 2017

Commented:
Boot partition repair has nothing to do with Genuine of Windows.
If you got this message it's mean that Windows detected hardware changes (HDD or Motherboard)
Top Expert 2013

Author

Commented:
well it was withthe ssd copy  -  can that be the cause?
Tom CieslikIT Engineer
Distinguished Expert 2017

Commented:
Probably, because Windows is checking Disk ID/Serial

When installing Windows 10, the digital license associates itself with your device's hardware. If you make significant hardware changes on your device, such as replacing your motherboard or Hard Drive, Windows will no longer find a license that matches your device, and you’ll need to reactivate Windows to get it up and running

Reactivate Windows 10 after a hardware change
When you're ready to reactivate, make sure that your device is connected to the internet and then follow the steps for either a digital license or product key.

Show all
If you have a digital license, run the Activation troubleshooter.
If you don't have a digital license, enter your product key.
If you don't have a digital license or product key
If you don't have a product key or digital license, you can purchase a Windows 10 digital license after installation finishes. Follow these steps to make a purchase:

Select the Start  button, then select Settings  > Update & Security  > Activation . Then select Go to Store to go to the Microsoft Store app where you can purchase a Windows 10 digital license.

Source
Top Expert 2013

Author

Commented:
i know it does that for different mobo - but for a different SSD? never had a problem with such a change.
NOte also i'm in Europe, where you can install windows on 2 or 3 different mobo's with 1 licence - eg when the old boar is dead
Tom CieslikIT Engineer
Distinguished Expert 2017

Commented:
nobus,, I came from Europe to, now I'm living in USA.
I had some issue with Windows activation after MOBO replace so I feel your pain. You can try Phone activation and all should be OK.
Your question was about repairing boot partition so Probably we did it.
I think you should close this topic and open new one if you have issue with Windows activation.
Top Expert 2013

Author

Commented:
closing out