From ef290e26156d9f55a5e2bc3fc265c81e82fa510a Mon Sep 17 00:00:00 2001 From: Harald Hoyer Date: Thu, 5 Dec 2013 15:57:42 +0100 Subject: [PATCH] lvm: install thin tools, only when needed in hostonly --- modules.d/90lvm/module-setup.sh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/modules.d/90lvm/module-setup.sh b/modules.d/90lvm/module-setup.sh index 7e3d44f..877631b 100755 --- a/modules.d/90lvm/module-setup.sh +++ b/modules.d/90lvm/module-setup.sh @@ -95,5 +95,11 @@ install() { inst_libdir_file "libdevmapper-event-lvm*.so" - inst_multiple -o thin_dump thin_restore thin_check thin_repair + if [[ $hostonly ]] && type -P lvs &>/dev/null; then + for dev in "${!host_fs_types[@]}"; do + if [[ "$(lvs --noheadings -o segtype "$dev" 2>/dev/null)" == *thin* ]] ; then + inst_multiple -o thin_dump thin_restore thin_check thin_repair + fi + done + fi }