Bug#804629: linux-image-amd64: Cannot mount LVM RAID1 file system at boot

Jarek Kamiński Jarek at Freeside.be
Fri Mar 24 10:28:01 UTC 2017


Hello,

W dniu 22.03.2017 o 00:34, SW Riccardo Scartozzi pisze:
> I was experiencing the same issue as describe in this bug report and, as
> pointed by Harrison Metzger, the bug was probably introduced after
> kernel 3.16-3-amd64 because for sure it was working until that version.
> 
> I don't get what causes the problem. It could be interesting to test if
> the problem is affect only if the mirror is a type raid1 or also if it
> is a type "mirror" (legacy). I don't know neighter if there is a problem
> while shutting down (is it the same if the OS reboot or it before
> rebooting the mirror is deactivate?).

So, I did some time ago some checking on this, but was diverted to other
kernel issue and forgot to report back here :-/

The issue is fixed in recent kernels. I checked back to 4.4 or 4.5 and
it was working there, so it's fixed already for some time.

The legacy mirror is not affected, only raid1. The steps to reproduce are:
lvcreate -L 100M --type raid1 -m 1 -n test-raid
lvchange -an test-raid
lvchange -ay test-raid

and it either works or not. On 3.16.39-1+deb8u2 I'm getting:
  device-mapper: reload ioctl on  failed: Zły argument
and in dmesg:
#v+
[1000636.943873] mdX: invalid bitmap file superblock: bad magic
[1000636.943879] mdX: bitmap file superblock:
[1000636.943882]          magic: 00000000
[1000636.943884]        version: 0
[1000636.943887]           uuid: 00000000.00000000.00000000.00000000
[1000636.943888]         events: 19
[1000636.943890] events cleared: 2
[1000636.943892]          state: 00000000
[1000636.943893]      chunksize: 524288 B
[1000636.943895]   daemon sleep: 5s
[1000636.943897]      sync size: 102400 KB
[1000636.943898] max write behind: 0
[1000636.943902] mdX: failed to create bitmap (-22)
[1000636.944003] device-mapper: table: 253:48: raid: Fail to run raid array
[1000636.944006] device-mapper: ioctl: error adding target to table
#v-

On recent kernels it just works.

> But the funniest thing is that if you activate lvmetad (switch to option
> "use_lvmetad = 1" in /etc/lvm/lvm.conf) the lvm with mirror type as
> raid1 starts to work again after reboot (at least tested on squeeze
> Linux 4.9.0-0.bpo.2-amd64 #1 SMP Debian 4.9.13-1~bpo8+1 (2017-02-27)
> x86_64 GNU/Linux). I don't know why nor it seem documented. Hope that
> this will save some headache to you as well.

I wasn't changing any lvmetad settings at all. However, if you create a
volume on a working kernel, like 4.9, it works fine on 3.16 as well.

I believe the bug can be closed now.


-- 
pozdr(); // Jarek



More information about the pkg-lvm-maintainers mailing list