summaryrefslogtreecommitdiff
path: root/bin
diff options
authorJeff Lane <jeffrey.lane@canonical.com>2017-02-23 17:08:30 -0500
committerSylvain Pineau <sylvain.pineau@canonical.com>2017-04-03 09:39:22 +0200
commitcbb6c97026767e2a5479c1148fcf62ae4e41e7fd (patch)
tree29c85520b6e1debd3f04c3b2fe70e052cfde576d /bin
parent7131e0c103293b13186f19eb4e3438cfc990c6bd (diff)
bin/disk_stress_ng: Warn and exit if disk is smaller than 10GiB because small disks tend to run out of space when testing. LP: #1667488
Diffstat (limited to 'bin')
-rwxr-xr-xbin/disk_stress_ng8
1 files changed, 7 insertions, 1 deletions
diff --git a/bin/disk_stress_ng b/bin/disk_stress_ng
index a47ab79..de96f46 100755
--- a/bin/disk_stress_ng
+++ b/bin/disk_stress_ng
@@ -151,9 +151,15 @@ mount_filesystem() {
fi
find_largest_partition
-
+
if [ -n "$largest_part" ] ; then
echo "Found largest partition: \"$largest_part\""
+ # If largest partition is too small, just abort with a message
+ if [ $largest_size -lt 10000000000 ] ; then
+ echo "Warning: $largest_part is less than 10GiB in size"
+ echo "Disk is too small to test. Aborting test!"
+ exit 1
+ fi
mount_point=$(df | grep "$largest_part " | tr -s " " | cut -d " " -f 6)
if [ "$mount_point" == "" ] && [ "$really_run" == "Y" ] ; then
disk_device=$(echo $disk_device | sed "s/\/dev\/\/dev/\/dev/g")