Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I had a 70GB Boot Camp partition on my iMac that I wanted to increase the size of, so after creating a system image (.vhd) on an external FW drive of the Boot Camp partition using Windows Backup and Restore, I removed the Boot Camp partition from within OS X and re-created one that is now 140GB.

When I go to restore the system image using the Windows 7 installation disc or the repair disc, it says that when restoring the image, the entire [physical?] disk is going to be erased and formatted so that the image can be restored to it. (I don't see any options to choose just a partition!)

I've considered that there may be a command line utility on the Windows 7 install disc to restore the VHD to the partition, but can't find any documentation for such. Is there a cost-free way to just restore the system image backup to the new partition while preserving the OSX partition?


EDIT:

Basically what I am saying is that when installing Windows 7, there is an option to install to a specific partition on the physical disk, but when restoring, I do not see that option...


UPDATE: (bounty)

I am still looking for a way to restore a VHD image to an NTFS formatted partition on a hard drive. Specifically a boot camp partition on a Mac.

I really don't understand why Windows won't allow this, although it allows installing to a partition...

share|improve this question
1  
A little late since you erased your Boot Camp partition, but an easier way would have been to use either CampTune or iPartition. –  fideli Sep 1 '10 at 20:10
    
I've experimented quite a bit with Windows Restore and I have not been able to come up with a way to preserve the target disk partitions. Restoring a system image will replace everything. –  Pierre Arnaud Jun 14 '11 at 12:43
1  
I'm thinking it might be possible to boot from an Ubuntu Live CD and just restore the contents of the VHD to a newly-formatted NTFS partition and boot from it? Does Ubuntu now support NTFS and VHD images? –  pattern86 Jul 30 '11 at 7:53
add comment

9 Answers

I would suggest to first install Windows 7 on the new partition as a new installation.

Then, within Windows 7, Restore your computer from a system image backup using Control Panel -> Recovery -> Advanced recovery methods -> Use a system image you created earlier to recover your computer, and then follow the steps.

If worse comes to worst, you can always mount the .vhd in Disk Management to retrieve your data.

EDIT

I have found new info from this article using Acronis True Image Home 2011 (trial version available):
Restoring Windows 7 VHD Backup Files with Acronis True Image Home 2010.

The article says:

Windows 7 has a special System Reserved Partition, which is hidden and contains boot files. This partition can be viewed in Windows Disk Management (Start-Run -> diskmgmnt.msc).

When making an image of your Windows system using the Windows 7 Backup tool, it will create a separate .vhd file for each partition that is in the system, including the System Reserved Partition.

If you choose to restore your system partition from the created Windows 7 Backup .vhd files, you will need to restore the whole disk where this system partition is.

Solution

  1. Boot from Acronis Bootable Media and select Acronis True Image Home (Full version)
  2. Click Recovery, browse to your Windows 7 Backup .vhd files and select any of the files
  3. Once selected, right-click on the .vhd file and select Recover
  4. Select Recover whole disks and partitions and click Next
  5. Check the partition to recover
    image1

This approach has failed if you are warned that all data on the destination disk will be erased:
image2

share|improve this answer
    
That article just ultimately brings me to the same screen I described in my message, but it is being read from the installed OS instead of a disc... –  pattern86 Sep 4 '10 at 9:46
    
@pattern86: You can see the entire disk, but can't you choose the Windows partition? Might be a good idea to post a screenshot of this screen, now that you're in Windows. –  harrymc Sep 4 '10 at 12:31
    
I don't know of a way to take a screenshot at that point after rebooting, but I found some images that show what I was seeing. I follow this process: sevenforums.com/tutorials/675-system-image-recovery.html and am never given the option of where I would like to restore the image. Compare to the images of the installation process here: techtalkz.com/windows-7/… Take note of the step entitled "Where do you want to install Windows?" I am trying to select a partition when restoring, but am given no such choice. –  pattern86 Sep 4 '10 at 16:19
    
@pattern86: See my edit for another maybe solution. –  harrymc Sep 4 '10 at 16:25
    
Can I do this with the trial version? I don't want to spend any money. I would rather re-install everything from scratch than spend more money. –  pattern86 Sep 4 '10 at 17:03
show 3 more comments

Your Mac OS X system should be intact. Windows 7 "see" just bootcamp partition as HDD. Is there size of hard drive? to help you figure out?

usually bootcamp partition looks like last with BOOTCAMP name on it. If your restore will be unsuccessful, Install fresh copy of windows 7 to partition what you created. try to use virtualbox (virtualbox.org) or this method to access your files: http://www.gilsmethod.com/how-to-mount-vhd-files-without-virtual-pc

Next time use winclone free software to change win bootcamp partition Or Paragon (trial or buy)

share|improve this answer
1  
The Windows 7 install disc reports the full hard drive size, not just the NTFS partition. My goal is to restore the vhd image so I don't have to do any setup/tweaking of apps after restore. –  pattern86 Sep 4 '10 at 2:38
add comment

This is not the most direct approach, and would be inconvenient, but would probably be the safest.

I would recommend that you restore the VHD to a different computer hard drive - either an external drive, a spare one you may have lying around, a different computer if you have one you don't care about — anywhere you can. Then, use a different imaging suite (with the capability to restore to a particular partition) to create an image of that, then using that, restore to your original machine.

share|improve this answer
    
Would all of my boot-related files be in tact? I'm not super-savvy when it comes to low-level system architecture. –  pattern86 Sep 5 '10 at 0:41
    
That depends. I can't specifically say for a Mac using Bootcamp, since I'm not particularly familiar with that platform. Since Bootcamp handles deciding which OS to boot into, I would assume that it would still work, but unfortunately I can't promise you anything. Perhaps somebody here with more experience using Bootcamp can comment on that possibility. –  nhinkle Sep 5 '10 at 1:12
    
Thanks--I hope someone does know. The Boot Camp thing is a major part because of my setup. –  pattern86 Sep 6 '10 at 4:32
add comment

A simple solution would be to convert the vhd disk to a raw disk file, (which would take up 70gb) then 'dd' it to the given partition. qemu-img, which is part of QEMU, can handle the conversion. (You would obviously have to install qemu on the osx side)

qemu-img convert -f vhd -O raw YourW7Disk.vhd OutputDiskImage.raw

This would, as it is a raw disk image, require 70gb of space. You would then, after creating the raw disk file:

dd if=OutputDiskImage.raw of=/dev/disk0s2

Replacing disk0s2 with the path to the partition device node. You can find the partition device node name in Disk Utility.

Obviously, these commands would have to be run on the OSX side. This is all assuming that the VHD disk is an image of just the W7 partition, and has the bootsector/etc intact.

This, of the solutions I have seen, is the easiest. It can be done in the already installed system, with minimal effort and time. The only thing you would have to install is qemu (which provides qemu-image iirc), which you can get through macports/brew/fink.

share|improve this answer
    
For everyone who wants to follow this solution, in this page there is a working guide on how to install QEMU on OSX ;) –  VitoShadow Nov 9 '13 at 11:26
add comment

