Jump to content











Photo

Create Native Boot VHDs

vhd native boot win7 win server2008r2

  • Please log in to reply
20 replies to this topic

#1 sambul61

sambul61

    Gold Member

  • Advanced user
  • 1568 posts
  •  
    American Samoa

Posted 24 September 2011 - 01:09 PM

*
POPULAR

CREATE NATIVE BOOT BASE AND DIFFERENCING VHDs:

There is strong tendency to move towards virtualized environments that offer greater flexibility and economy of scale. Windows 7 VHDs are especially attractive due to their Native Boot support, almost eliminating performance and/or PC resources hit and "virtual hardware" use instead of real, associated with using VMs. For some ideas on using Base and Differencing VHDs see for example How to use Differencing Disks for your Advantage.

One can create a Fixed and Dynamic (expandable) Base VHD file, attach, initialize, partition and format it in Win 7 Disk Management Console, and create an expandable Differencing VHD (which contains only changes from the Base) with Diskpart. Then backup a system partition or hard drive with Windows Backup or another drive backup package to that VHD, or use Sysinternals Disk2VHD - to make full or incremental Backup depending on VHD type the easy way. There is a more involving manual way as well that also works in legacy Windows versions and equips you with relevant knowledge:

1. Generalize and Backup your Windows 7 or Server 2008 R2 hard drive to WIM image:
Boot to your Win 7 HD, download and install Windows 7 WAIK, or extract ImageX and other tools & images from WAIK remotely by using HTTPdisk. Prepare Win 7 PE with WAIK or WinBuilder, copy ImageX and other tools of your choice onto it. Open as Administrator and run in WAIK Deployment Tools Command Prompt:
sysprep /oobe /generalize /shutdown
If your OS was upgraded from a previous Windows release, you may need to delete Registry key "hkey_local_machinesystemsetup dword: upgrade" to allow sysprep to run. Reboot from Win 7 PE CD or ISO, run from its Command Prompt:
imagex /capture c: c:WIMW2KR2X64.wim "Windows Server 2008R2" /compress fast /verify
Use other Sysprep and ImageX command options if required. You can then create a Base VHD in Win 7 PE or after rebooting to Win 7 HD and opening Command Prompt as Administrator, and apply (restore) your Backup WIM to it, then make the VHD bootable on its own or add its entry to your host's Boot Menu.
2. Create a Base VHD Disk:
diskpart

create vdisk file=C:VHDW2KR2X64.VHD maximum=25600 type=expandable

select vdisk file=C:VHDW2KR2X64.VHD

attach vdisk

create partition primary size=15360

active

format fs=NTFS quick label="WinServer 2008R2 Base VHD"

assign letter=V

exit
This sequence allows to create a fixed or dynamic Base (i.e. parent) VHD file, then attach it as disk, initialize, partition, format, label and mount its volume(s) for easy access. Read more about Initializing disks with Diskpart. VHD can only be initialized as basic disk with basic volumes regardless of its file type, with min fixed empty VHD disk size 3 MB, dynamic and diff. 5 MB, max 2 TB for any disk type (127 Gb for use in Windows VPC). You might need to wait "a few minutes" when creating a large fixed VHD, while its sectors on underlying physical disk are zeroed. If deleted from the disk files data security is not an issue, one can instantly create any size fixed VHD with VHDTool. Dynamic VHDs are created small, and their sectors are zeroed as the disk grows overtime, thus slowing write access. Differencing VHDs are also dynamic with no max set size.
3. Apply Windows 7 Backup WIM to the Base VHD:
imagex /apply C:WIMW2KR2X64.WIM 1 V:
You can also use WIM2VHD tool instead of ImageX to sysprep and convert your system WIM image to VHD instead of sysprepping your main OS volume. Another option is to create and/or attach the VHD from within a Win 7 Setup ISO or DVD Command Prompt, and then install OS to it like to any other hard drive - it will reboot to the VHD to finish install. Or use GImageX (ImageX GUI) to apply Install.wim from the Setup disk to your VHD. One more way: connect a VHD as IDE drive to a virtual machine, and install Win7 to it inside the VM - then use OS migration techniques to enable the VHD to run on a real PC. You can install different OSs on several volumes of the same VHD, but only one partition can be marked active and booted from at a time.
4. Add Boot Environment & Configuration files to the Base VHD:
To boot the VHD in a virtual machine or via a bootmanager like Grub4DOS, you need to add MBR, required boot environment files and the boot menu entry to it (using /store option - see example), unless these files, including Boot folder, were added to the VHD root during Windows install or transfer to it. If you only want to boot the VHD natively from a host Win7 system via its Boot Menu, just add its boot entry to the BCD Store on the host drive. You can copy bootsect.exe suitable for OS type on the VHD or host respectively (32 or 64-bit) from Win 7 PE, Installation ISO or Win 7 WAIK.
bootsect /nt60 v: /force /mbr
Create BCD store on the Base VHD:
cd v:windowssystem32

