FS#32884 - [lvm2] Enable LVM thin-provisioning

Attached to Project: Arch Linux
Opened by Chris Taylor (headmastersquall) - Tuesday, 27 November 2012, 17:01 GMT
Last edited by Christian Hesse (eworm) - Wednesday, 06 July 2016, 10:41 GMT
Task Type Feature Request
Category Packages: Core
Status Closed
Assigned To Eric Belanger (Snowman)
Thomas Bächler (brain0)
Christian Hesse (eworm)
Bartłomiej Piotrowski (Barthalion)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 7
Private No

Details

Description:
Add support for thin-provisioning in the Arch LVM2 package.

Additional info:
*Thin provisioning has been available since version 2.02.89
*Add the option --with-thin=internal to the PKGBUILD
*thin-provisioning-tools from https://github.com/jthornber/thin-provisioning-tools may be required to build this feature
*This is a new feature and upstream reports it being 100% complete. It may still be in experimental stages though


Steps to reproduce:
If I try to build the package myself by adding the --with-thin=internal to the PKGBUILD from ABS, I get an error saying "configure: error: thin_check not found in path". I believe the thin-provisioning-tools must be compiled and installed for this to build.
This task depends upon

Closed by  Christian Hesse (eworm)
Wednesday, 06 July 2016, 10:41 GMT
Reason for closing:  Implemented
Additional comments about closing:  lvm2 2.02.159-2
Comment by Malaclypse (malaclypse) - Thursday, 27 December 2012, 20:18 GMT
Yes, please add thin provisioning support to the LVM2 tools. The Linux Kernel provides the according device mapper targets since Version 3.2 [1].

[1] https://github.com/jthornber/linux-2.6/blob/thin-stable/Documentation/device-mapper/thin-provisioning.txt
Comment by Thomas Bächler (brain0) - Saturday, 09 February 2013, 18:08 GMT
I fail to find any release tarballs on the thin provisioning tools, or a homepage, or any overview of releases for that matter.
Comment by Malaclypse (malaclypse) - Sunday, 03 March 2013, 21:33 GMT
There is no need to use external tools for using thin provisioned lvm pools. Just using

./configure --with-thin=internal --enable-dmeventd --enable-cmdlib

is enough to be able to create and delete thin provisioned pools and volumes, and take snapshots of these. Of course, other needed configure flags should be added as well.
Comment by Jason Hall (cakersq) - Thursday, 06 June 2013, 23:06 GMT
I have created a patch (lvm2.udiff) for LVM2 package, and created the thin-provisioning-tools PKGBUILD to include the thin_check binaries (Edit: Uploaded to AUR https://aur.archlinux.org/packages/thin-provisioning-tools/).

I have tested this on an ArchISO CD, creating a Thinly Provisioned root partition, and booting from it.

Changes are:
PKGBUILD:
- Increment Package Release
- Add thin-provisioning-tools to depends and makedepends
- Add --with-thin=internal to ./configure parameters
- Update SHA1 Sum for lvm2_install
lvm2_install (for mkinitcpio):
- Add dm-thin-pool module
- Add thin_check binary
Comment by Eric Belanger (Snowman) - Wednesday, 25 September 2013, 16:51 GMT
There is is releases tarball on github: https://github.com/jthornber/thin-provisioning-tools/releases
We could use that for the package. I am working on updating lvm2. I could implement this (I don't plan using this feature though) if there are no objections.
Comment by Eric Belanger (Snowman) - Saturday, 28 September 2013, 23:16 GMT
lvm2 2.02.102-1 in [testing] has thin-provisioning support.
Comment by Olivier Médoc (oliv) - Tuesday, 08 December 2015, 15:11 GMT
  • Field changed: Percent Complete (100% → 0%)
As shown below, the specific lvm thin provisionning modules are not installed in the initramfs when running mkinitramfs:

$ cat /usr/lib/initcpio/install/lvm2 |grep mod
local mod
for mod in dm-mod dm-snapshot dm-mirror dm-cache dm-cache-mq; do
add_module "$mod"

The module dm-thin-pool is missing in this list, which make archlinux unable to mount a thin provisionned lvm root system. I tested the change and it allowed to detect correctly the thin provisionned volume and to boot.

As sugested by the author of the patch, the binary thin_check should also been added to the initramfs.
Comment by James Harvey (jamespharvey20) - Saturday, 02 January 2016, 23:36 GMT
Spent a bunch of time on this, before running across this page.

lvm2_install never got "dm-thin-pool" added to the for mod in line, nor did it get the 'add_binary "/usr/bin/thin_check"' line.

Adding those and re-running mkinitcpio lets me boot.
Comment by Olivier Médoc (oliv) - Thursday, 14 April 2016, 16:20 GMT
Hello,

The package has been updated but it is still not fixed.
Comment by Stefan Haller (fgrsnau) - Sunday, 08 May 2016, 09:29 GMT
Todays update added the dm-thin-pool module to the initramrd.

Unfortunately there are some parts missing, because my system is unable to start the lvm2-pvscan@.service unit (I use sd-lvm2, btw):

May 08 10:40:37 localhost systemd[1]: Starting LVM2 PV scan on device 8:2...
May 08 10:40:38 localhost lvm[123]: /usr/bin/thin_check: execvp failed: No such file or directory
May 08 10:40:38 localhost lvm[123]: Check of pool VG/VM-Pool failed (status:2). Manual repair required!
May 08 10:40:38 localhost lvm[123]: /usr/bin/thin_check: execvp failed: No such file or directory
May 08 10:40:38 localhost lvm[123]: /usr/bin/thin_check: execvp failed: No such file or directory
May 08 10:42:08 localhost systemd[1]: lvm2-pvscan@8:2.service: State 'stop-sigterm' timed out. Killing.
May 08 10:42:08 localhost systemd[1]: lvm2-pvscan@8:2.service: Main process exited, code=killed, status=9/KILL

I tried adding "add_binary /usr/bin/thin_check" to /usr/lib/initcpio/install/sd-lvm2 but the unit is still failing:
May 08 10:59:22 localhost systemd[1]: Starting LVM2 PV scan on device 8:2...
May 08 10:59:24 localhost lvm[125]: Child 175 exited abnormally
May 08 10:59:24 localhost lvm[125]: Check of pool VG/VM-Pool failed (status:-1). Manual repair required!
May 08 11:00:54 localhost systemd[1]: lvm2-pvscan@8:2.service: State 'stop-sigterm' timed out. Killing.
May 08 11:00:54 localhost systemd[1]: lvm2-pvscan@8:2.service: Main process exited, code=killed, status=9/KILL

My root partition is not located on a thin-provising volume, but other filesystems are. The system is able to boot and only some units fail. After restarting the unit lvm2-pvscan@8:2 manually everything works fine. I don’t know the cause of the exact problem, but downgrading to lvm2-2.02.149-1 works for me.

Loading...