#!/bin/sh

#in MB
SIZE=5000

DEV=/dev/hda8
MP=/media/testdev

mount $DEV $MP

echo "Creating file.. "
dd if=/dev/zero of=$MP/file bs=1M count=$SIZE

echo "Starting to remove file (background)"
rm $MP/file &

echo "Trying to umount (background)"
( while ! umount $MP; do sleep 1; done) &
wait
