|
@@ -8,6 +8,11 @@ check_device()
|
|
|
if [ ! -b ${DEVICE} ] ; then
|
|
|
fatal ${NOTBLK_E} "${DEVICE} is not a block file"
|
|
|
fi
|
|
|
+ MAJOR=$(echo $(mountpoint --devno "${DEVICE}") | awk -F: '{print $1}')
|
|
|
+ MINOR=$(echo $(mountpoint --devno "${DEVICE}") | awk -F: '{print $2}')
|
|
|
+ if [ $MAJOR -ne 254 ] && [ $MAJOR -ne 8 ] || [ $(($MINOR % 16)) -ne 0 ]; then
|
|
|
+ fatal ${WRONGBLK_E} "${DEVICE} is not a regular disk"
|
|
|
+ fi
|
|
|
if grep --quiet "${DEVICE}" /proc/mounts ; then
|
|
|
fatal ${ISMOUNT_E} "${DEVICE} is mounted"
|
|
|
fi
|