[PVE-User] p2v win7

Flavio Stanchina flavio.stanchina at ies.it
Sun Nov 4 01:03:27 CET 2012

On 03/11/2012 16:09, Tonči Stipičević wrote:
> I finally managed to do p2v for w7.
> So if we want to use clonezilla method , the only way to achieve this is to do 
> disk to disk cloning. (not i.e. syst-part to syst-part )

That's what "physical to virtual" means, to clone the whole disk. At least
that's how I understand it. If one wants to do a partial migration, better
do a clean install and move the data and/or services as needed. It saves a
lot of trouble.

If you really want to get rid of the system reserved partition, here's a howto:

But you need to do it beforehand on a working system, you can't do that
*after* you've cloned only the system partition. And even if you do that,
it doesn't mean that you can now clone only the system partition, you'll
still have to migrate the whole disk because you still need to bring along
the boot sector.

> I tried very hard to clone just one partition and to make it booting w7 but had 
> always encountered problems like : cannot fix mbr, bootrec.exe /scanos cannot 
> find any win7os, error reading drive, ...

Windows is very very delicate with regard to its boot environment, there's
basically zero chance to make it boot again if you don't clone the whole
disk (and then there are potential startup problems on different hardware,
whether physical or virtual, but that's another matter). Well, not that
Linux isn't delicate in this respect, but at least the interactions between
the boot manager, the boot partition and the root file system are well
documented and any respectable installation CD has a rescue option that can
repair most boot problems automagically and lets a moderately skilled
sysadmin fix just about everything short of a dead disk.

And by the way, this has very little to do with the fact that the migration
is from physical to virtual. If you tried to migrate to a new physical disk
(because the old one is failing, for example) there would be no difference,
trying to clone only the system partition would fail miserably. I see a lot
of people here asking -- or worse, complaining -- about problems they
encounter during the setup of virtual machines, just as if using a
virtualized environment was a magical fix to the complexities of system
administration. Some tasks can definitely be done more conveniently in a
virtualized environment, but one has to always ask himself, "would this
work if I did it on real hardware?"

> The only problem might appear , like in my case, that the source drive was too 
> big and that the second partition we do not need at all.

That's not a problem that you can fix magically with a P2V migration. If
that's the case, better do a fresh install and move data/services as
needed, as I said above. Or get larger disks for your host, the time you
wasted is worth more than a disk. Or just move the physical disk from the
existing server to the virtualization host, if other options are not viable.

> Then we have two choices :
> 1. delete the partition we do not need and do the transfer (possibly faster)
> 2. clone all partitions - whole physical hdd (if there is to much data very slow)

Either there is data that you need to move, or there isn't, as Yoda would
put it. If there is, it will take the time it needs to take. If there
isn't, just don't move it.

> but in both cases we have to allocate space (make virt hdd) on the host , for 
> the whole physical hdd. (don't worry only the data will be transferred :-)
> After successful transfer I only had to resize the lvm volume to the optimal 
> size (made it smaller) .. webmin does that job error-free :-)

If the physical disk isn't fully used, you *can* transfer only the part
that is actually used, but only if the unpartitioned space is at the end of
the disk. I did that once with dd and netcat. I don't know if Clonezilla
can do that, however.

> I have just noticed that in the VM HW list on the host still stays the old 
> (bigger) HDD size (270G) instead of the new one - 70G ?!

It takes a while to refresh.

Flavio Stanchina
Informatica e Servizi
Trento - Italy

Those who do not understand Unix are condemned to reinvent it, poorly.
-- Henry Spencer

More information about the pve-user mailing list