[CentOS] Re: Where is the LVM config stored?

Tue Apr 3 17:09:32 UTC 2007
Ross S. W. Walker <rwalker at medallion.com>

> -----Original Message-----
> From: centos-bounces at centos.org 
> [mailto:centos-bounces at centos.org] On Behalf Of Scott Silva
> Sent: Tuesday, April 03, 2007 12:59 PM
> To: centos at centos.org
> Subject: [CentOS] Re: Where is the LVM config stored?
> 
> WipeOut spake the following on 4/3/2007 8:23 AM:
> > Ross S. W. Walker wrote:
> >>> -----Original Message-----
> >>> From: centos-bounces at centos.org
> >>> [mailto:centos-bounces at centos.org] On
> >>> Behalf Of WipeOut
> >>> Sent: Tuesday, April 03, 2007 6:40 AM
> >>> To: CentOS mailing list
> >>> Subject: [CentOS] Where is the LVM config stored?
> >>>
> >>> Hi,
> >>>
> >>> I am trying to migrate one of my systems to a VMware virtual
> >>> machine.. The PC is an IDE drive using LVM and the 
> virtual machine is
> >>> a SCSI drive using ordinary partitions..
> >>>
> >>> Basically I rsynced the entire filesystem from the physical to the
> >>> virtual machine and that seemed to work just fine.. I 
> installed grub
> >>> onto the drive in the virtual machine and its booting fine..
> >>
> >> What tool did you use to copy the host filesystem?
> >>
> >> To what physical medium did you copy it to, vmware virtual 
> disk file
> >> or physical partition/logical volume?
> >>
> >>> The problem comes when the new system trys to scan for 
> the LVM setup
> >>> that was on the previous PC.. I thought it would scan the 
> drive, and
> >>> seen that there are no LVM partitions and move on but it 
> doesn't it
> >>> has a kernel panic and flashes the cap lock and scroll 
> lock LED's on
> >>> the keyboard.. Obviously somewhere its being told there 
> should be an
> >>> LVM partition or its being told to scan hda rather than sda..
> >>
> >> The LVM information is stored in the disk volume itself, there are
> >> backup copies of the configuration routinely dumped to
> >> /etc/lvm/backup, and archive copies of volume groups stored in
> >> /etc/lvm/archive.
> >>
> >> Make sure this "copy" of your physical host's drive isn't somehow
> >> being accessed by the physical host at the same time as the virtual
> >> host.
> >>
> >>> I have checked the grub.conf and fstab files and they are 
> all right
> >>> for the new drive setup..
> >>>
> >>> So where is the LVM config? How do I tell it there are now LVM
> >>> volumes that need to be accessed?
> >>
> >> If the PV headers were copied in the volume copy it should pick
> >> those up on the pvscan, then vgscan will see any volume groups
> >> defined within the PVs and lvscan should find any LVs within
> >> the volume groups.
> >>
> >> -Ross
> >>
> > 
> > Maybe I should explain exactly what I did because perhaps I 
> am doing it
> > all wrong and thats why I am having so many issues..
> > 
> > I have a Physical Centos box (we will call it PC) and I 
> want to turn it
> > into a Virtual Centos box (VC).. I created the virtual 
> machine in the
> > VMWare server console and then installed VC with a minimum Centos4
> > install.. I then went to PC and ran rsync with the various 
> switches to
> > copy the entire filesystem from PC to VC across the 
> network.. I excluded
> > /dev, /proc and /sys.. I also used the --delete option to remove any
> > files that exited on VC that were no longer on PC.. Then before
> > rebooting VC I checked fstab and grub.conf files to make 
> sure they were
> > correct.. Finally I restarted VC and booted from CD1 in 
> rescue mode to
> > run grub-install to get the boot sector and start up 
> working right..Then
> > rebooted VC.. It starts up and then freaks when trying to 
> sort out the
> > LVM volumes..
> > 
> > The difference between PC and VC is that in VC I have 
> decided to use a
> > scsi drive (apparently better performance) and in PC its an 
> IDE and I
> > have made the virtual drive bigger.. I have tried running 
> PC with and
> > without LVM (in other words using normal formatted 
> partitions) and it
> > seems to have the same problem.. So even when no LVM 
> volumes exist its
> > still looking for them..
> > 
> > Obviously I have both systems live an running when I am 
> doing the data
> > transfer.. There are no errors but would this cause a major issue?
> > 
> > How do you migrate form physical to virtual?
> > 
> > Thanks..
> Going from an IDE drive to a SCSI drive means you will have 
> to make an initial
> ramdisk on the new system (initrd). The scsi drivers are 
> modules in the
> kernel, and without an initrd with the drivers included and 
> enabled, you can't
> mount the root to finish booting.
> Look here for a fix;
> http://kbase.redhat.com/faq/FAQ_80_3902.shtm

Yes, of course, and if your rsync'd modprobe.conf didn't include
the SCSI driver it wouldn't make it into the initrd unless you
modified modprobe.conf and manually added it afterward before
running mkinitrd.

> I don't see how an emulated scsi drive will perform any better than an
> emulated IDE drive, but I suppose it is possible.

I guess it would depend if it emulated tagged queuing and command
recursion and if it implemented it decently, but conceivably it
is possible to have emulated scsi that out performs emulated ide
with these two features implemented.

-Ross

______________________________________________________________________
This e-mail, and any attachments thereto, is intended only for use by
the addressee(s) named herein and may contain legally privileged
and/or confidential information. If you are not the intended recipient
of this e-mail, you are hereby notified that any dissemination,
distribution or copying of this e-mail, and any attachments thereto,
is strictly prohibited. If you have received this e-mail in error,
please immediately notify the sender and permanently delete the
original and any copy or printout thereof.