Filter loop devices in disk stats

This commit is contained in:
Sophie Tauchert 2018-12-03 10:55:39 +01:00
parent 1ab25d0f16
commit 40260a8e04
No known key found for this signature in database
GPG Key ID: 52701DE5F5F51125

View File

@ -57,6 +57,10 @@ func (self *Disk) update() {
// add partition if it's new
for _, Part := range Partitions {
device := strings.Replace(Part.Device, "/dev/", "", -1)
// don't show loop devices
if strings.HasPrefix(device, "loop") {
continue
}
if _, ok := self.Partitions[device]; !ok {
// https://github.com/shirou/gopsutil/issues/555
// have to remove artifacts produced by gopsutil when there's a space in the mount path