[CentOS] LiveCD System recovery - Mounting LVM?

Tue Jan 11 18:47:54 UTC 2011
Kwan Lowe <kwan.lowe at gmail.com>

On Sat, Jan 8, 2011 at 4:27 PM, Johan Martinez <jmartiee at gmail.com> wrote:
> Hi,
> I am trying to recover data from my old system which had LVM. The disk had
> two partitions - /dev/sda1 (boot, Linux) and /dev/sda2 (Linux LVM). I had
> taken a backup of both partitions using dd.
> 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?
> jM.

Once you do the pvscan and vgscan, then vgchange, you should have the
LVs available in /dev/VGNAME/LVNAME.  For example, if your volume
group name is VolGroup00, the LVs will be /dev/VolGroup00/lv001, etc..

Keep in mind that you are not mounting sda2 in this case but rather
the LVs associated with the VG associated with the PV on sda2.

For example:
pvscan
vgscan
vgchange -ay VolGroup00
mkdir /mnt/tmp1
mount /dev/VolGroup00/lv01 /mnt/tmp1


Also note that in some cases the lvm tools must be called by
specifying lvm before the command

lvm pvscan
lvm vgchange -ay VolGroup00

etc..