Commit 841c6823 authored by Natanael Copa's avatar Natanael Copa

setup-disk: check if the devce itself is mounted

this will filter out loop0 device
parent f0f794a6
......@@ -149,6 +149,7 @@ has_mounted_part() {
# parse /proc/mounts for mounted devices
for p in $(awk '$1 ~ /^\/dev\// {gsub("/dev/", "", $1); print $1}' \
/proc/mounts); do
[ "$p" = "$1" ] && return 0
[ -e /sys/block/$1/$p ] && return 0
done
return 1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment