Go Back   HowtoForge Forums | HowtoForge - Linux Howtos and Tutorials > Linux Forums > Server Operation

Do you like HowtoForge? Please consider supporting us by becoming a subscriber.
Thread Tools Display Modes
Old 28th February 2009, 20:40
atjensen11 atjensen11 is offline
Senior Member
Join Date: Dec 2007
Posts: 199
Thanks: 9
Thanked 6 Times in 6 Posts
Default 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.
Reply With Quote
Sponsored Links
Old 1st March 2009, 06:31
deshantm deshantm is offline
Junior Member
Join Date: Mar 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Re: Virtualizing a Physical Machine

Your plan seems reasonable in a general sense, but I would suggest a couple things to consider:
I don't think you need to actually dd the partitions, I would instead suggest to use tar to tar the root file system, then simply untar it onto the domU partition (LV or otherwise is fine).

Another easy way to go from physical to virtual is to boot from a liveCD, mount the partition or LV needed for the domU guest over NFS then simply do a cp or tar+cp being careful with the options to cp and tar so as to handle things like symbolic links properly.

If you are new to the xen and don't have a copy of "Running Xen", as a co-author I recommend it.

There are similar examples of watching out for things like /etc/fstab, partition labels, and the like covered in the book. As well as detailed information on working with LVM and domU guests.

Take a look into it with a google book search for LVM:

The website for the book is:

Even if you decide you don't want to buy there are lots of free references on the site itself.

Hope that helps.

Reply With Quote


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Clone from VM to physical machine staticanime Technical 4 27th December 2008 18:33
Virtualizing a Physical Ubuntu Server atjensen11 Installation/Configuration 6 1st October 2008 10:26
Squid Proxy Caching on Linux obzerver Installation/Configuration 4 13th August 2008 20:51
Migration from a virtual machine to physical sonoffett Technical 3 15th September 2007 17:09
Multiple Physical Hosting Servers Sharing IP wyzzkid HOWTO-Related Questions 1 28th October 2006 05:10

All times are GMT +2. The time now is 13:41.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.