How to create bootable recovery partition to restore windows 7 partition as it is now
Solution 1:
For all kind of operations on partitions etc. imho PartedMagic is the best. How to use it to do what you want -> Check this link: http://faizalsalih.blogspot.com/p/creating-hidden-recovery-partition.html
Solution 2:
I've been working on how to create custom recovery partition and here's what I came up with, it's not "perfect" or "pretty", but it gets job done. I only tested this so far on one laptop with BIOS & MBR partition scheme, so I can't say it will work with UEFI & GPT.
- If you only have one normal partition (by "normal" I mean not that 100MB one) I strongly suggest shrinking your system partition to 30-40GB (depends what software you have installed), then create another partition where you will move all user folders (Documents, Desktop, Music, etc), then at the end another partition for recovery (about 6-10GB will be fine). If you already had two partitions (or more) then just shrink your last one by 6-10GB and create new partition there. Format it as NTFS & name it Recovery.
- Insert your Windows 7 install media and copy all files from it to that recovery partition.
-
(I didn't test if this is required but I did it anyway) Close any explorer windows that you have open with Recovery partition, then run cmd as admin and then enter this:
X:\boot\bootsect /nt60 Y:
, replace X with your Windows 7 install media and Y with your recovery partition. - Download EasyBCD (Non-commercial edition, it's free), install & run it, click "Add new Entry" -> "WinPE", in "Name" enter "Recovery", in "Path" select
Y:\sources\boot.wim
, replace Y with your recovery partition, then click "Add entry" - Restart your PC and test if it's working, it should show up in boot menu, just run it to see if it will boot up. After this, restart pc into Windows
- In Disk management right click on recovery partition and select "Change drive letter", then just remove that letter. That way you will "hide" it.
- In System properties go to Advanced, click settings in "Startup and recovery" then change how long will that boot menu screen show, I set it to 1 second.
- Now you need to create image of system partition and replace it on recovery media. With windows 7 you can use ImageX or DISM from Windows 8/8.1 (or newer). I don't use ImageX so I can't help you with that. I use Windows 8.1 install media to do that. You can alternatively create WinPE media, read about it here. Of course you can create it on your PC. After you're done, boot it on that laptop.
- After it booted up, run
cmd
. I don't know how it will be on WinPE, but on Windows 8/8.1 install media you can press Shift+F10 - In cmd, run
diskpart
, thenlist volume
. Take a note what drive letters are your system partition and recovery partition, if you followed my example with partitions, then System partition should be D and Recovery should be F. I will use those for example. - run this command to remove original install.wim
del F:\sources\install.wim
- Now the most important part, run this command to create new install.wim from your system drive
Dism /Capture-Image /ImageFile:F:\sources\install.wim /CaptureDir:D:\ /Name:"Windows 7" /Compress:max /CheckIntegrity /Verify
And that's it :)