bcdboot v:windows /s v:
5. Backup BCD and add the Base VHD entry to Host Boot Menu:
Backup Host BCD, copy a default boot entry in its Boot Menu, then insert below the {new_guid} from that BCD entry copy:
bcdedit /export c:bcdbackup

bcdedit /copy {default} /d "Windows Server 2008R2 VHD boot (locate)"

bcdedit /set {new_guid} device vhd=[locate]VHDW2K8R2x64.vhd

bcdedit /set {new_guid} osdevice vhd=[locate]VHDW2K8R2x64.vhd

bcdedit /set {new_guid} detecthal on
You can also run bcdboot v:windows /s c: to add the VHD entry to your host's Boot Menu instead of the above bcdedit commands, if the host and VHD OS versions are the same. Or use the bcdedit commands to add boot entries for each bootable volume on a multi-volume VHD, then make a desired partition active from WinPE or your system HD before booting to it.
6. Add a legacy OS entry to Win7 Boot Menu (needed to run WinXP):
bcdedit /create {ntldr} /d "Chain WinXP Bootloader"

bcdedit /set {ntldr} device partition:E

bcdedit /set {ntldr} path ntldr

bcdedit /set /displayorder {ntldr} -addlast
7. Restore original Win 7 BCD or Legacy Boot Environment (for WinXP VHD bootable with Grub4DOS):
You can easily revert to previous Boot Menu or legacy OS if needed. Win XP Boot.ini remains untouched by the above VHD setup and doesn't need to be restored.
bcdedit /import c:bcdbackup

OR

bootsect /nt52 v: /force /mbr
8. Re-specialize the Base VHD:
To boot a Win7 VHD natively or via Grub4DOS from a USB drive, you might need to enable Windows 7 native USB/VHD boot registry settings in offline OS on the VHD. Run in Command Prompt from a dir with the unpacked cdob's patch:
set_7_usb_boot.cmd v:windows

diskpart

select vdisk file=C:VHDW2KR2X64.VHD

detach vdisk

exit
Reboot to the Base VHD on a selected Win 7 PC to auto install all required device drivers. Clean up and defragment the Base VHD system volume with your favorite tools if required, redirect its Paging file to a physical HD in Windows System Properties - Advanced - Settings to keep size low. Consider installing EasyBCD to it for editing Boot Menu via GUI. If planning to add its Diff VHDs, reboot again to Win 7 HD, attach the Base VHD, deselect Contents Indexing in its Disk Properties and Set the parent disk ReadOnly (valid until detached), since its content can't be changed, defragmented or booted from once Diff VHDs are created to avoid mismatch. You can also set the parent VHD file Read Only in its File Properties, thus making it non-attachable and non-bootable. If you want to boot from the parent VHD later or Merge it with its Diff VHDs, Clear attribute ReadOnly from its file.
diskpart

select vdisk file=C:VHDW2KR2X64.VHD

attach vdisk

attributes disk set readonly

detach vdisk

exit
9. Create a Differencing VHD (if needed):
You can create multiple Diff VHDs to the same Base, and they can be chained. Detach a parent (Base or another Diff) VHD before creating or attaching its Diff (child) VHDs. Don't format or defrag volume(s) on an attached Diff VHD - it may take a long time and increase their size with little performance boost. Diff VHDs by default display Label and Drive Letter of their parent if assigned that you can change, and have auto adjusted size. Diff will transparently use its parent's BCD Store and original volume content, but it saves all changes to disk sectors' content to the Diff's volume. You may want to defrag the Diff and Base VHD files to keep them contiguous, but for native boot VHDs its not mandatory.
diskpart

