linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] Is "man lvcreate" for "-Z|--zero" incorrectly worded?
@ 2019-01-10  3:05 james harvey
  2019-01-10  9:31 ` Zdenek Kabelac
  0 siblings, 1 reply; 2+ messages in thread
From: james harvey @ 2019-01-10  3:05 UTC (permalink / raw)
  To: linux-lvm

On lvm2 2.02.183, man lvcreate includes:

-Z|--zero y|n
   Controls zeroing of the first 4KiB of data in the new LV.  Default
is y.  Snapshot COW volumes are always zeroed.  LV is not zeroed if
the read only flag is set.  Warning: trying to mount an unzeroed LV
can cause the system to hang.

This says only the "first 4KiB" is zeroed.

Yet, when running "lvcreate --chunksize <something large>", it says:

   WARNING: Pool zeroing and ###.00 MiB large chunk size slows down
thin provisioning.
   WARNING: Consider disabling zeroing (-Zn) or using smaller chunk
size (<512.00 KiB).

Which seems to indicate it's going to zero the entire newly allocated
chunk size, rather than only the first 4KiB.

The lvcreate warning goes more along with the purpose of zeroing, to
prevent reading data one shouldn't have access to.

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [linux-lvm] Is "man lvcreate" for "-Z|--zero" incorrectly worded?
  2019-01-10  3:05 [linux-lvm] Is "man lvcreate" for "-Z|--zero" incorrectly worded? james harvey
@ 2019-01-10  9:31 ` Zdenek Kabelac
  0 siblings, 0 replies; 2+ messages in thread
From: Zdenek Kabelac @ 2019-01-10  9:31 UTC (permalink / raw)
  To: LVM general discussion and development, james harvey

Dne 10. 01. 19 v 4:05 james harvey napsal(a):
> On lvm2 2.02.183, man lvcreate includes:
> 
> -Z|--zero y|n
>     Controls zeroing of the first 4KiB of data in the new LV.  Default
> is y.  Snapshot COW volumes are always zeroed.  LV is not zeroed if
> the read only flag is set.  Warning: trying to mount an unzeroed LV
> can cause the system to hang.
> 
> This says only the "first 4KiB" is zeroed.
> 
> Yet, when running "lvcreate --chunksize <something large>", it says:
> 
>     WARNING: Pool zeroing and ###.00 MiB large chunk size slows down
> thin provisioning.
>     WARNING: Consider disabling zeroing (-Zn) or using smaller chunk
> size (<512.00 KiB).
> 
> Which seems to indicate it's going to zero the entire newly allocated
> chunk size, rather than only the first 4KiB.
> 

Hi

With thin-pool and thin-volumes -   -Z  has slightly modified meaning.
User controls thin-pool zeroing - it's possible the information got
somewhat lost over the 'man page' rework where it's now fully generated
from the source code.

So with thin-pool --zero means whether zeroing is enabled or skipped for 
provisioned chunks.

With zeroing is skipped  (-Zn) -  there is still ALWAYS 'cleared' initial 
device header - otherwise such device would become unpredictable for the 
system - as unprovisioned chunks always return 'zero' - so i.e. udev device 
scanning may guess it's empty device and later upon write to first chunk - we 
must make sure that at least initial disk header will be zeroed.

That's why user cannot have control over traditional aka 'zeroing for linears' 
behavior here - and we 'overloaded' --zero setting to give it this meaning.

I hope this better explains it  - I'll try to enhance man page - meanwhile
check  'man lvmthin'  Zeroing.

Zdenek.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-01-10  9:31 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-10  3:05 [linux-lvm] Is "man lvcreate" for "-Z|--zero" incorrectly worded? james harvey
2019-01-10  9:31 ` Zdenek Kabelac

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).