3

I want to test the read speed on an Ubuntu Server hard drive like one would do with hdparm -t, but I need to automatically this on multiple machines where I don't know beforehand what dev the main HDD is, so I can't just hdparm -t /dev/sda. I would like to be able to run it on the home folder or on the hard drive containing it, if there's a way to do that in bash.

Any ideas?

3

You could use findmnt -T ex.

$ findmnt -T /home
TARGET SOURCE    FSTYPE OPTIONS
/home  /dev/sda6 ext4   rw,relatime,data=ordered

or to extract just the block device

$ findmnt -no SOURCE -T /home
/dev/sda6

To use it with hdparm:

hdparm -t "$(findmnt -no SOURCE -T /home)"
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.