Migrating to Xen
From FlimzyWiki
Fedora Core 4
These steps describe how I migrated a Fedora Core 4 machine to run in a Xen slice.
I was somewhat handicapped in that I could not SSH _into_ the FC4 box for unknown reasons. I was also unable to use nfs, as it caused kernel panics. I was, however, able to ssh *from* the FC4 box.
- First off, I created the LV target and mounted it as /mnt on the Xen dom0 as described on my Xen page.
- Second, on the FC4 box, I determined which directories need to be created on the target:
fc4:/# mount | cut -d' ' -f3 / /proc /sys /dev/pts /boot /dev/shm /tmp /proc/sys/fs/binfmt_misc /var/lib/nfs/rpc_pipefs /proc/fs/nfsd
- Then I created them:
dom0:/mnt# mkdir -p proc sys dev/pts dev/shm tmp var/lib/nfs/rpc_pipefs
Note that I did not mkdir for the directories under /proc, since /proc is a virtual filesystem. I also did not mkdir boot, because in the virtual environment of Xen, it is not important to have /boot on a separate filesystem.
- Then I copied the files from the FC4 machine to the target machine, by piping tar through ssh:
fc4:/# tar -cf - usr | ssh -l root dom0 'cd /mnt; tar -xvpf -'
I repeated this for each of the directories in / that I did not already create on the target. This included bin, boot, etc, home, lib, mnt, opt, root, sbin, service, usr, var, and a few other custom directories. This could probably be combined into a single command, but I chose to break it up to monitor my progress.
- Disable TLS
mv /mnt/lib/tls /mnt/lib/tls.disabled mv /mnt/usr/lib/tls /mnt/usr/lib/tls.disabled
- Edit /mnt/etc/fstab to reflect the new virtual disk device names.
- Copy kernel modules:
cp -a /lib/modules/2.6.18-3-xen-686 /mnt/lib/modules
- Unmount /mnt
umount /mnt

