Blog

How to mount a LVM from a crashed and backup drive to the new HD to restore data

Tags: backup diskLVM crashrestoration

Published on: August 16, 2009 by Arnold Pablo

How to mount a LVM from a crashed and backup drive to the new HD to restore data

Scenario:

In server disaster management our clients often need to mount LVM to new HD to restore data. Let us see the scenario bit more,

Situation & Requirement

Server crashed and had to be reinstalled. OS along with cPanel was re-installed on a fresh hard disk. Needed to restore the cPanel backup from old LVM hard disk to the new hard disk. That process wasn’t simple as I was getting unrecognised file system errors.

Solution

Made sure that the lvm tools are installed and available in the server. After that issued the following command

lvm vgchange –ignorelockingfailure -P -a y

The -P (Partial) will make logical volumes which are missing one of their disks available too.

vgchange — Change attributes of a volume group

–ignorelockingfailure — This lets you proceed with read-only metadata operations such as lvchange  -ay and vgchange -ay even if the locking module fails. One use for this is in a system init script if the  lock  directory is mounted read-only when the script runs

-a — active or available

lvm lvs

The above command gives you output showing the name of the Volume Group and the name of the Logical Volume. The device entry will be created like /dev/VolGroup00/LogVol00/ and /dev/VolGroup00/LogVol01 etc. Finally run a fsck command to make it free of file system errors.

fsck /dev/VolGroup00/LogVol00

You are all set to go from here. As long as the lvm partition isn’t corrupt, following commands will get the oldhdd mounted to /oldhdd

mkdir /oldhdd
mount /dev/VolGroup00/LogVol00 /oldhdd

This isn’t my tutorial. “Shamelessly” leeched from http://www.techbytes.ca/techbyte118.html

For more assistance, you can contact our server disaster management team(Click here)along with your requirement.

Category : cPanel, Howtos, Linux

Arnold Pablo

Arnold Pablo

Technology always fascinated me and continues to do so. I started my career back in 2004 as a Junior System Admin and worked in various capacities both in technical and managerial roles. I love to experiment and try out new OSS projects and in free time, go for cycling to the interiors of God's own country, Kerala!

You may also read:

Comments

Add new commentSIGN IN

Let's Connect

Categories

Your Cart

Cart is empty.

Subtotal
₹0.00
APPLY
0
Send this to a friend