This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


Re: [Xen-users] Convert CentOS system to Xen image?

On Mi, Apr 02, 2008 at 12:40:00 -0400, James Pifer wrote:
> > You have copied just one partition,
> > instead of the whole disk.
> > 
> > To copy the whole disk,
> > you should use:
> > 
> > # cat /dev/ida/c0d0 | nc -l -p 3000
> > 
> > But this command will copy all of the disk (and if it is big,
> > it is not good idea; also you need enough freespace on the target
> > system).
> > 
> > More flexible way is the way mentioned by Ross: 
> > to use LVM on the target system
> > and to copy not the raw device, but files, which is situated
> > on the device.
> I do have enough space to do the whole disk, I just don't have free
> space to create an LV. I did it again using /dev/ida/c0d0. Now when I
> try to bring up in Xen I get No kernel was found. 


you should edit kernel command line
and specify new root fs path.

What bootloader to you use?

Presuming you use GRUB:

1. press e in the GRUB bootprompt
2. Choose kernel line
3. Press e again
4. Change root=/dev/ida/c0d0p1 arg to root=/dev/hda1
5. add parameter init=/bin/sh
6. press b to boot
7. when you will get shell prompt do
mount -t proc proc /proc
mount -o rw,remount /
mount -a 
vi /etc/fstab

and here change /dev/ida/c0d0pXXXX to /dev/hdaXXXX

also you can use sed instead of vi:

sed -i s@/dev/ida/c0d0p@/dev/hda@ /etc/fstab

8. umount -a
9. continue booting process
exec /sbin/init

> I also downloaded the DVD for the same version of CentOS. So I thought
> maybe I would try booting off that and see if I can fix it. I figured if
> the iso was mounted as a CDROM first that it would boot, but I still get
> No kernel was found.

I think that when you fix boot loader config and /etc/fstab
you will boot successfully. 
So you are close to the victory.

You even not obliged to use live CD or installation CD to do this.
All can be done be bootloader.

> I'll try creating a new VM using the DVD, and try to rsync everything,
> similar to what Ross was saying. 

> The good thing is that I can try lots of things, as long as I don't have
> to take the other server offline. 
> I appreciate everyone's help!
> James

WBR, i.m.chubin

Xen-users mailing list

<Prev in Thread] Current Thread [Next in Thread>