create vdisk file=C:VHDW2K8R2X64-diff1.VHD parent=C:VHDW2K8R2X64.VHD

attach vdisk

list volume

select volume <volume_number_of_attached_VHD>

assign letter=W

exit

label W: "WinServer 2008R2 Diff1 VHD"
10. Add Differencing VHD and delete Base VHD boot entry from BCD store:
Change dir to the Diff VHD's system root, list all boot entries, copy the Base VHD entry and link its new GUID (device ID) to the Diff VHD, then add it to the host's BCD Store to boot natively from Windows Boot Menu. Or add the entry to the VHD's own BCD Store to boot via Grub4DOS or another bootmanager like VBoot.
cd w:windowssystem32

bcdedit /v

bcdedit /set {current_guid} description "Windows Server 2008R2 Base VHD"

bcdedit /copy {current_guid} /d "Windows Server 2008R2 Diff1 VHD"

bcdedit /delete {current_guid} /cleanup
Insert below the {new_guid} from the above BCD entry copy:
bcdedit /set {new_guid} device vhd=[locate]VHDW2K8R2X64-diff1.VHD

bcdedit /set {new_guid} osdevice vhd=[locate]VHDW2K8R2X64-diff1.VHD

bcdedit /default {new_guid}

bcdedit /set {default} detecthal on

bcdedit /v
Consider creating chained or direct Diff VHDs to the same Base to establish baselines in software testing, deployment, or run specific apps or drivers, and add their entries to your host's Boot Menu. When booting from a Diff VHD, its (chained) parent(s) must be detached and located in original folders on accessible at boot time drives. If moved, its possible to Repair relationship paths.
11. Merge Differencing and Base VHDs (if needed):
When enough updates are accumulated on your Diff VHD, it can be merged with its parent (uncheck Read Only in File Properties) after you uninstall unwanted apps from it and select merge depth - a number of chained Diffs to merge to the Base. Once merged, the Diff VHD can be deleted and replaced with a new empty one, or you can keep using it. You must "wait a few minutes" until Diskpart completes the task and shows the input prompt again - do not close Console before that! If several Diff VHDs exist from the same Base, merge all one by one to the Base and delete, since updating the Base will invalidate its multiple Diffs. Once finished, don't forget to set Base VHD file Read Only. The resulting Base file size increase can be a lot smaller than total size of merged to it Diffs. If you don't want to merge all Diffs to the Base, copy the Base VHD before merging it, then merge it with selected Diffs, rename the updated Base, and restore name of the original Base VHD copy thus leaving unmerged Diffs linked to it.
diskpart

select vdisk file=C:VHDW2K8R2X64-diff1.VHD

detach vdisk

merge vdisk depth=1

exit

Fixed VHD types are preferred for work, while dynamic and differencing - for testing to save time and disk space. If something goes wrong - just delete the Diff VHD and create a new one. At boot a dynamic VHD will try to reserve disk space up to its max set size (and a Diff VHD - to its parent size), so enough (preferably contiguous) disk space should be available on the underlying physical disk volume to avoid BSOD, unless you activate Thin Provisioning. Since a Diff VHD's parent disk must be set ReadOnly, using a Dynamic VHD as a parent instead of a larger Fixed VHD can save disk space. Don't attach a bootable non-generalized VHD on the same system, unless you switched Offline the source OS drive or modified the VHD disk signature and its OS BCD & Mounted Devices registry hives (manually or with a tool like Paragon Adjust OS or IMG_XP), as it may cause VHD signature change, blocking its future boot. Note, hibernation isn't possible when booting from a VHD. If your PC is BitLockered, place the VHDs on a non-BitLockered partition and suspend BitLocker during OS install onto VHD, remember the recovery key.

