[CentOS] Looking for a life-save LVM Guru

Chris Murphy lists at colorremedies.com
Sat Feb 28 04:23:36 UTC 2015


On Fri, Feb 27, 2015 at 8:24 PM, John R Pierce <pierce at hogranch.com> wrote:
> On 2/27/2015 4:52 PM, Khemara Lyn wrote:
>>
>> I understand; I tried it in the hope that, I could activate the LV again
>> with a new PV replacing the damaged one. But still I could not activate
>> it.
>>
>> What is the right way to recover the remaining PVs left?
>
>
> take a filing cabinet packed full of 10s of 1000s of files of 100s of pages
> each,   with the index cards interleaved in the files, and remove 1/4th of
> the pages in the folders, including some of the indexes... and toss
> everything else on the floor...    this is what you have.   3 out of 4
> pages, semi-randomly with no idea whats what.
>
> a LV built from PV's that are just simple drives is something like RAID0,
> which isn't RAID at all, as there's no redundancy, its AID-0.

If the LE to PE relationship is exactly linear, as in, the PV, VG, LV
were all made at the same time, it's not entirely hopeless. There will
be some superblocks intact so scraping is possible.

I just tried this with a 4 disk LV and XFS. I removed the 3rd drive. I
was able to activate the LV using:

vgchange -a y --activationmode partial

I was able to mount -o ro but I do get errors in dmesg:
[ 1594.835766] XFS (dm-1): Mounting V4 Filesystem
[ 1594.884172] XFS (dm-1): Ending clean mount
[ 1602.753606] XFS (dm-1): metadata I/O error: block 0x5d780040
("xfs_trans_read_buf_map") error 5 numblks 16
[ 1602.753623] XFS (dm-1): xfs_imap_to_bp: xfs_trans_read_buf()
returned error -5.

# ls -l
ls: cannot access 4: Input/output error
total 0
drwxr-xr-x. 3 root root 16 Feb 27 20:40 1
drwxr-xr-x. 3 root root 16 Feb 27 20:43 2
drwxr-xr-x. 3 root root 16 Feb 27 20:47 3
??????????? ? ?    ?     ?            ? 4

# cp -a 1/ /mnt/btrfs
cp: cannot stat ‘1/usr/include’: Input/output error
cp: cannot stat ‘1/usr/lib/alsa/init’: Input/output error
cp: cannot stat ‘1/usr/lib/cups’: Input/output error
cp: cannot stat ‘1/usr/lib/debug’: Input/output error
[...]

And now in dmesg, thousands of
[ 1663.722490] XFS (dm-1): metadata I/O error: block 0x425f96d0
("xfs_trans_read_buf_map") error 5 numblks 8

Out of what should have been 3.5GB of data in 1/, I was able to get 452MB.

That's not so bad for just a normal mount and copy. I am in fact
shocked the file system mounts, and stays mounted. Yay XFS.


-- 
Chris Murphy



More information about the CentOS mailing list