[CentOS] LiveCD System recovery - Mounting LVM?

Sat Jan 8 21:50:13 UTC 2011
Lamar Owen <lowen at pari.edu>

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.