195 | 195 |
free_space=$(partition_after $id)'
|
196 | 196 |
}
|
197 | 197 |
|
|
198 |
is_dm_multipath() {
|
|
199 |
dmtype=$(dm_table $device)
|
|
200 |
[ "$dmtype" = multipath ] || return 1
|
|
201 |
}
|
|
202 |
|
198 | 203 |
get_auto_disks() {
|
199 | 204 |
local dev device dmtype
|
200 | 205 |
|
201 | 206 |
for dev in $DEVICES/*; do
|
202 | 207 |
[ -d "$dev" ] || continue
|
203 | 208 |
|
204 | |
# Skip /dev/mapper/X (except multipath) devices and
|
205 | |
# RAID (/dev/md/X and /dev/mdX) devices
|
206 | 209 |
device=$(cat $dev/device)
|
|
210 |
|
|
211 |
# Skip software RAID (mdadm) devices (/dev/md/X and /dev/mdX)
|
207 | 212 |
$(echo "$device" | grep -Eq "/dev/md/?[0-9]*$") && continue
|
|
213 |
|
|
214 |
# Skip device mapper devices (/dev/mapper/)
|
208 | 215 |
if echo $device | grep -q "^/dev/mapper/"; then
|
209 | |
dmtype=$(dm_table $device)
|
210 | |
[ "$dmtype" = multipath ] || continue
|
|
216 |
# Except for dmraid or multipath devices
|
|
217 |
if [ -f "$dev/sataraid" ] || is_dm_multipath; then
|
|
218 |
:
|
|
219 |
else
|
|
220 |
continue
|
|
221 |
fi
|
211 | 222 |
fi
|
212 | 223 |
printf "$dev\t$(device_name $dev)\n"
|
213 | 224 |
done
|