You just learned how to backup your sysprepped system drive to a Base VHD, then create its Differencing VHD and add its entry to the host's or VHD own Boot Menu, so you can natively boot it on your PC. Finally install to it and start testing new apps without risking to blow your system away. The system on a VHD is running almost as fast (on average 3% performance hit) as on a physical HD - a lot faster than inside any VM. And its running on your native PC hardware, not on fictional VM hardware! Note, all code in this and my other VHD Tutorials is given as "example" ONLY, a user might need to modify based on his system config and feedback. :good:
  • Brito, jsgage, nanook_729 and 1 other like this

#2 sambul61

sambul61

    Gold Member

  • Advanced user
  • 1568 posts
  •  
    American Samoa

Posted 24 September 2011 - 01:11 PM

BOOT Win 7 VHD on BARE METAL PC from EMPTY DRIVE - transferred to a separate thread.

#3 TheHive

TheHive

    Platinum Member

  • .script developer
  • 4197 posts

Posted 24 September 2011 - 06:04 PM

Thanks! Good Tutorial.

#4 Vortex

Vortex

    Frequent Member

  • Advanced user
  • 299 posts

Posted 25 September 2011 - 07:58 PM

Hi sambul61,

I tried your method on a Win 7 Pro installation but I got this error message :

License error: Booting from a vhd is not supported on this system

I guess Native boot Vhd is limited with Windows 7 Ultimate and Enterprise editions.

#5 Dhilip89

Dhilip89

    Frequent Member

  • Developer
  • 105 posts
  • Location:Malaysia, Johor
  • Interests:Anything that can blow my mind.
  •  
    Malaysia

Posted 25 September 2011 - 11:34 PM

Hi sambul61,

I tried your method on a Win 7 Pro installation but I got this error message :

License error: Booting from a vhd is not supported on this system

I guess Native boot Vhd is limited with Windows 7 Ultimate and Enterprise editions.


According to: http://technet.micro...KMK_limitations
It is restricted to Windows 7 Enterprise, Ultimate and Windows Server 2008 R2.

#6 sambul61

sambul61

    Gold Member

  • Advanced user
  • 1568 posts
  •  
    American Samoa

Posted 25 September 2011 - 11:48 PM

You may want to try VHD Loader. The author reported on his program forum to boot even DOS based VHDs !?.... :dubbio: And he wants to keep development going, so needs encouragement and bug reports & feature requests. You can place them right here, in VHD Loader thread.

As to booting Win XP based VHDs, Sara-Pmedia posted somewhat complex, but said to work well method of making a Universal XP VHD, which boots via Grub4DOS on multiple HW configs. Wimb also offered a comprehensive IMG_XP tool for similar purpose that also works with Win7. As to "Junior Win 7" based VHDs, there may be a way to correct VHD placed OS Registry a bit to show the right system version. :)

Another alternative for booting various type virtual disks is VBoot, but its not free. Grub4DOS can also map and boot as rowa images fixed Base VHDs with some OS versions installed. Another way to create a bootable via Grub4DOS WinXP VHD is to create and attach a VHD in Win 7, then start a VMWare VM and install WinXP to that VHD inside it, and then add the VHD entry to Grub4DOS menu on a host drive - one may need to integrate extra drivers like FiraDisk or WinVBlock to make it bootable.

If you want to boot a Win 7 VHD from an existing Win XP partition, just add Win 7 Bootloader and boot environment & VHD boot entry to that partition, plus the legacy WinXP boot entry as described in the Tutorials above. Its impossible to directly boot WinXP with Win 7 BOOTMGR, hence no native boot for WinXP VHDs, since NTLDR doesn't support boot from VHD. :hmm:
  • Brito likes this

#7 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 26 September 2011 - 12:32 AM

One can't 'correct' the registry setting, which specifies the version or the serial number will no longer be valid.
Also, it takes a few files exchanged or hexedited to convert one version of Windows into another.

:cheers:

#8 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 27 September 2011 - 01:35 PM

Should it be needed/useful:
http://blogs.msdn.co...-guideline.aspx
http://strepas.wordpress.com/2009/08/08/windows-7-–-vhd-boot-–-setup-guideline-to-be-continued/

:cheers:
Wonko

#9 sambul61

sambul61

    Gold Member

  • Advanced user
  • 1568 posts
  •  
    American Samoa

