Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am trying to convert HVM mode of VM into PV mode on XenServer 5.5 server.

As a part of this routine I need to change in /etc/fstab partition names /dev/hd* to /dev/xvd*.

Here is my current /etc/fstab:

/dev/vg_os/lv_sys       /                       ext3    defaults        1 1
LABEL=/boot             /boot                   ext3    defaults        1 2
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
/dev/vg_os/lv_swap      swap                    swap    defaults        0 0

/boot = /dev/hda1
/     = /dev/hda2 (allocted for LVM /dev/vg_os/lv_sys)

I need to change /dev/hda1 to /dev/xvda1 and /dev/hda2 to /dev/xvda2. As far as I understand /dev/hda1 can be replaced like that:

/dev/vg_os/lv_sys       /                       ext3    defaults        1 1
/dev/xvda1              /boot                   ext3    defaults        1 2
tmpfs                   /dev/shm                tmpfs   defaults        0 0
devpts                  /dev/pts                devpts  gid=5,mode=620  0 0
sysfs                   /sys                    sysfs   defaults        0 0
proc                    /proc                   proc    defaults        0 0
/dev/vg_os/lv_swap      swap                    swap    defaults        0 0

and /dev/hda2 should be replaced using LVM tools like vgchange.

pvdisplay /dev/hda2
  --- Physical volume ---
  PV Name               /dev/hda2
  VG Name               vg_os
  PV Size               109.90 GB / not usable 21.44 MB
  Allocatable           yes
  PE Size (KByte)       32768
  Total PE              3516
  Free PE               60
  Allocated PE          3456
  PV UUID               dTkHMo-Bd7T-ia9q-8cEc-Xc4p-670p-D4kgRV

I wasn't be able to find how to change LVM PV Name from /dev/hda2 to /dev/xvda2.

share|improve this question
    
I don't think you need to do anything to change the PV NAME field. It just is displaying the device name of whatever hosts the LVM. How are you copying the LVM into the VM? –  Zoredache Sep 22 '10 at 17:47

2 Answers 2

LVM doesn't look for physical volumes by name. (Indeed that's one of its benefits.) LVM looks at all potential physical volumes, checks if they have an LVM signature, and if they do reads them to find out what volume group they belong to and what they contain. So all you need to do is convert the volumes and make sure that LVM is looking for physical volumes of the form /dev/xvd?[0-9] (which I presume is already the case on XenServer).

share|improve this answer
    
I fixed it by applying XenServer 5.5 kernel from xs-tools. RHEL 5.5 xen kernel didn't want to boot in PV mode of XenServer 5.5 That is why it wasn't be able to find /boot partition. –  VVP Sep 24 '10 at 17:02

I fixed it by applying a XenServer 5.5 kernel from xs-tools.

RHEL 5.5 xen kernel didn't want to boot in PV mode of XenServer 5.5 probably because it uses different partition name convention. That is why it wasn't be able to find /boot partition.

Finally I was be able to convert XenServer 5.5 VM HVM mode 2 PV for RHEL 5.5 which was installed using "other operating systems" template.

Here is a mini HOWTO in case if somebody is interested in:

http://wiki.virtastic.com/display/howto/CentOS+5.5+with+XenServer+Tools+on+XenServer+5.5

In case of RHEL 5.5 you need to install xs-tools first insted of installing RHEL 5.5 xen server.

share|improve this answer
    
you can accept your own answers on serverfault –  Hubert Kario Jan 7 '12 at 15:21

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.