Re: Question regarding use of nosync with LVM mirrors/raid1 resizing

Zdenek Kabelac <[email protected]> Fri, 4 Jul 2025 14:24:05 +0200
Newsgroups gmane.linux.lvm.general
Message-ID <[email protected]>
Dne 03. 07. 25 v 11:02 Andrew Johnson napsal(a):
> Hello,
> 
> I have a script which handles the setup of mirror/raid1 volumes with
> LVM. My understanding is that the initial creation of the LV with
> nosync is perfectly acceptable if there's no data to sync (In this
> case there isn't as we haven't created the filesystem yet). However if
> I were to resize these later, suppose I resized the first PV and then
> the second and then the LV, would it be fine to set nosync when I
> resize the LV as there should be no data used on the new blocks of
> either of the resized PVs?
> 

Hi

lvm2 may possibly has some  'missing' corners here.

Main problem with 'nosync' is -  when you run synaction check|repair
you would get tons of problem - as the raid device itself does not keep any 
'map' about what was written or not - but many filesystems do have this info - 
so a filesystem may be quite well usable with such arrays.

So to create  'nosync'  arrays is rather for 'well informed' users who 
basically know what they are doing and what are the limitations -  normal 
users should stay with synchronized arrays to stay away of troubles.

lvm2 does support  'lvextend --nosync'  - however if you find some case where 
you would want to see different/better support - you need to prepare some bash 
example, where you explain, what is being done by upstream  'lvm2'  and what 
should/could be changed.

Your current description is kind of mixing  PVs  & LVs - so I'm not sure what 
they mean by 'resized first PV' -  as lvm2 is using  PVs - but never resizes 
them with lvresize command - we resize  raid leg LVs.  But I think we can 
figure this out from some 'bash'  example....

Regards

Zdenek