[CentOS] LiveCD System recovery - Mounting LVM?

Fri Feb 4 01:50:59 UTC 2011
Gregory P.. Ennis <PoMec at PoMec.Net>

On Sat, Jan 8, 2011 at 7:17 PM, Johan Martinez <jmartiee at gmail.com>

 wrote:
        
        
        
        On Sat, Jan 8, 2011 at 3:50 PM, Lamar Owen <lowen at pari.edu>
        wrote:
                On Saturday, January 08, 2011 04:27:39 pm Johan Martinez
                wrote:
                
                > Now I am booting of CentOS live cd for system restore.
                I recreated
                > partitions like previous system using fdisk and then
                used dd to dump all the
                > data onto it. I would like to mount sda2 as LVM, but I
                don't know how to do
                > that. Any steps or howto mount LVM manually would be
                really helpful. I think
                > I can recover the system once I am able to access sda1
                and sda2. Any help?
                
                
                pvscan
                vgscan
                vgchange -ay
                lvscan
                
                (It has been awhile since I have done this; I know the
                vgchange -ay is required, but I don't recall if pvscan
                and lvscan were required or if I just used them for
                information....but I do think the vgscan was required.)
                
                In the lvscan output you should see the logical volumes;
                mount to the desired mountpoint with
                mount  /dev/VOLUMEGROUP/LOGICALVOLUME MOUNTPOINT
                
                Or you can reboot the CentOS disk in rescue mode and
                have it find your system as part of its bootup.  In that
                case your system will be mounted under /mnt/sysimage and
                you can do a 'chroot /mnt/sysimage' and essentially get
                a command line inside that system.
                
                Hope that helps.
                _______________________________________________
                CentOS mailing list
                CentOS at centos.org
                http://lists.centos.org/mailman/listinfo/centos
        
        
        
        Thanks for the reply Lamar and Robert. 
        
        
        I had tried pvscan and vgscan before sending out my first
        mail, but it didn't show up any physical volumes and vol
        grpups. 
        
        
        I didn't do lvscan though. 
        
        
        I will try again and see how it goes. 
        
        
        jM. 
        
        


I can see PVs sda1 and sda2 with pvscan, but they are not getting
mounted as lvm. Also, I see sda2 listed as LVM although I didn't
partition it that way. e.g. fdisk shows it as Linux type and pvscan is
showing it as lvm2. That's somewhat confusing me. 


Also, the real problem for me is recovery. I don't see LVM mounted after
doing vgscan and lvscan. Am I missing something here? Any help?


Thanks you..
jM

------------------------------------------------------------------------

Johan,

I have the same circumstance, and have not been able to mount an lvm
volume to a new machine.  I have your posts, but have not been able to
mount the lvm either.  Did you ever get this resolved?  Sure would
appreciate your thoughts, or any one else that has been able to do this.

Greg 
-------------------------------------------
Johan,

I am not sure if this is your problem but what I can determine is that
there may be a conflict with the same names of the lvm volumes; ie the
old volume that I am trying to mount has the same name as the volume on
the machine that is active.  

[root at SeVi mnt]# pvscan
  PV /dev/hdc2   VG VolGroup00   lvm2 [37.16 GB / 0    free]
  PV /dev/hdd1   VG VolGroup00   lvm2 [186.28 GB / 0    free]
  PV /dev/sda2   VG VolGroup00   lvm2 [931.41 GB / 0    free]
  Total: 3 [1.13 TB] / in use: 3 [1.13 TB] / in no VG: 0 [0   ]
[root at SeVi mnt]# lvchange --available y /dev/VolGroup00/LogVol00
[root at SeVi mnt]# mount /dev/VolGroup00/LogVol00 /mnt/hdc2

This results in mounting the current machine's lvm which is on sda1, but
I am wanting to mount /dev/hdc2.

Any one have any ideas ?

Greg