[PVE-User] vzdump issue - couldn't detect volume group because of case sensitivity issue
StalkR
stalkr at stalkr.net
Wed Feb 23 09:46:24 CET 2011
Hello,
Trying vzdump in LVM snapshot mode on an Ubuntu server 10.04 amd64
system, it was failing with "mode failure - unable to detect lvm
volume group".
We eventually found the culprit, on this system we have:
# lvs --units m --separator ':' --noheadings -o vg_name,lv_name,lv_size
vgname:lvname:10240.00m
instead of the expected:
vgname:lvname:10240.00M
Anyway, VZDump.pm has a regexp to match uppercase M. Adding the "i"
flag for case insentivity solved the issue.
Patch suggestion:
--- /usr/share/perl5/PVE/VZDump.pm.orig 2011-02-22 22:32:23.000000000 +0100
+++ /usr/share/perl5/PVE/VZDump.pm 2011-02-22 22:32:38.000000000 +0100
@@ -619,7 +619,7 @@
my $cmd = "lvs --units m --separator ':' --noheadings -o
vg_name,lv_name,lv_size";
if (my $fd = IO::File->new ("$cmd 2>/dev/null|")) {
while (my $line = <$fd>) {
- if ($line =~ m|^\s*(\S+):(\S+):(\d+(\.\d+))M$|) {
+ if ($line =~ m|^\s*(\S+):(\S+):(\d+(\.\d+))M$|i) {
my $vg = $1;
my $lv = $2;
$devmapper->{"/dev/$vg/$lv"} = [$vg, $lv];
What do you think?
We first thought it was a locale problem, but vzdump is explicitely using:
$ENV{LANG} = "C"; # avoid locale related issues/warnings
So I'm not sure what causes this, maybe it will still bug for some
strange locales.
Sincerely,
--
StalkR
More information about the pve-user
mailing list