I am using OSHI https://github.com/oshi/oshi to monitor the hardware.
There is a method
HWDiskStore[] getDisks();
https://github.com/o
The DiskStore is a hardware object (e.g., hard drive, SSD, etc.) which is part of the machinery, while the FileStore is a software object associated with the Operating System / File System.
OSHI's HWDiskStore
objects have a getPartitions() method, which returns an array of HWPartition
objects. These objects have a getMountPoint() method which should be a String
corresponding to the OSFileStore
mount point.
OSHI's OSFileStore
objects correspond to the Java FileStore
objects and have a getMount() method which should directly match the HWPartition
mount point.
This demo class gives an example of how this information can be correlated.