OpenMediaVault-Plugin-Developers / openmediavault-autoshutdown

OpenMediaVault plugin to provide frontend for autoshutdown script
37 stars 31 forks source link

Fix issue HDDIO only look for sda #24 #54

Closed pionicus closed 3 years ago

pionicus commented 5 years ago

I encountered the same issue using a LVM. Devices that are part of a volume group are not taken into account by the _check_hddio() function. I found a solution using the lsblk command keeping as close as the original command line in the for loop.

ryecoaaron commented 5 years ago

Looking at the code, I think it should just loop though the output of iostat because it is simpler and an operation maybe doing something to a drive that isn't mounted. I can't test this but what about changing the loop to:

while read OMV_HDD OMV_ASD_HDD_IN OMV_ASD_HDD_OUT; do

...

done < <(iostat -kd | tail -n +4 | awk '{ print $1 " " $5 " " $6}')

nrandon commented 3 years ago

fixed obolsete