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.

To speed up my testing, I need to prepare a disk with some files, do some operations on disk (modify files, create new files...), and return back to clean state (before doing operations) quickly. I know about VHD files which can be mounted with "undo support", but I cannot find how to use this in Windows 7.

I wouldn't mind some other options too. My disk will not fit into the memory, so RAM disk is not an option. Booting virtual machines and doing snapshots is not an option too.

I am using Windows 7 (RC).

share|improve this question

3 Answers 3

Backup the VHD, do your 'operations' and then restore the VHD from the backup. Voilá, 'clean state' again.

If you're using your VHD with VirtualBox you can take a snapshot anytime you want.

enter image description here

share|improve this answer
    
:-) It's not so quick with large vhd files though. –  Peter Štibraný Sep 7 '09 at 20:13
    
+1 for simplicity, often underrated. I like Peters own answer better though. –  Henk Sep 7 '09 at 21:07

Mounting a VHD in Windows 7

  • Click on the Orb
  • Right click on My Computer and Select Manage
  • Select Disk Management under Storage
  • Right Click on Disk Management
  • Choose between Create VHD and Attach VHD

Using Windows Virtual PC

In Virtual PC you can use differential disks and there is a complete how to available a t Seven Forums entitled How to Create Differencing Disks in Windows Virtual PC.

share|improve this answer
    
I don't want to install OS there, I just need to mount this virtual disk as separate drive (letter). I'll take a look at VirtPc to see if I can then use created diff disk in win7 or not. Thanks for pointer. –  Peter Štibraný Sep 7 '09 at 20:17
    
Looks like the same is possible using diskpart: cchsu.com/art-en/2009/07/11/128 –  Peter Štibraný Sep 7 '09 at 20:19
    
No need to. Updated my question with the steps to mount a VHD in Windows 7. –  Diago Sep 7 '09 at 20:23
    
It's possible to create differencing disk using diskpart. This option isn't available via Disk Management :-( –  Peter Štibraný Sep 7 '09 at 20:29
up vote 1 down vote accepted

Ok, here is answer based on http://www.cchsu.com/art-en/2009/07/11/128/

diskpart
create vdisk file="d:\temp\diff.vhd" parent="d:\temp\main.vhd"
attach vdisk

At this point, virtual disk "diff.vhd" is attached to the system as new drive. It if differencing disk with "main.vhd" as a parent. When done with testing, I can simply do:

diskpart
detach vdisk
create vdisk file="d:\temp\diff1.vhd" parent="d:\temp\main.vhd"
attach vdisk

And have clean state of "main.vhd" again.

This works in Windows 7.

share|improve this answer

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.