<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<div class="moz-cite-prefix">I was assisted on the #lvm IRC channel
by kabi_ (thank you), the solution for others who might find
themselves in the same boat:<br>
<ul>
<li>look in /etc/lvm/archive and find the file that has the
information just prior to the destructive act</li>
<li>in this text file is a UUID for the volume that has been
corrupted</li>
<li>boot into rescue disk (or single user mode if the corrupted
disk is not your boot volume) and run the following<br>
pvcreate --config 'global{locking_type=0}' --uuid <UUID>
--restorefile /etc/lvm/backup/<file containing previous
info> /dev/<device><br>
vgcfgrestore -f /etc/lvm/archive/<file containing previous
info> <volume group name></li>
</ul>
<p>Thanks again!<br>
</p>
<p>/Christian<br>
</p>
On 5/30/2013 11:48 AM, Christian Lahti wrote:<br>
</div>
<blockquote cite="mid:51A79EEE.6020308@gmail.com" type="cite">Hello
all:
<br>
<br>
I have a VMWare virtual CentOS 6 server with the following disk
layout:
<br>
<br>
/dev/sda 15GB
<br>
/dev/sdb 100GB
<br>
<br>
Standard CentOS LVM setup
<br>
<br>
on sda1
<br>
/dev/vg_centos6/lv_root mounted on /
<br>
/dev/vg_centos6/lv_swap
<br>
<br>
on sdb1
<br>
/dev/vg_centos6/lv_var mounted on /var
<br>
<br>
I was starting to run low on disk space for /var, so I shut down
the machine gracefully, extended the disk in VMWare to 250G and
rebooted in single user mode. I then ran the following two
commands:
<br>
<br>
pvresize --setphysicalvolumesize 250G /dev/sdb1
<br>
lvresize -L250G /dev/vg_centos6/lv_var
<br>
<br>
I then rebooted expecting the /var to now be 250G instead of 100G.
What I got was:
<br>
<br>
No such file or directory trying to open /dev/vg_centos6/lv_var
<br>
<br>
After dropping to a maintenance shell I could not run any pv* or
lv* commands, always resulting in the error:
<br>
<br>
File-based locking initialization failed
<br>
<br>
After Googling forever I found some lv* and pv* commands take
--ignorelockingfailure as a parameter, so now I can "see" the pv
and lv information but I do not know how to recover this
partition:
<br>
<br>
pvdisplay --ignorelockingfailure /dev/sdb1
<br>
File-based locking initialization failed
<br>
--- Physical volume ---
<br>
PV Name /dev/sdb1
<br>
VG Name vg_centos6
<br>
PV Size 250 GiB / not useable 3.00 MiB
<br>
Allocatable yes
<br>
PE Size 4.00 MiB
<br>
Total PE 63999
<br>
Free PE 25599
<br>
Allocated PE 38400
<br>
<br>
lvdisplay --ignorelockingfailure /dev/vg_centos6/lv_var
<br>
File-based locking initialization failed
<br>
--- Logical volume ---
<br>
LV Path /dev/vg_centos6/lv_var
<br>
LV Name lv_var
<br>
VG Name vg_centos6
<br>
LV Write Access read/write
<br>
LV Status suspended
<br>
# open 0
<br>
LV Size 150.00 GiB
<br>
Current LE 38400
<br>
Segments 1
<br>
Allocation inherit
<br>
Read ahead sectors auto
<br>
- currently set to 256
<br>
Block device 253:2
<br>
<br>
I cannot mount this, I cannot fsck, /dev/mapper/vg_centos6/lv_var
does not even get created. This is a critical server, can anyone
please tell me how to reverse this or at least recover the data?
<br>
<br>
Thanks!
<br>
<br>
/Christian
<br>
</blockquote>
<br>
</body>
</html>