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
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
|
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
Wednesday, 06 July 2016, 10:41 GMT
Reason for closing: Implemented
Additional comments about closing: lvm2 2.02.159-2
[1] https://github.com/jthornber/linux-2.6/blob/thin-stable/Documentation/device-mapper/thin-provisioning.txt
./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.
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
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.
$ 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.
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.
The package has been updated but it is still not fixed.
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.