KVM - Import CentOS 7 from XenServer

Issues related to hardware problems
Post Reply
eduardolucioac
Posts: 22
Joined: 2017/01/25 12:40:27

KVM - Import CentOS 7 from XenServer

Post by eduardolucioac » 2019/12/27 19:16:02

I imported a virtual machine (CentOS) from XenServer to KVM. This virtual machine originally had two disks (LVM). I added both disks to the imported machine in KVM. The disk containing the boot partition is correctly defined, but apparently the import had problems with the second disk.

What do I do to fix this?

Below the errors that occur during boot ...

Image

Other information I...

Image

Other information II...

Image

Other information III...

Image

eduardolucioac
Posts: 22
Joined: 2017/01/25 12:40:27

Re: KVM - Import CentOS 7 from XenServer

Post by eduardolucioac » 2019/12/27 21:19:52

The problem was that the device "xvdb1" (XenServer)...

Code: Select all

[root@vmrhs1doctxt01 consultor]# cat /etc/fstab
[...]
/dev/xvdb1               /mount                  ext4    defaults        0 1
[...]
... is now called "vdb1" (KVM).

The solution was change the entry in "/etc/fstab" to "vdb1"...

Code: Select all

[root@vmrhs1doctxt01 consultor]# cat /etc/fstab
[...]
/dev/vdb1               /mount                  ext4    defaults        0 1
[...]
But to access the contents of the "/etc/fstab" file you must first mount the "/" of the VG (Volume Group) in question by doing as follows...

First boot using a Linux system rescue disk. In my case I used SystemRescueCd ( http://www.system-rescue-cd.org/ ) (systemrescuecd-6.0.3.iso).

With the system booted run the command below to find out the name of the VG...

Code: Select all

[root@vmrhs1doctxt01 consultor]# pvdisplay 
[...]
  VG Name               RH
[...]
... once VG is discovered, then LV (Logical Volume) will be in "/dev/RH/<SOME_LV_NAME>".

Once you discover the target LV - "/dev/RH/LV_ROOT" in my case - you will need to find out the LV filesystem...

Code: Select all

[root@vmrhs1doctxt01 consultor]# file -s /dev/RH/LV_ROOT
/dev/RH/LV_ROOT: symbolic link to `../dm-0'
[root@vmrhs1doctxt01 consultor]# file -s /dev/dm-0
/dev/dm-0: Linux rev 1.0 ext4 filesystem data (needs journal recovery) (extents) (large files) (huge files)
NOTE: "/dev/RH/LV_ROOT" is a symbolic link to "/dev/dm-0".

Once discovered the filesystem ("ext4" in my case), then mount the LV...

Code: Select all

[root@vmrhs1doctxt01 consultor]# mkdir /mnt/LV_ROOT
[root@vmrhs1doctxt01 consultor]# mount -t ext4 /dev/RH/LV_ROOT /mnt/LV_ROOT
... and edit the "fstab" file...

Code: Select all

[root@vmrhs1doctxt01 consultor]# vi /mnt/LV_ROOT/etc/fstab
Done! =D

[Refs.: viewtopic.php?t=4455#p21571 ,
https://www.systutorials.com/241497/how ... on-centos/ ,
https://unix.stackexchange.com/a/235166/61742 ]

Post Reply

Return to “CentOS 7 - Hardware Support”