gopsutil icon indicating copy to clipboard operation
gopsutil copied to clipboard

Discover Unmounted Disks with no partitions

Open jgautam opened this issue 6 years ago • 2 comments

Disk package There is no way to list all disks that are not yet mounted. Ideally the structure should be to list disks and for each disks, there should be a list of partitions which maybe empty. Currently we only get a flat list of partitions and don't get information about unmounted disks

jgautam avatar Jul 10 '19 05:07 jgautam

Might be doable with /sys/block/*/stat on Linux (and parsing of diskutil on darwin) https://stackoverflow.com/a/46637611
This link has some hints also https://unix.stackexchange.com/a/4563

For Windows https://stackoverflow.com/a/37346879 (other interesting answers also).

Lomanic avatar Jul 16 '19 18:07 Lomanic

Came here to ask for this. I pass the raw disk list into smartctl to gather disk data like power on hours, temperature and smart status. This library is unable to find those disks if they're not mounted (or in a mdadm raid). Resorting to other means. :)

davidnewhall avatar Mar 02 '21 01:03 davidnewhall