Virtualizing a Physical Machine
I have a physical Ubuntu 8.04 LTS server that is currently configured to use one 250 GB HDD. I wrote a backup script that runs nightly using the TAR command to backs up all of the data directories to an external HDD.
I would like to virtualize this machine on a new production server that I have installed which is running Xen. This machine is setup to use LVM for the DomU machines.
Setting up the DomU is not an issue. I would like to move the data from the physical HDD to the newly created DomU LVM partition.
The problem is that I setup the physical machine with only two partitions (root & swap). It was the first machine I setup and I have learned a lot since then. Therefore, the root partition consumes most of the 250 GB HDD, but there is nowhere near that much data on the drive. The data could easily fit in a 50 GB partition.
I was thinking of creating a new LV on the DomU machine and using the DD piped through SCP to copy the data from the physical machine to the LV on the Xen host. In order to do this, I am pretty sure that I need to create the LV with the same size as the physical HDD, 250 GB. I have enough size on the new machine to do this, but I don't want to allocate that much space to this DomU permanently.
Can I shrink this LV easily after the move? The physical HDD and the newly created LV would both have Ext3 filesystems.