Page 1 of 1
clonezilla, partimage, dd, acronis... what is best for p2v ?
Posted: 16. Dec 2010, 22:29
by fdelval
Hello all,
First post in the forums, but long time using VB with great results.
Now its time to go further and i would like to virtualize a phisical linux box.
I have been told to use all of those tools explained in the thread subjet, but im not sure, each of them seems to have a weaknesses, and noone seems to really work 100%.
Whats the official p2v tool for VB in order to get a phisical linux?
thank you.
Re: clonezilla, partimage, dd, acronis... what is best for p2v ?
Posted: 16. Dec 2010, 22:39
by sej7278
i'd just go with clonezilla, dd is guaranteed to work but it stores unused bytes too, clonezilla can just save the used space on supported partition types (i'm currently restoring a 160gb xp drive and the image is only 9gb).
i wouldn't use acronis - they never truly supported ext3 and will never support ext4 or btrfs; plus you have to use the enterprise version with reiser/jfs/xfs.
Re: clonezilla, partimage, dd, acronis... what is best for p2v ?
Posted: 16. Dec 2010, 23:09
by fdelval
im having a bad time with clonezilla and usb.
Everytime i try to restore an image, i get CRC error, i tryed 3 times already, diff USB's and different target image...
i read in the clonezilla FAQ something like if you clone HDA1, you need to restore in HDA1, but im just doing a whole HDD clone... im a little lost with clonezilla tbh
also, i know if i still have to rebuild the init ram after restoring
Re: clonezilla, partimage, dd, acronis... what is best for p2v ?
Posted: 17. Dec 2010, 01:20
by sej7278
i find the regular clonezilla live based on debian is flakey, the ubuntu maverick one is fine for me though - in fact i just restored a clone of my netbook.
i do it over the network using nfs4 though, not using usb for storage (only to boot from).
but i agree clonezilla is a bit overwhelming, as someone with over a dozen years unix experience, it still frightens me lol!
with any cloning tool, if you're cloning from machines with different disks (size, number, controller etc.) then you usually have to run a rescue cd to fix fstab after you've restored - especially modern linux distro's that use uuid's instead of simply /dev/sda1 etc.
its not easy, but it is possible - i've even cloned an encrypted machine into an unencrypted vm (in fact i now run my host as a guest!) by adding a 2nd virtual drive and dd'ing from the mounted encrypted (i.e. decrypted) to the other drive - even removing the lvm!
Re: clonezilla, partimage, dd, acronis... what is best for p2v ?
Posted: 17. Dec 2010, 12:38
by fdelval
wow, great job with the encrypted one!, its motivating.
I will make a try with the clonezilla based on ubuntu and check.
Meanwhile, i was thinking that fixing the fstab would be only necessary if i clone partitions only, right?
My phisical PC is a 45gb disk with 4 partitios, and the virtual one could use a disk with same 45gb. If i clone the entire disk, what could happen to fstab?
My main worry is the init ram and drivers...
Re: clonezilla, partimage, dd, acronis... what is best for p2v ?
Posted: 17. Dec 2010, 13:34
by sej7278
i thought the uuid's in fstab were generated from the hard disk serial or something, but they aren't, so you should be ok.
i think initrd will update itself ok - i only had to fuzz with it to stop it trying to decrypt my already decrypted partitions.
there's also the rsync option - i've rsync'ed a local filesystem to a (running!) remote openvz container before.
been a long time since i've done this i'm afraid, i wish i'd documented it

Re: clonezilla, partimage, dd, acronis... what is best for p2v ?
Posted: 17. Dec 2010, 18:23
by fdelval
awesome, rsync'd
But did you rsync'd the whole disk? partitions only?
Re: clonezilla, partimage, dd, acronis... what is best for p2v ?
Posted: 17. Dec 2010, 19:05
by sej7278
i did it from a backup of my system, using sudo instead of root ssh, but its easier just using root ssh and doing each directory individually as root
on your host (root@guest is the target below):
rsync -azp --progress --delete --numeric-ids /bin/ root@guest:/bin/
rsync -azp --progress --delete --numeric-ids /etc/ root@guest:/etc/
rsync -azp --progress --delete --numeric-ids /home/ root@guest:/home/
rsync -azp --progress --delete --numeric-ids /lib/ root@guest:/lib/
rsync -azp --progress --delete --numeric-ids /root/ root@guest:/root/
rsync -azp --progress --delete --numeric-ids /sbin/ root@guest:/sbin/
rsync -azp --progress --delete --numeric-ids /usr/ root@guest:/usr/
rsync -azp --progress --delete --numeric-ids /var/ root@guest:/var/
essentially don't sync /tmp, /dev or /proc !
when i used this method it was from an ubuntu 8.04 x86 openvz container to another identical-ish container (minimal install). you basically need both machines running, best to stop a many processes as your can first.
usually disclaimer applies, don't blame me if you accidentally delete your host filesystem instead of your guest

also you might want to do /home/ manually if you have a lot of large files in there (e.g. your VDI's!)
oh to answer your question, this is at a filesystem level, not disk/partitions.
Re: clonezilla, partimage, dd, acronis... what is best for p2v ?
Posted: 18. Dec 2010, 01:01
by fdelval
EDITED:
problem solved.
I had to format the USB HDD to ext3 in order to make it work.
Re: clonezilla, partimage, dd, acronis... what is best for p2v ?
Posted: 18. Dec 2010, 15:02
by fdelval
oh well i totally restored an 9.10 ubuntu to a virtual machine.
The hardware is TOTALLY different, quadcore Q9550 Vs pentium4, 500gb disk Vs 40gb, 4 gb ram Vs 1gb of different speeds....
I had to do NOTHING, networking works by only configuring the virtualbox networking, and no MBR fixing, no initRAM fixing... nothing...
i am scared about the process being so simple... ?
Re: clonezilla, partimage, dd, acronis... what is best for p2v ?
Posted: 18. Dec 2010, 22:22
by sej7278
fdelval wrote:oh well i totally restored an 9.10 ubuntu to a virtual machine.
The hardware is TOTALLY different, quadcore Q9550 Vs pentium4, 500gb disk Vs 40gb, 4 gb ram Vs 1gb of different speeds....
I had to do NOTHING, networking works by only configuring the virtualbox networking, and no MBR fixing, no initRAM fixing... nothing...
i am scared about the process being so simple... ?
weird isn't it - i'm always surprised when i do it, i can't imaging windows coping at all well with it, but linux just sorts itself out.
disk/cpu/ram isn't going to make any difference in a vm.
a little surprised you didn't have to fix /etc/fstab, but these days of using UUID's instead of /dev/sda1 probably make that unnecessary.
not sure why you had to format the usb disk - are you booting clonezilla from it
as well as backing up to it?! i just used a 256mb usb stick for clonezilla.