Posted 06 November 2011 - 02:33 AM

The above 1st link might be helpful, when directly installing Win 7 from Install DVD to a blank VHD disk, instead of applying to the VHD a sysprepped backup image of a Win 7 system hard drive. Since boot environment files are added by Win installer to the VHD automatically, that method may be useful for a novice, who has several versions of Windows (i.e. Light and Full), and wants to use a familiar process to install them on VHDs, then copy to HDD or USB Thumb to boot via Grub4DOS (static Base VHD only) or VBoot (Base and Dif VHDs) by adding a Grub4DOS Menu.lst section like:

title Boot Win7 VHD
find --set-root /Windows7.vhd
map /Windows7.vhd (hd0)
map --hook
chainloader (hd0,0)/BOOTMGR
rootnoverify (hd0)

This method allows to boot with Grub4DOS both Win7 and WinXP based VHDs by installing a virtual disk driver like FiraDisk or WinVBlock into OS on the VHD. The Menu section below can also be used to boot OS from VHD via Grub4DOS & Winvblock:

title Boot WinXP Mini - WinVBlock
find --set-root --ignore-floppies /WinXP_Mini.vhd
map /WinXP_Mini.vhd (hd0)
map --rd-size=2048
map --mem (rd)+4 (0x55)
map --hook
write (0x55) #!GRUB4DOSx00v=1x00WinXP_Mini.vhdx00x80x00
chainloader (hd0,0)/ntldr
rootnoverify (hd0)
boot

The short & easy sequence to create a native boot VHD would be:

1. Create a VHD in Win 7 Disk Management Console
2. Install OS to the VHD using one of the methods:
  • backup & restore a system partition to the VHD mounted inside a Backup Tool that can work with VHDs (like Paragon HDM for VS), OR
  • capture & apply the system partition to VHD with GImageX, OR
  • install OS to VHD attached as hard drive inside a Win7 VM, OR
  • convert system drive to VHD with Disk2VHD & another disk converter
3. Copy the VHD to a USB Thumb and make it bootable with BCD tools

DONE :showoff:

#10 sambul61

sambul61

    Gold Member

  • Advanced user
  • 1568 posts
  •  
    American Samoa

Posted 09 November 2011 - 05:24 AM

VHD Tools related topics are discussed in: Tools to manipulate Native Boot VHDs

#11 MedEvil

MedEvil

    Platinum Member

  • .script developer
  • 7771 posts

Posted 09 November 2011 - 03:01 PM

I don't understand, what you mean. You want someone to create a starter for all those tools?
How about using PStart for that purpose?

:cheers:

#12 sambul61

sambul61

    Gold Member

  • Advanced user
  • 1568 posts
  •  
    American Samoa

Posted 09 November 2011 - 03:16 PM

I don't suggest to integrate ALL listed tools :), but only selected features and free open source small tools under a well organized GUI sufficient to automate the process of creating, resizing, converting and making VHDs universally bootable.

For example, it would be good to integrate into such a tool this Dynamic-to-Static VHD Converter code that may convert faster than VHD Resizer.

As I understand, virtualization and further Hyper-V integration based on VHDs usage is strategic MS direction for Win 8 and future OSs, so this topic might need a bit more attention from Reboot developers. :book:

#13 Wonko the Sane

Wonko the Sane

    The Finder

  • Advanced user
  • 16066 posts
  • Location:The Outside of the Asylum (gate is closed)
  •  
    Italy

Posted 19 November 2011 - 12:27 PM

Maybe useful, maybe not:
http://chenall.net/post/vhd_mnt/
via google translate:
http://translate.goo...dfha8JItUda1s6w

:cheers:
Wonko

#14 sambul61

sambul61

    Gold Member

  • Advanced user
  • 1568 posts
  •  
    American Samoa

Posted 27 November 2011 - 04:01 PM

I tried your method on a Win 7 Pro installation but I got this error message :

License error: Booting from a vhd is not supported on this system

I guess Native boot Vhd is limited with Windows 7 Ultimate and Enterprise editions.


Experimental: :o

