I used VHD_XP_Create by wimb to create a 7GB 'VHD' flat file which I boot windows XP from grub4dos
Occasionally the 'VHD' file gets corrupted, so I created 2 menu entries in my grub4dos menu which basically boot into linux, and 'backup' the VHD file or 'restore' the VHD file. This is simply boots into a linux shell and runs a bash script which 'cp -a' the file from my SSD drive between my larger spinning disk backup drive. This covers my needs well.
The problem is that almost without fail after restoring the VHD file to the SSD drive, it will be a non contiguous file, so I then have to take an extra step by booting from another windows OS to run wincontig to make the file contiguous again. If possible I would like to restore the VHD and make it contiguous from linux, as I only need three files, the kernel, the ramdisk and my bash script, which are not susceptible to corruption, running totally from RAM,and is very small (I use tinycore <8MB). My bash script is about 5 lines, and beats booting into a winPE, which I should write a batch script then compile, everytime I want to modify it. I can go down the winPE road, however I prefer not to.
I tried searching the Linux community but the general stance is Linux does not care about contiguous files. So go figure.
Maybe someone here knows? Also I can share any advice or tips if needed...