Somewhere during 4.16 development (precisely, in https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=721c7fc701c71f693307d274d2b346a1ecd4a534) a change had been made that broke readonly snaphots. This have been fixed in lvm2-2.02.178. However, this (nor any newer) version is not available in portage tree right now. So right now users on >4.16 kernel (which is currently unstable in gentoo-sources, fortunately) are stuck with broken read-only LVM snapshots. Reproducible: Always Steps to Reproduce: 1. Have Linux kernel >= 4.16 (currently unstable) 2. Have <sys-fs/lvm2-2.02.178 installed (the only versions existing right now in theb main portage tree) 3. Try to create readonly snapshot: `lvcreate --size 5G --snapshot --name snap0 --permission r /dev/mapper/vg0-lvol_rootfs` Actual Results: + lvcreate --size 5G --snapshot --name snap0 --permission r /dev/mapper/vg0-lvol_rootfs device-mapper: create ioctl on vg0-snap0-cowLVM-sDdIeh9cecWdaNyRfZC31mxgfwTa4sOeHMJXVOykGVRtfP6Aii7IHvwS066AOLOM-cow failed: Device or resource busy Failed to lock logical volume vg0/lvol_rootfs. Aborting. Manual intervention required. + dmesg [ 26.145279] generic_make_request: Trying to write to read-only block-device dm-3 (partno 0) [ 26.145288] device-mapper: persistent snapshot: write_header failed [ 26.145847] device-mapper: table: 253:4: snapshot: Failed to read snapshot metadata [ 26.145851] device-mapper: ioctl: error adding target to table Expected Results: + lvcreate --size 5G --snapshot --name snap0 --permission r Logical volume "snap0" created. https://marc.info/?l=linux-block&m=153321277802520&w=2 https://bugzilla.kernel.org/show_bug.cgi?id=200439
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=8824d7cd4c9edd30b727559ecc5fb0e8d985b7dd commit 8824d7cd4c9edd30b727559ecc5fb0e8d985b7dd Author: Robin H. Johnson <robbat2@gentoo.org> AuthorDate: 2018-08-04 21:45:48 +0000 Commit: Robin H. Johnson <robbat2@gentoo.org> CommitDate: 2018-08-04 22:10:46 +0000 sys-fs/lvm2: bump to 2.02.181 Fixes: https://bugs.gentoo.org/631016 Fixes: https://bugs.gentoo.org/662650 Package-Manager: Portage-2.3.40, Repoman-2.3.9 Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> sys-fs/lvm2/Manifest | 1 + .../files/lvm2-2.02.176-pthread-pkgconfig.patch | 29 ++ sys-fs/lvm2/files/lvm2-2.02.178-asneeded.patch | 15 ++ .../lvm2-2.02.178-dynamic-static-ldflags.patch | 59 ++++ .../lvm2/files/lvm2-2.02.178-example.conf.in.patch | 50 ++++ .../lvm2-2.02.178-static-pkgconfig-libs.patch | 102 +++++++ sys-fs/lvm2/lvm2-2.02.181.ebuild | 299 +++++++++++++++++++++ 7 files changed, 555 insertions(+)