Virtual disk with "undo support" for testing?

0

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).

Peter Štibraný

Posted 2009-09-07T20:01:57.700

Reputation: 1 281

Answers

2

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.

Peter Štibraný

Posted 2009-09-07T20:01:57.700

Reputation: 1 281

2

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.

BinaryMisfit

Posted 2009-09-07T20:01:57.700

Reputation: 19 955

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ý – 2009-09-07T20:17:01.443

Looks like the same is possible using diskpart: http://www.cchsu.com/art-en/2009/07/11/128/

– Peter Štibraný – 2009-09-07T20:19:39.690

No need to. Updated my question with the steps to mount a VHD in Windows 7. – BinaryMisfit – 2009-09-07T20:23:13.833

It's possible to create differencing disk using diskpart. This option isn't available via Disk Management :-( – Peter Štibraný – 2009-09-07T20:29:41.217

1

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

Molly7244

Posted 2009-09-07T20:01:57.700

Reputation:

:-) It's not so quick with large vhd files though. – Peter Štibraný – 2009-09-07T20:13:23.447

+1 for simplicity, often underrated. I like Peters own answer better though. – Henk – 2009-09-07T21:07:17.113