I don't want to reinstall everything so the cloning is the better solution from my point of view.
Resuming the steps:
0) Download and burn an image of SystemRescueCd
1) Clone the original partitions using Partimage booting from SystemRescueCd
2) Create a virtual machine -I'm using VirtualBox.
2.1) Create a virtual disk. You can use a remote disk, I did so cause I haven't space on my notebook.
2.2) Enable network, NAT is enought
3) Using Gparted recreate the original structure
4) Restore data using Partimage
5) Fix Grub and Network
Step by step:
0) None, download and burn is a very basic operation.
1) Cloning original partitions:
1.1) Boot using SystemRescueCd with these parameters:
rescuecd setkmap=it docache dodhcp
setkmap is for setting my italian keyboard
docache is used to load in memory the sysresc cd, it requires about 400 MB of RAM
dodhcp request an ip if you need to mount remote disk or partitions.
Note: in my case I saved the partition on a network disk using mount.cifs (samba), you can use nfs too
1.2) mount.cifs //remote_machine_ip_better/remote_exported_directory /mnt/backup -o user=your_remote_user
Insert the password and it's done.
1.3) partimage save /dev/sdaX /mnt/backup/backup-sdaX-pimg
substitute X with the number of the partition you are going to backup.
1.4) Coffe... and repeat the procedure for every partition.
2) Creating a VirtualBox machine is very easy, create a dinamically virtual disk of appropriate max capacity. Keep in mind that partimage saves only the occupied data an not the whole partition so you'll get a backup file which is proably smaller than you original paritition ( without considering compression obviously). However I suggest to oversize a littel bit the dinamically disk, acqually I don't know why the system gets problems with the exact size.
NB: you can create a virtual disk on a remote location without problem. I mounted the remote location from Windows.
2.1) Give enought memory to load the cd in cache, so al least 512 of ram, it's not mandatory (remove docache parameter at boot).
2.2) Boot SystemRescueCd in the same wey you did at (1.1)
rescuecd setkmap=it docache dodhcp
2.3) mount the backup disk, in my case a remote one.
mount.cifs //remote_machine_ip_better/remote_exported_directory /mnt/backup -o user=your_remote_user
Insert the password and it's done.
3) type "wizard" in console and the graphic interface will start, I hope for you.
3.1) type "gparted" in the terminal and recreate the structure of the physical machine into the virtual disk.
4) then restore the images:
partimage restore /dev/sdaX /mnt/backup/backup-sdaX-pimg.000
4.1) Coffe...
5) at this point you need to create a startup partition on the virtual disk. I followed this guide
Ripristinare Grub da LiveCD con grub-install (e altre amenità)
mkdir /mnt/sda1
mount /dev/sda1 /mnt/sda1
mount --bind /dev/ /mnt/sda1/dev/
mount -t proc none /mnt/sda1/proc
chroot /mnt/sda1 /bin/bash
#check you grub configuration, if your distro uses UUID you need to update the menu.lst file and the device map too.
grub-install /dev/sda
6) shutdown the virtual machine, remove the booting from SystemRescueCd and restart the VirtualMachine.
7) If everything works, Beer.
Note: I got problems with the network in Ubuntu because it configures the macaddress in /etc/udev/rules.d/70-persistent-net.rules, I just deleted the content of the file and then rebooting the system can acquire the correct mac address assigned by VirtualBox. Actually I had this problem cloning a virtual machine using the above procedure.
EDIT: I have had seriuos problems handling data from remote -smb- filesystem. Don't know why.