If your Win 7 version on VHD is not "high end" Enterprise, Ultimate or Win Server 2008R2 :hmm:, and can't boot natively from Boot Menu, you can boot it with Grub4DOS bootloader and Win7VBlock virtual disk driver. In addition to steps described described in the above Tutorial, add the following:

- install Win7VBlock driver to running Win 7 before it's captured to WIM image
- add MBR and Win7 boot environment to the system volume on the attached VHD
- add required Grub4DOS files to your new hard drive's root as per Grub4DOS Guide
- add Grub4DOS entry to Windows Boot Menu
- add Boot Win7 from VHD entry to Grub4DOS menu (credits to Sha0):

title Boot Win7 Home - Win7VBlock
find --set-root --ignore-floppies /Win7.vhd
map /Win7.vhd (hd0)
map --rd-size=2048
map --mem (rd)+4 (0x55)
map --hook
write (0x55) #!GRUB4DOSx00v=1x00Win7.vhdx00x80x00
chainloader (hd0,0)/ntldr
rootnoverify (hd0)
boot

Notes:
- WinVBlock 32-bit driver doesn't require digital signing, but 64-bit version is signed with a test certificate, so you need to switch ON the Test Mode in Win7 64-bit placed on the attached VHD by running from Command Prompt:
to activate: bcdedit /set testsigning on , to deactivate: bcdedit /set testsigning off
- The VHD file must be of fixed type and contiguous to boot OS with Grub4DOS. Check it with Contig utility and defrag if needed, also attach and defrag the system volume inside the VHD

#15 Swordsman

Swordsman
  • Members
  • 6 posts
  •  
    China

Posted 05 December 2011 - 05:09 AM

I'll have a try,thanks.

#16 sambul61

sambul61

    Gold Member

  • Advanced user
  • 1568 posts
  •  
    American Samoa

Posted 06 December 2011 - 10:25 PM

Surprisingly, Win7 Embedded Standard is supported for native boot from VHD - the spec confirms that. Created a VHD in Win7 Disk Management, started Win7 Emb (WES7) install in a virtual machine, interrupted as soon as the VHD get formatted, rebooted the PC and continued setup from the Emb7 ISO. It went like a champ, a new entry was added to my HD Windows Boot Menu (the HD from which Grub4DOS started and mapped the Setup ISO). Click on that entry - and here we go... Win7 Embedded Standard screen appeared, and it booted natively without 3-rd party virtual drivers installed to it.

Here's another way to install Win7 Embedded to a VHD: by using IBW (Image Building Wizard) - the tool used to prepare WES for deployment.

WES7 version Win7 ThinPC is also supported for native boot from VHD after some fixes, though not in spec. Both are light, fast and very popular among old PC owners... And now boot natively from VHD, so you can try WES7 without affecting current OS! Just remember, WES7 can't change activation status from eval to full once installed, but Thin Client can. Also, when you enter Thin Client's key at initial OS setup, you get Thin Client instead of WES after installing from the same Setup ISO. Trial keys 180-days are available free from MS, and 30-day trial key is included. :)

Interesting results are reported in Testing Windows Embedded Standard & ThinPC 7 install and boot from VHD thread.

#17 JonnyHotkeys

JonnyHotkeys

    Newbie

  • Members
  • 10 posts
  •  
    United Kingdom

Posted 01 November 2013 - 01:26 PM

hi, great article! 

 

I've set Windows 7 as a a native VHD (via the OS install, using shift+f10 to access cmd, then diskpart to create and attach the vhd for installation).

 

I made the VHD expanadable, maybe the max (or the min? not sure) is about 100Gb.

 

