/dev/centos/root does not exist after migrating CentOS7 from vmware to Xen

centos7xenserver

I am migrating a CentOS 7 system from VMware Server 2 to XenServer 6.5. The CentOS system was installed using the minimal installation. I used ovftool to convert the .vmdk file to a .img using the instructions here

https://www.mylesgray.com/virtualisation/using-vmwares-ovftool-convert-vmx-ova/

and imported this into XenServer using XenCenter. Upon booting I get the following errors:

dracut-initqueue[286]: Warning: dracut-initqueue timeout - starting timeout scripts
dracut-initqueue[286]: Warning: /dev/centos/root does not exist
dracut-initqueue[286]: Warning: /dev/centos/swap does not exist
dracut-initqueue[286]: Warning: /dev/mapper/centos-root does not exist

It goes on to start the emergency shell.

I think the problem is down to the device name of the disk. On the original system the disk is on /dev/sda. On the new system it is /dev/xvda. Using the installation disk I can boot into the rescue mode and it mounts /mnt/sysimage. I don't know how to fix the problem though. The only file I can find related to the device name is in /mnt/sysimage/boot/grub2/device.map. I tried changing this to

(hd0)    /dev/xvda

but it made no difference. I presume the logical disk manager configuration needs changing somewhere.

How can I fix this? I need simple(ish) instructions as I'm not a Linux expert, especially in relation to the boot process.

Best Answer

There was the same question on Reddit.

The main idea — you need to regenerate initrd.

  1. Boot into linux rescue
  2. Call dracut -f according to this article.