diff options
author | Jeff Lane <jeffrey.lane@canonical.com> | 2017-02-23 17:08:30 -0500 |
---|---|---|
committer | Jeff Lane <jeffrey.lane@canonical.com> | 2017-02-23 17:08:30 -0500 |
commit | 68aaa79e797742ca87fb27ab844c16b107c24e94 (patch) | |
tree | a0e72e68d5b2608ba4191df4eda9f5af18c9799b | |
parent | b8e5fb6158ef5ee9b819228aee58266a3b23506b (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
-rwxr-xr-x | bin/disk_stress_ng | 8 |
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") |