[lvm-devel] Batch/queue LVM operations
Zdenek Kabelac
zkabelac at redhat.com
Tue Aug 1 18:39:20 UTC 2017
Dne 1.8.2017 v 19:46 Zdenek Kabelac napsal(a):
> Dne 1.8.2017 v 19:24 Eric Wheeler napsal(a):
>> On Fri, 28 Jul 2017, Zdenek Kabelac wrote:
>>
>>> Dne 28.7.2017 v 21:22 Eric Wheeler napsal(a):
>>>> Hello,
>>>>
>>>> Is there an option to batch LVM operations?
>>>>
>>>> For example, I would like to delete 100 thin snapshots without updating
>>>> the vgmeta 100 times.
>>>
>>> You could possibly use --select feature to handle all removals with
>>> just one lvremove command.
>>
>> I tried --select, but there is a long pause between removals so it is
>> clearly doing a metadata operation for each removal.
>>
>> Is it possible to do something like this:
>>
>> 1. Hold a lock (how?)
>> 2. vgcfgbackup -f /my-backup/file --ignorelocking-failure
>> 3. Modify /my-backup/file (remove LVs)
>> 4. dmsetup message pool 0 delete ID (each ID)
>> 5. vgcfgrestore --ignorelocking-failure
>> 6. Release lock
>>
Also what is probably worthy exercise:
If you have thinLVs you want to 'remove' -
Deactivate all such LVs in one 'lvchange -an' command upfront.
Then as next step remove all such LVs with one 'lvremove' command.
Take a timed 'strace -ttt' and measure how much time is spend in actual
'ioctl' and compare with the remaining time spend in lvm2 processing.
Then summarize the output and your time-expectation - possibly open RFE BZ
for it.
Regards
Zdenek
More information about the lvm-devel
mailing list