#!/bin/bash # Umount all filesystems mounted over the device DEVICE="$1" [ -b "$DEVICE" ] || exit 1 DEVICES="$(df -T | grep -s ^"/dev/sdc" | sed -e "s/.*%[[:blank:]]*//g")" if [ -n "$DEVICES" ] ; then umount -l "${DEVICES}" 2>1 >/dev/null fi exit 0