File: multipath_flag

package info (click to toggle)
partman-multipath 9
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 52 kB
  • sloc: sh: 35; makefile: 2
file content (19 lines) | stat: -rwxr-xr-x 373 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh

# This script sets the multipath flag for multipath'ed devices

for dev in /var/lib/partman/devices/*; do
	[ -d "$dev" ] || continue
	cd $dev

	[ -f device ] || continue
	for frdisk in $(multipath -l | grep '^mpath[0-9]\+ ' | sed 's/\(mpath[0-9]\+\) .*/\1/'); do
		case $(cat device) in
			/dev/mapper/$frdisk)
				>multipath
				break
				;;
		esac
	done
done