Skip to content

BootDrive detection fails if ChosenPartition is not a mount point #23

Description

@mhaas

My mount looks like this:

pi@raspberrypi:~ $ mount | grep /mnt
/dev/sda8 on /mnt type ext4 (rw,relatime)

I want the Benchmark.sh script to run against a subdirectory:

sudo ./Storage.sh /mnt/benchmark

In this case, the hdparm results show as empty:

 Category Test Result HDParm Disk Read MB/s HDParm Cached Disk Read MB/s DD Disk Write 200 MB/s FIO 4k random read 21135 IOPS (84540 KB/s) FIO 4k random write 9706 IOPS (38824 KB/s) IOZone 4k read 34226 KB/s IOZone 4k write 26987 KB/s IOZone 4k random read 25565 KB/s IOZone 4k random write 34065 KB/s Score: 8905 

It seems the script does not handle the scenario where the path is not directly a mount point. This can be fixed by adding --target to findmnt to try harder to find the mount point by traversing the path:

 BootDrive=$(findmnt -n -o SOURCE --target "$ChosenPartition" | sed 's/\[\/\@\]//g')

This change is in line 342.

With this change in place:


Category Test Result HDParm Disk Read 308.37 MB/s HDParm Cached Disk Read 282.28 MB/s DD Disk Write 200 MB/s FIO 4k random read 20418 IOPS (81674 KB/s) FIO 4k random write 9687 IOPS (38751 KB/s) IOZone 4k read 29917 KB/s IOZone 4k write 26498 KB/s IOZone 4k random read 22388 KB/s IOZone 4k random write 29310 KB/s 

Thanks for providing this tool!

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions