How can a partial image backup or restore be performed?

1

1

I want to carve out some of the unused space on the Windows partition of my computer for other use. After defragmenting the free space, there are unmoveable files roughly in the middle of the partition. For now, I plan to just shrink the partition to where those files end.

Objective: I need to make an image backup of the Windows partition first as catastrophe insurance.

Problem: From everything I've read, restoring an image backup must be done into a space at least as big as what was copied. Since I'll be shrinking the partition, that won't be possible. I'm looking for a way to either make an image of just the portion ending with the unmoveable files, or restore a full image (mostly empty space), into the shrunken partition.

Questions:

  • Is there a way to do either using a Linux command, like dd, or any of the usual built-in or readily available Linux or Windows system tools (my Google-fu hasn't come up with a solution)?

  • If creating a partial image is possible, I assume I will need to specify something like a sector range. How do I determine what that is (I don't know what the unmoveable files are, their exact location, or how to determine this)?

UPDATE: It looks like Acronis can actually restore an image to a smaller partition (although it is expensive and complex, so not ideal).

fixer1234

Posted 2015-01-18T04:56:38.873

Reputation: 24 254

Not sure whether it's exactly what you're looking for, but Acronis can restore a backup to any partition larger than the data size. I've used it for cloning to smaller SSDs etc with no issues at all, & no pre-prep; didn't have to try shrink the partition to match first. – Tetsujin – 2015-01-18T07:44:42.643

If I understand what you're describing, I think I've got the opposite problem. My issue is that restoring would be to a smaller partition. From everything I've read, nothing will restore to a smaller partition, even if all of the "extra" content is empty space. So I'm trying to create an image of only the portion of the partition that will be there after shrinkage (around half). Seems like it ought to be a common situation that should have existing solutions, but I can't find anything. – fixer1234 – 2015-01-18T07:56:30.020

I don't want to come across like some kind of advert for acronis;) but I've done precisely that on many occasions, e.g. 2TB HD to 512GB SSD, without having to take unmoveable system files into consideration. I've done it both by cloning & by backup/restore. There's also an add-on [which I'm not sure you'd need for this task] that will allow you to clone to disparate hardware too, bare-metal. Best I could find as ref is a bit out of date, but - https://kb.acronis.com/content/2770

– Tetsujin – 2015-01-18T08:02:16.603

Way cool! That looks like a solution, and a lot simpler than I thought it would take. Can you write it up as an answer? Quick question, will that run on Linux (or run on Windows but handle Linux files systems)? – fixer1234 – 2015-01-18T08:49:02.507

Sure - I'll try to make it not look like an advert ;) – Tetsujin – 2015-01-18T08:53:36.317

Answers

1

Acronis - various versions, home & corporate, none free - can do this.

From their (outdated but still relevant) KB

Introduction

When you transfer a system to a hard drive that is larger or smaller than the original one, Acronis True Image allows you to create a new partition layout to fit the hard disk of a larger or smaller size.

It is possible to restore a disk image to a smaller drive if the smaller drive has enough space to accommodate the occupied space of the larger disk (e.g. if you have a 200 GB disk with 100 GB occupied space, you can transfer image of this disk to a 150 GB drive, but not to 80 GB disk).

Solution

Resizing all partitions proportionally during restore:

(!) This can be done only with a backup of an entire hard disk.

  1. Create a backup of an entire hard disk that you want to restore to a larger or smaller one;
  2. Boot the computer with the new hard disk from Acronis Bootable Media;
  3. Restore the image;
  4. All the partitions will be restored proportionally to fit in the new hard drive automatically.

Resizing all or separate partitions manually during restore:

  1. Create a backup of entire hard disk or some partitions that you want to restore to a larger or smaller hard disk or partitions;
  2. Boot the computer with the new hard disk from Acronis Bootable Media;
  3. Restore the image. At the Partition or Disk to Restore step of Restore Data Wizard do not select and entire disk. Select a single partition and follow through the wizard. You will get a Restored Partition Size option, which you can adjust.

They also have an additional component [used to be at additional cost, now seems to be rolled into the product line] called Universal Restore, which allows restore to non-matching hardware - useful for porting to a new machine.

I have no affiliation to Acronis, I just use it myself & find it does what it claims.

Tetsujin

Posted 2015-01-18T04:56:38.873

Reputation: 22 456

1It isn't cheap and there's a 144 page manual to get through because it covers a lot of other territory. I'll have to dig into this when I'm fresh. I upvoted because it looks like a definitive solution to the problem. If someone has a simpler and/or inexpensive solution, that would be even better. If not, I'll accept your answer. – fixer1234 – 2015-01-18T10:29:39.137

The consumer version 'True Image' is simpler [& cheaper] but the corporate 'Backup & Recovery' is a rock-hard solution. Would be nice to find a cheaper way, though, for sure - for if I ever lose my corporate buyer for stuff like this;) – Tetsujin – 2015-01-18T10:38:35.137

1

My initial searches on partial restore confirmed my previous understanding that restoring had to be to an equal or larger sized partition. That led to a focus on a method of partial partition imaging, a fruitless search, and this question. After @Tetsujin's answer, I dug deeper into partial restores, and it turns out there are some free solutions, including several mentioned in another question on Super User.

@harrymc's answer to a question on restoring to a different-sized drive (my search terms hadn't picked it up), mentions two free products, AOMEI Backupper and Paragon Backup and Recovery (the feature is described here), which both have this capability. I found AOMEI also recommended in an answer on another forum. There are also a couple of other non-free programs.

So if anyone else is looking at this problem from the same angle I was, this will serve as a second place on Super User to find the information. I never did find a way to create a partial image, which would be useful because it would save a lot of time.

fixer1234

Posted 2015-01-18T04:56:38.873

Reputation: 24 254