[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-users] Creating a Xen image from HDD partition

  • To: <xen-users@xxxxxxxxxxxxxxxxxxx>, "Yoav Felberbaum" <mailinglists@xxxxxxxxxx>
  • From: "Nico Kadel-Garcia" <nkadel@xxxxxxxxx>
  • Date: Fri, 23 Feb 2007 00:09:59 -0000
  • Delivery-date: Thu, 22 Feb 2007 16:09:19 -0800
  • Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:from:to:references:subject:date:mime-version:content-type:content-transfer-encoding:x-priority:x-msmail-priority:x-mailer:x-mimeole; b=YE6O2wJx5WZM0HYg7W23BU2B9b+W6id1V0geX4jFLa5Z6AX4JRYnlTsPWGxE0UyXdeSZN5zUOdKFikJ5NLpn3N9xbev9Ob03lEqxkyOAK/moLvGJQZR9L023+bNyVkghc6bqLUGwEW7hLd5P6t+riFHylguqiZiASQP/vr2ZqXM=
  • List-id: Xen user discussion <xen-users.lists.xensource.com>

Yoav Felberbaum wrote:

I know that this is fairly straightforward & supposedly documented
elsewhere, but damned if I can find the info using Google.

I have a "stock" CentOS 4.4 installed on /dev/sda3 (with a RHEL
install on /dev/sda2). How should I create a xen-usable loop image
from the CentOS partition?

Would the following (paraphrased) command work from RHEL ...?

dd if=/dev/sda3 of=/path/to/file.img

This is the suckful way to do it. "dd" copies are inefficient, and rely on the new partitions or files being exactly the same size.

It's vastly faster and more efficient to use "dd" with skip commands to create a file that contains nothing you care about of the designated size, do a mkfs -t ext3 on that file, mount the file as a loop file system, mount the old partition, and do a "cp -a" or a "rsync" between the partitions. Then unmount them both and use the copy.

I understand that certain directories, like /boot, /proc & a couple
of others should NOT be in the image. Is there a full list?

TIA for any help you are able to provide!

They won't be if you're not duplicating a live OS, but only a mounted filesystem.

Xen-users mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.