#
# Copyright (C) 2007 Karel Zak <kzak@redhat.com>
#
-# This file is part of util-linux-ng.
+# This file is part of util-linux.
#
# This file is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
mkfs.ext3 $DEVICE &> /dev/null || ts_die "Cannot make ext3 on $DEVICE" $DEVICE
-ts_device_has "TYPE" "ext3" $DEVICE || ts_die "Cannot found ext3 on $DEVICE" $DEVICE
+ts_device_has "TYPE" "ext3" $DEVICE || ts_die "Cannot find ext3 on $DEVICE" $DEVICE
[ -d "$TS_MOUNTPOINT" ] || mkdir -p $TS_MOUNTPOINT
$TS_CMD_MOUNT $DEVICE $TS_MOUNTPOINT 2>&1 >> $TS_OUTPUT
-ts_is_mounted $DEVICE || ts_die "Cannot found $DEVICE in /proc/mounts" $DEVICE
+ts_is_mounted $DEVICE || ts_die "Cannot find $DEVICE in /proc/mounts" $DEVICE
+
+grep -q $DEVICE /etc/mtab ||
+ echo "mount failed: cannot find $DEVICE in mtab" >> $TS_OUTPUT 2>&1
$TS_CMD_UMOUNT $DEVICE || ts_die "Cannot umount $DEVICE" $DEVICE
+grep -q $DEVICE /etc/mtab &&
+ echo "umount failed: found $DEVICE in mtab" >> $TS_OUTPUT 2>&1
+
ts_device_deinit $DEVICE
ts_log "Success"