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?

Jim
  • 33

1 Answers1

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)"
steeldriver
  • 142,475