when to vgscan/pvscan/lvscan
Hi.
(Talking always about lvm2...)
Is there a real technical difference between pvscan, vgscan and lvscan? I mean as far as I understand one always needs all information about PVs,VGs and LVs in order to get the later.
So apart from different textual "debug" output, do all the same, i.e. scanning over all configured block devices, looking for PVs and scanning their VG-descriptors in order to get the information about al LVs?
Is there ever the need to rund pvscan/vgscan/lvscan manually and if so in which cases? I mean the vgscan manpage says that this happens automatically in lvm2, so if I e.g. have my init-scripts and want to make the LVs available, is it generally enough to do vgchange -an
or can there be cases when the preceding vgscan is still required?
Thanks,
Philippe.
The code is supposed to auto-detect changes, but there are still (mostly obscure) ways that confuse it.
The safest approach if you want to remove the vgscan at boot is to specify the precise VGs you want to activate by name on the vgchange command line instead of letting it default to 'all'.
So 'vgchange -ay root_vg home_vg' etc. instead of 'vgchange -ay'.
Then it knows what VGs are supposed to be there, and if it didn't think it needed to scan but doesn't see one or more of them that'll be enough to trigger the scan.
Alasdair