Monday, May 1, 2017

Disk Change Please.


Create a System Image Backup, then boot from a system repair disc and restore the image easy? Only if the new disk and the old disk are the same size.

If the new disk is smaller it is necessary to shrink the existing large disk down to a size which can fit on the new smaller disk.  The problem with shrinking is that some files are immovable which limits the amount the drive can be shrunk by.

If you run a shrink operation, it will advise how much space can be shrunk by.  In the event log a 259 event will detail the type of immovable file which is acting as a block on shrinking further.  The types of things which create immovable items are, Windows Search (turn off), Hibernation, and the most likely; System Protection, delete the restore points and related items.

Once these have been addressed, there is the option of, emptying the recycle bins and defragmenting the drive but this is unlikely to improve the shrink potential very much.

Shrinking can take a while so just leave it to get on with it.

Once the shrink has been completed, create a system image on an external drive.  I bet you're thinking you're good now right? Forget it.

You STILL won't be able restore that system image.  Can't do it to a smaller disk see? Even when a load of it is unallocated and blank.  But what you do have is a backup of the partitions in that system image :)

This forum thread saved my bacon
https://social.technet.microsoft.com/Forums/windowsserver/en-US/f15bfe2f-e265-479a-afa3-f055530c97f5/windows-server-backup-0x80042407-seriously?forum=winserverfiles

You can easily create a System Repair Disk within Windows 10.  You can then boot from that to a command line where the command line tools are available.  Diskpart for disk partitioning and Wbadmin for backup/restore.

In Summary

Obtain the version information of your required backup.
wbadmin get versions –backuptarget:<X:>

Obtain the sizes of your backed up partitions for your required version
wbadmin get items –version:<versioned> -backuptarget:<X:>

Use DiskPart commands or other tools to create the same sized partitions on the disk you are going to restore to.  Also use the tool to list the partitions so that you can correctly specify the recovery target.

Make use of the wbadmin help and example commands to see how to construct the commands.  They can be lengthy and accuracy is essential especially with the -items parameter.


Wbadmin start recovery –version:<versionid> -backuptarget:<x:> -itemType:Volume –items:\\?\Volume\<GUID>  -recoverytarget:D:

Once you have restored the data, you need to ensure the boot system is correctly configured.  You can try the Startup-Repair tool on the System Repair Disk although I did not have much luck with that.  DiskPart can set the active partition for you.  After that you may have to spend some time with bootrec.exe and/or bcdedit to fine tune it.  After a bit of playing I managed to get it to boot although it was not easy.  I have to admit I do not know exactly how it fixed it to boot correctly !