I'll probably be going for differencing, but I'd like to know more info (what's sysprep and WinPE and ImageX doing with the WIM files etc?)

 

I understand that you can't copy a mounted VHD, so 

 

How can I backup my parent VHD? 

 

I tried making copies (including copy/b) to clone the unmounted vhd (via the system install dvd, at a command prompt), but the VHD copy is only 20Gb....

 

Can you elaborate on this please?

 

Many thanks



#18 JonnyHotkeys

JonnyHotkeys

    Newbie

  • Members
  • 10 posts
  •  
    United Kingdom

Posted 18 December 2013 - 02:37 AM

Hi, having some problems (newbie at vhds, running a single native vhd on barebone metal) performance issues and messages make me think I need to defrag the partition that the vhd resides on.. but I'm inside the vhd on that drive.  Tried to find a tool to run from outside the OS, but none work from command prompt when booting from windows 7 install cd (shift+f10).

 

My partitions are a mess and not backed up. this is my 2nd native-VHD attempt, having suffered a BSOD on my new SSD (MBR missing or corrupt? corrupt sector 0 maybe).

 

Windows says nothing, unable to defrag-analyse the drive via tools from the OS (the VHD).

 

I'm confused!



#19 Sha0

Sha0

    WinVBlock Dev

  • Developer
  • 1682 posts
  • Location:reboot.pro Forums
  • Interests:Booting
  •  
    Canada

Posted 21 December 2013 - 10:17 PM

JonnyHotkeys:

You're new to reboot.pro, so why not create a post introducing yourself? :)

The "differencing" VHDs work something like this, given GrandParent.vhd -> Parent.vhd -> Child.vhd:
  • Read request for sector 42
  • Is sector 42 in Child.vhd?
    • Yes: Read it from Child.vhd
    • No: Is sector 42 in Parent.vhd?
      • Yes: Read it from Parent.vhd
      • No: Sector 42 must be in GrandParent.vhd. Read it from GrandParent.vhd
  • Write request for sector 13
  • Sector 13 might have been in either GrandParent.vhd or Parent.vhd, but now it will be in Child.vhd. Note that fact in Child.vhd
  • Write the sector to Child.vhd
As you can see, GrandParent.vhd and Parent.vhd are read-only, while all write operations are performed with Child.vhd.

If you defragment a filesystem inside this virtual disk, all of your efforts will happen inside Child.vhd. However, you seem to be talking about defragmenting the filesystem containing your .VHD files. Simply do not attach any VHDs and you will be able to defragment that filesystem. Is there not a defrag.exe command available from the installation environment? Maybe not, but you could copy that somewhere along with its dependencies and use it, perhaps.

#20 JonnyHotkeys

JonnyHotkeys

    Newbie

  • Members
  • 10 posts
  •  
    United Kingdom

Posted 15 January 2014 - 04:42 AM

Thanks for the info, I'm not doing anything with children or grandparents yet, my setup's a mess :(

 

The native VHD (win7ult x64) on bare-metal (SSD!!) was working perfectly.. then just after a month after purchase, down went the drive. THANKFULLY, after much persistence, I was able to force mount the VHD on the disk (bad bootsector 0, a friend guesstimated) and xcopy lots of data, recovering documents and images and downloads, re-installing Windows for... the zillionth time.

 

It's been two months, and the SSD replacement is due in any day!!

 

The 700Gb original HD is heavily fragmented, and I think I need to shrink the VHD to provide free space on the disk.

 

The VHD has 30% free space within. Will this 'help' in the shrink, and is it *safe*?

 

(I will have to: boot from win CD, or go to sys recovery console)

then: diskpart

sel vdisk file

shrink....

 

anything to do with mounting or activating?

do I have to worry about anything important being shrunk?! How does it work?!

Running out of space, no room to backup my 'backups' (if anyone has an idiot-proof backup plan, boy am I in need).

 

So back to looking for defrag outside OS options, and the closest I've found is defraggler, which I'm hoping will run from a UB'CD' (boot-USB) -  I see peeps booting from images (ISO) in bcd, converting VHDs to ... RAW? And I wonder ... how, and whaaa?

 

 

 

 

How portable is the VHD? If the only hardware change is the drive (and partition) it's stored on (>>> SSD, from std-IDE), can it be 'migrated'? I've heard not, and sadly... this is all a bit over my head still.

 

Thank you, again.

 

I'm Jonny. I live for music and technology - both when done "right"!!



#21 crashnburn

crashnburn

    Frequent Member

  • Advanced user
  • 136 posts

Posted 16 August 2014 - 08:44 AM

How would the tutorial change for a UEFI machine? 







Also tagged with one or more of these keywords: vhd, native boot, win7, win server2008r2

1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users