|I recovered my data. |
Thanks for all your help.
The problem was in fact knoppix, but not because it had an older version of lvm2 or even lvm1.
The problem was that the human-readable part I extracted from the beginning of the device contained invisible characters in front of the
'vol0' label in the file 'volt.txt' .
These characters were not visible in terminal using 'cat', 'more', and they also did not appear in standard error as a consequence of the 'vgcfgrestore' command, as witnessed by the first line of the error:
'data/vol0.txt' does not contain volume group 'vol0'.
The reason why I could not observe this problem under knoppix is, that I did not use any other programs to display text than 'cat', 'more', standard error/standard out, and libreoffice. So I could not see that there were these invisible characters in front of 'vol0'.
Under knoppix, I did not have xemacs, which I usually use, so I could not locate the problem, thinking that my restore file vol0.txt was ok.
This belief was reinforced by the fact that I could use the file without problems to recreate the physical volume using pvcreate with the uuid switch.
You helped me finding the problem because of your comments on possible lvm2-version differences between ubuntu and knoppix, so I redid the whole thing with a ubuntu live cd, where I could install xemacs, and I noticed the characters.
I could then remove the bogey volume group that I had created from scratch using vgremove, and after that, the
vgcfgrestore command with the corrected file vol0.txt worked without problems.
Right now I am doing my backup, before switching the faulty drive to the new replacement… This is not gonna happen again.
Something during the replacement happened that did something with the metadata for the physical volume. I do not know what that was.
The human-readable metadata at the beginning of the raid10 device was still there and intact.
I copied the data from the beginning of the raid10 device using
sudo dd if=/dev/md127 bs=512 count=255 skip=1 of=md0.txt
Then copied the volume group description from md0.txt to a file called vol0.txt.
I could then recreate the physical volume using
sudo pvcreate --uuid WFo1On-anFb-2av8-DuRq-vKee-nJEt-ZLnu26 --restorefile vol0.txt /dev/md127
and I could recover the volume group and all its logical volumes using
sudo vgcfgrestore -f vol0.txt vol0
Thanks for helping!
On Mar 27, 2013, at 21:08 , Stuart D Gathman <stuart bmsi com> wrote:
On 03/25/2013 05:50 PM, Björn Nadrowski expounded in part:Well, I see I would have to remove the volume group first, at the very least.I wouldn't. Just think of your vgcreate as removing all LVs and renaming the VG. Now you want to undo all that