Recently, I had the fun (pain) of recovering a CentOS box with a corrupted logical volume. Below are the steps I took.
1. Boot to a CD/DVD and enter rescue mode from the menu
2. When the menu option for automatically mounting is offered, select no
3. Create a space to mount the disk. If you’re a purest, /mnt/sysimage is fine
4. Next, key in “lvm vgscan -v”
5. Now that we have the disk, we can tell the kernel about the vg, we do this with “lvm vgchange -a y”
6. You should have received a message about the vg being active now, great now we can mount the logical volumes like you would with a physical drive. Use lvm lvs –all to list all the available logical volumes.
in my case, my lv_home became corrupt. Not sure what happened, but we’ll take a look at logs later.
To remove the lv, we’ll do:
CentOS will prompt us if we’re sure we want to do this. You can use -an to automatically respond yes if you find yourself scripting this.
Now, we’ll recreate the logic volume.
lvcreate -L <size> -n lv_home vg_name
Don’t forget to format the new lv!
Now you can mount the drive to /mnt/sysimage/home
or just reboot.