Here is how I think one can restore the vhd to a physical partition, into a partition of 140 GB. I assume that the vhd is on an external disk drive. You will need a partition manager tool with a bootable CD. A free one is MiniTool Partition Wizard Bootable CD.

  1. Re-partition the 140 GB partition into 2 partitions of 70 GB and format them as NTFS. You can either format as FAT32 by using OS X "Disk Utility" in /Applications/Utilties to format as "MS-DOS File System". Or (preferred) you can use the MiniTool bootable CD to do both the partitioning and format directly in NTFS. Be careful not to destroy any other Mac partition and ensure that the first partition is exactly the same size as when it was backed-up to the vhd. The two partitions should now be visible to the Windows 7 boot installation DVD.
  2. Install Windows 7 into the first partition. If possible, create the partition in NTFS format. Else, Convert a FAT or FAT32 Volume to NTFS in Windows 7 after the installation.
  3. Try to use the backup utility to restore the vhd. If successful, use the Windows Disk Manager to erase the second 70 GB partition and resize the first (system) partition to include the second. If restoring the vhd has failed, continue to the next step.
  4. If required, in Windows 7 format the second drive as NTFS if it is not already in NTFS and assign it a drive letter.
  5. In Disk Management, Mount a VHD Within Windows 7 as a virtual disk.
  6. Use Control Panel / Folder Options / View tab, set "Show hidden files and folders" and unset "Hide protected operating system files" and press OK.
  7. Copy all files from the vhd virtual disk to the second partition.
  8. Use MiniTool to erase the first partition and move the second one in its place.
  9. Try to boot into Windows. If unsuccessful, try to Do a Repair Install to Fix Windows 7.
  10. If successful, use the Windows Disk Manager to resize the system partition to include the unused space left when you moved the second partition.

