lvm: add cache tools for dm-cache usage

(cherry picked from commit 70598ac292)
Harald Hoyer 2015-01-28 13:25:09 +00:00
parent 28be8992c3
commit 77ffc465b9
1 changed files with 13 additions and 6 deletions

View File

@ -107,12 +107,19 @@ install() {
dev=$(</sys/block/${dev#/dev/}/dm/name)
eval $(dmsetup splitname --nameprefixes --noheadings --rows "$dev" 2>/dev/null)
[[ ${DM_VG_NAME} ]] && [[ ${DM_LV_NAME} ]] || continue
if [[ "$(lvs --noheadings -o segtype ${DM_VG_NAME} 2>/dev/null)" == *thin* ]] ; then
inst_multiple -o thin_dump thin_restore thin_check thin_repair
break
fi
case "$(lvs --noheadings -o segtype ${DM_VG_NAME} 2>/dev/null)" in
*thin*|*cache*|*era*)
inst_multiple -o thin_dump thin_restore thin_check thin_repair \
cache_dump cache_restore cache_check cache_repair \
era_check era_dump era_invalidate era_restore
break;;
esac
done
else
inst_multiple -o thin_dump thin_restore thin_check thin_repair
fi

if ! [[ $hostonly ]]; then
inst_multiple -o thin_dump thin_restore thin_check thin_repair \
cache_dump cache_restore cache_check cache_repair \
era_check era_dump era_invalidate era_restore
fi
}