Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
mhaas opened this issue Aug 13, 2022 · 1 comment
Closed

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

mhaas opened this issue Aug 13, 2022 · 1 comment
Assignees

Comments

@mhaas
Copy link

mhaas commented Aug 13, 2022

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!

TheRemote added a commit that referenced this issue Aug 13, 2022
@TheRemote
Copy link
Owner

TheRemote commented Aug 13, 2022

Oh wow, that is a fantastic find, thanks for sharing this!

It's really hard to figure out why some of these tests fail from my end. It tries to submit whatever it's able to do but some of them are really tough. Who knows how many others have failed for this exact reason in the past.

I've implemented this change live now. Thanks again!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants