Operating System - Linux
1752666 Members
5686 Online
108788 Solutions
New Discussion юеВ

Re: Converting existing LVM install to LVM on md devices

 
Tony Walker_2
Frequent Advisor

Converting existing LVM install to LVM on md devices

Hi Guys,

I've got a machine (which I've replicated onto a VM) which is installed as follows:

sda1 (/boot)
sda2 (PV)
VolGroup00
LogVol00(swap)
LogVol01(/)
LogVol02(var)

All working fine. I have another disk (sdb) that I want to partition the same, create md raid1 devices and put LVM on top of. I've so far been following the advice in this thread:
http://forums1.itrc.hp.com/service/forums/questionanswer.do?threadId=1093327

All seems fine, create the md's, lvm stuff, copy the data BUT, when I come to boot it see's my new volume group (vgroot) but doesn't see any logical volumes and then panics!

As a test, I've made sure that I can do half the conversion and boot off the raid devices on the second disk (i.e / = /dev/md1, /boot = /dev/md0). Plus, I know LVM is loading @ boot as I'm currently booting off lv's from sda!! Any thoughts?

I've now tried another install on normal slices and attempted to convert the second disk and boot onto lvm and now it won't see any LVM info at boot!

Yours hopefully,

Tony

5 REPLIES 5
Wouter Jagers
Honored Contributor

Re: Converting existing LVM install to LVM on md devices

I've done a similar thing recently and encountered some problems as well. They were generally related to my initrd (first an lvm issue, then a raid one).

Are you using the nice lvm2createinitrd script ? I remember I had to tell it about my RAID setup before it worked as planned.

This was the command that did it for me:

# lvm2createinitrd -c /etc/lvm/lvm.conf -r "md0 md1" -R /etc/mdadm/mdadm.conf 2.6.16.20

Just in case it might be helpful..

Cheers,
Wout
an engineer's aim in a discussion is not to persuade, but to clarify.
Tony Walker_2
Frequent Advisor

Re: Converting existing LVM install to LVM on md devices

Thanks for the reply Wouter. I don't appear to have this script on my machine. I forgot to mention - I'm using RHEL4r3!
I get the feeling the /boot/initrd-2.6.9-34.EL.img may have something to do with it in the current situation but with the original test, I'm *already* booting off an lvm lv so the initrd shouldn't be a problem?

Cheers,

Tony
Steven E. Protter
Exalted Contributor

Re: Converting existing LVM install to LVM on md devices

Shalom from Chicago Tony,

If you have the disk space.

pvcreate
vgcreate
lvcreate

Then use dd to copy the current data to the new logical volumes.

Test mount as well.

Then modify /etc/fstab

You have converted to LVM.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Wouter Jagers
Honored Contributor

Re: Converting existing LVM install to LVM on md devices

Do you see the md devices come up successfully during boot ?
an engineer's aim in a discussion is not to persuade, but to clarify.
Tony Walker_2
Frequent Advisor

Re: Converting existing LVM install to LVM on md devices

Thanks again gents,

In a moment of inspiration I unpacked the initrd file and discovered that the init script had the following:

lvm vgchange -ay --ignorelockingfailure VolGroup00

I changed this to:
lvm vgchange -ay --ignorelockingfailure

And now all vg's are activated and she mounts like a beaut!

Cheers,

Tony