#!/bin/sh

# This script activates multipath partitions
# before the md/lvm-devices scripts, so that
# LVM PVs may be used with multipath devices.

# Activate multipath partitions if it was not done before
if [ ! -f /var/lib/partman/multipath ] \
&& [ "$(udpkg --print-os)" = linux ] ; then

	for mpath in $(multipath -l -v1); do
		kpartx -a /dev/mapper/$mpath
	done

	update-dev --settle >/dev/null 2>&1

	touch /var/lib/partman/multipath
fi

exit 0