There is of course no way that I can test if my above advice will really work, but let me know if you have any difficulties.

share|improve this answer
    
You're right. I have updated the question to address that I am still looking for a way to restore a VHD image to an NTFS-formatted partition on a hard drive. Specifically a boot camp partition on a Mac. –  pattern86 Jun 11 '11 at 5:40
    
I have written a possible solution above. –  harrymc Jun 11 '11 at 15:35
add comment

You could try to convert the VHD to a WIM file and use ImageX to apply the WIM to the new partition. I haven't tried this but it is an option to explore.

This will require the The Windows® Automated Installation Kit (AIK) for Windows® 7

Mount the VHD (as read only) in your host system:
- diskmgmt.msc
- Action > Attach VHD
- check Read-Only
- select the VHD. Let us assume that it has the letter D: assigned.

Then use imagex to create the WIM:

imagex /compress fast /flags “Ultimate” /check /capture D: C:\image.wim “Windows 7 Ultimate”

Afterwards boot from a Windows PE disk and apply the image with the following command:

imagex /apply d:\image.wim 1 c:\ /verify

Microsoft ImageX reference

share|improve this answer
    
Can I mount a VHD easily on a Mac? –  pattern86 Jun 15 '11 at 16:34
    
add comment

I happened to have an old Mac that didn't have anything on it, so losing Mac OS wasn't an issue for me with that particular machine. For that reason, I tried restoring from an image directly from the Windows 7 Ultimate CD, and not only did the restore succeed, but the warning was inaccurate, I didn't lose anything! If you are reading this, go ahead and try it... the worst that can happen is that you do lose Mac OS, but that is what Time Machine is for, right?

EDIT: I did this process again on my primary Mac. Oddly enough, the Macintosh HD partition was reformatted to FAT32, but the installation remained. Both Windows 7 and Lion worked independently, and I could view Mac from Windows, but not Windows from Mac. The Bootcamp partition wouldn't mount in Disk Utility, either.

The problem, however, is that since Macintosh HD became FAT32, the boot camp assistant gave an error saying that the startup disk is not supported. Fortunately, I made backups of both Mac and Windows, but I will have to restore everything and lose the last week of changes to my Windows installation. Not terrible (for me), but I would like to advise against trying my solution.

share|improve this answer
    
I am going to try this when I have the time to re-image my Mac if something goes awry. I didn't want to do this simply because of the headache if it did go wrong, but I'm at the point where it's worth a try. –  pattern86 Jul 29 '11 at 17:28
1  
Check my update, and DEFINITELY run Time Machine first. –  techie91 Jul 29 '11 at 22:06
    
I did run TM first, and tried it myself before you updated the post. It simply failed for me. I re-partitioned my iMac as a single HFS+ partition and re-installed Lion / restored from the TM backup. Am now waiting for another answer. –  pattern86 Jul 30 '11 at 7:43
add comment

Step 2 Point 7 from here: http://www.sevenforums.com/tutorials/675-system-image-recovery.html

Format and repartition disks box: NOTE: Special thanks to MJF for this addition. 1) Grayed out and selected You are forced to have the whole disk formatted and repartitioned to match the partition structure of the disk the image was made from. This can occur when restoring an image to a new disk or the original disk with a modified partition structure. Data on other partitions on the disk you are restoring to will be lost.

2) Grayed out and unselected You are not given the option to format and repartition the disk. This will occur if you are restoring Windows from a partition on the same disk.

3) Not grayed out and unselected Here you have the option to select format the whole disk and repartition or not. In this case the disk the image was taken from has a matching partition structure to the disk you are restoring the image to. By not selecting the format and repartition option your image will be restored and other partitions untouched such as valuable data partitions.

in short, you (and me) are screwed =/

share|improve this answer
    
Thanks for the note. –  pattern86 Jan 14 '13 at 16:10
add comment

I just did a downgrade from Lion to Snow Leopard with a Bootcamp installation, and restored the bootcamp partition with the default Windows 8 system image backup tool (It's the same as Windows 7)

When restoring from the VHD image, yes it will say that the entire disk will be formatted but in reality it will only write to the bootcamp partition and leave the mac osx partition untouched (and for me the partition still stayed as Mac OSX Extended)

Just make sure to setup a Bootcamp partition within Mac OSX before restoring

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.