[CentOS] Where is the LVM config stored?

Tue Apr 3 16:58:58 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 WipeOut
> Sent: Tuesday, April 03, 2007 11:24 AM
> To: CentOS mailing list
> Subject: Re: [CentOS] Where is the LVM config stored?
> 
> 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..

If you went through the trouble of creating a minimal install
why rsync it?

Just get the rpm list from PC, diff with rpms on VC and install the
ones that are missing.

Once you have done that you can find the application and system
config files that changed on PC by doing an rpm audit and rsync
just those files, making sure to modify them on VC to reflect
it's setup that differs from PC.

Of course /usr/local, /home and any other non-managed storage
locations can be safely rsync'd between the two hosts, but I
would not use rsync to replicate managed areas that rpm would
normally take care of.

If you start using kickstart it will make your life a lot
easier.

> 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?

I would have a kickstart script duplicate the setup of host A and
do a fresh install on host B with that script.

If you hunt around you may find an automated script that will create
it for you.

-Package selection
-User & group accounts
-authconfig, timezone, etc.
-Diffs the config file changes on A from dist version and patches
config files on B from those diffs, taking care not to do so on
critical config files that can change from setup to setup.
-rsync or tar-over-ssh the unmanaged storage locations

> Thanks..
> 
> _______________________________________________
> CentOS mailing list
> CentOS at centos.org
> http://lists.centos.org/mailman/listinfo/centos
> 

______________________________________________________________________
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.