Does command `lvs` and `vgs` run regularly

Howe

New Member
Jul 17, 2018
3
0
1
34
Hello friends. I am a new user to use proxmox. And I try to use `hdparm` to let my hard driver(WD RED Driver) sleep for a setup spin down time. But finally it doesn't work. And I try to force spin dowm like this,

Code:
root@proxmox:~# hdparm -C /dev/sda

/dev/sda:
 drive state is:  active/idle
root@proxmox:~# hdparm -Y /dev/sda

/dev/sda:
 issuing sleep command
root@proxmox:~# hdparm -y /dev/sda

/dev/sda:
 issuing standby command
root@proxmox:~# hdparm -C /dev/sda

/dev/sda:
 drive state is:  active/idle

Emm, not work too.

After that, I use IO chek tool and it display like this (It execute `lvs` and `vgs` 15 times each loop so I delete the same display, ),

Code:
root@proxmox:~# ./iosnoop -t -d 8,0
Tracing block I/O. Ctrl-C to end.
ENDs            COMM         PID    TYPE DEV      BLOCK        BYTES     LATms
195426.442044   vgs          21355  R    8,0      0            4096       0.10
...
195426.586587   lvs          21356  R    8,0      0            4096       0.11
...
195435.672255   vgs          21368  R    8,0      0            4096       0.12
...
195435.817507   lvs          21370  R    8,0      0            4096       0.08
...
195445.898208   vgs          21380  R    8,0      0            4096       0.09
...
195446.038413   lvs          21381  R    8,0      0            4096       0.09
...

It look regulary each 10s. So does this job will stop my driver's spindown. Or How can I do if I want my hard driver to spin down?

Thanks and best regards.
 
It is strange to use disk sleep on a hypervisor.
Thank your for your reply. and yes you are right. But I use like this because I want to put a single disk to a VM and this VM I use to be a NAS so it doesn't need to read/write my driver full time:)
 
Yes, Proxmox runs this command regularly to check status of storage on the host.
I do not know, if you can turn it off without side effects.
 
Yes, Proxmox runs this command regularly to check status of storage on the host.
I do not know, if you can turn it off without side effects.
Yep. Can you please tell me how to turn it off or give me some document about this? Thanks a lot
 
I know this is an old thread but I figured I will post a solution I found for those who would like to lower case temps and save a few watts by spinning down drives.

As evidenced in the screenshot above I found that every 10 seconds commands 'lvs' and 'vgs' are issued on the host which prevents drive spin-down. In my case all of the drives except 1 are part of 2 zfs pools and do not need to be scanned by 'lvs' and 'vgs' - which by default look at all block devices found in /dev.

The solution for me was to edit /etc/lvm/lvm.conf and add drives I do not want scanned to the filter section - first line was already there and I added ones starting with /dev/sdb:

Code:
        global_filter = [ "r|/dev/zd.*|", "r|/dev/mapper/pve-.*|" "r|/dev/mapper/.*-(vm|base)--[0-9]+--disk--[0-9]+|",
                "r|/dev/sdb|","r|/dev/sdb.|",
                "r|/dev/sdc|","r|/dev/sdc.|",
                "r|/dev/sdd|","r|/dev/sdd.|",
                "r|/dev/sde|","r|/dev/sde.|",
                "r|/dev/sdf|","r|/dev/sdf.|",
                "r|/dev/sdg|","r|/dev/sdg.|"]

After this change I do not see read block requests for those devices for neither 'lvs' or 'vgs' commands.
 
  • Like
Reactions: chrcoluk