From d5c54ffffcfae3fd5d075d14cfe400379df973a4 Mon Sep 17 00:00:00 2001
From: James Chambers <05jchambers@gmail.com>
Date: Sat, 13 Aug 2022 14:04:11 -0600
Subject: [PATCH] Fix issue #23
---
README.md | 6 +++++-
Storage.sh | 4 ++--
2 files changed, 7 insertions(+), 3 deletions(-)
diff --git a/README.md b/README.md
index 9feff13..8112773 100644
--- a/README.md
+++ b/README.md
@@ -44,12 +44,16 @@ These are iozone and fio which are both benchmarking utilities and should be saf
Update History
+August 13th 2022
+
+ - Fixed findmnt failing when target is not a mountpoint (thanks mhaas, issue #23
+
+
June 27th 2022
- Fixed udevadm giving a message that option 'w' was missing on some versions -- now runs a fallback test without that option
-
June 24th 2022
- PC results now show in "Latest" and a "Top PC Scores" section has been added!
diff --git a/Storage.sh b/Storage.sh
index d29682b..06e7cb2 100644
--- a/Storage.sh
+++ b/Storage.sh
@@ -309,7 +309,7 @@ if [ -z "$ChosenPartition" ]; then
# User did not provide a partition/folder, continue with rootfs
# --Get system boot drive information--
# Find from mountpoint first
- BootDrive=$(findmnt -n -o SOURCE /)
+ BootDrive=$(findmnt -n -o SOURCE --target /)
# Find by matching device IDs to / next
if [ -z "$BootDrive" ]; then
@@ -339,7 +339,7 @@ if [ -z "$ChosenPartition" ]; then
BootDrive=$(df -H | grep -m 1 boot | awk 'NR==1{ print $1 }' | sed 's/\[\/\@\]//g')
fi
else
- BootDrive=$(findmnt -n -o SOURCE "$ChosenPartition" | sed 's/\[\/\@\]//g')
+ BootDrive=$(findmnt -n -o SOURCE --target "$ChosenPartition" | sed 's/\[\/\@\]//g')
fi
# Detect BootDrive suffix