[CentOS] migrating files for centos virtualization, virtual disk no longer boots.

Alain Spineux aspineux at gmail.com
Sun Oct 28 16:16:31 UTC 2007

On 10/27/07, Jerry Geis <geisj at pagestation.com> wrote:
> All,
> I am playing with virtualization on centos 5.
> I took my old redhat 7 disks and created a 10GIG virtual disk, I
> installed redhat 7.
> Now I am trying to get the EXACT image copied off of my actual redhat 7 disk
> so that I know it is the same (including all patches, updates and OTHER
> things I did to it that I
> have forgotten about).
> I booted the redhat 7 image just fine at this point. I also copied it
> for backup so I dont have to install again.
> So on my centos 5 box I mounted the image with a loop command.
> mount -t ext3 -o loop,offset=32256 redhat7.img /mnt/image
> This works fine.
> Then I logged into the redhat 7 system and executed the command
> tar --exclude ./proc --exclude ./mnt --exclude ./sys --exclude ./dev
> -cvf - . | ssh root at "( cd /mnt/image ; tar xvpf -)"

You should use -v only in the second tar, if not every file is logged
twice, just a trick.

> Where is my centos 5 box and /mnt/image the mounted image.
> The copy seems to go fine. But after I do this when I try to virtualize
> the redhat7 image it stops at:

If I had to do the same thing myself, trying to make it simple and
maximize my chances of success. I would have first installed a minimal
RH7 on the disk image, then made a backup of /boot and
Also on my original rh7 I would have installed a xen kernel using :
rpm -ivh kernel-xen?????.rpm. (the same as the one running on my xen
Then copied all the files, like you did (using tar and ssh).

Then restoring /boot/grub/grub.conf and kernel related /boot/initrd?????

Et voila :-)

Anyway the hardest part is to have grub correctly installed and a well
configured initrd pre-boot image.


> When I copy the second image back on top of the first image it then
> boots again. So glad I made that copy
> of the image file.
> What is happening with the tar command that is messing up grub and
> keeping it from booting?
> Thanks,
> Jerry
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos

Alain Spineux
aspineux gmail com
May the sources be with you

More information about the CentOS mailing list