linux-lvm.redhat.com archive mirror
 help / color / mirror / Atom feed
* [linux-lvm] devices/dir configuration option in /etc/lvm/lvm.conf can be edited?
@ 2019-10-14  8:00 Gang He
  2019-10-14 10:39 ` Zdenek Kabelac
  0 siblings, 1 reply; 6+ messages in thread
From: Gang He @ 2019-10-14  8:00 UTC (permalink / raw)
  To: linux-lvm

Hello List,

By default, devices/dir configuration option in /etc/lvm/lvm.conf is "=/dev".
But, if I edit this configuration option, e.g. dir = "/dev/lvm", then lvcreate command will fail.

sles12sp4-node:/dev # lvcreate -L2G -ay -n testlv vgdata
  /dev/lvm/vgdata/testlv: not found: device not cleared
  Aborting. Failed to wipe start of new LV.

I am using lvm 2.02.183(or 180), this option can be edit individually? 
or any other option will affect this option, then lead to lvcreate failure.

Thanks
Gang

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

* Re: [linux-lvm] devices/dir configuration option in /etc/lvm/lvm.conf can be edited?
  2019-10-14  8:00 [linux-lvm] devices/dir configuration option in /etc/lvm/lvm.conf can be edited? Gang He
@ 2019-10-14 10:39 ` Zdenek Kabelac
  2019-10-14 10:52   ` Gang He
  0 siblings, 1 reply; 6+ messages in thread
From: Zdenek Kabelac @ 2019-10-14 10:39 UTC (permalink / raw)
  To: LVM general discussion and development, Gang He

Dne 14. 10. 19 v 10:00 Gang He napsal(a):
> Hello List,
> 
> By default, devices/dir configuration option in /etc/lvm/lvm.conf is "=/dev".
> But, if I edit this configuration option, e.g. dir = "/dev/lvm", then lvcreate command will fail.
> 
> sles12sp4-node:/dev # lvcreate -L2G -ay -n testlv vgdata
>    /dev/lvm/vgdata/testlv: not found: device not cleared
>    Aborting. Failed to wipe start of new LV.
> 
> I am using lvm 2.02.183(or 180), this option can be edit individually?
> or any other option will affect this option, then lead to lvcreate failure.

Hi

The option is not so easy to explain:

In the first place on a today's system you shall never ever need to change 
this setting - as majority of systems runs 'udev' or something similar in a 
fixed position /dev.

So symlinks & devices appears at this directory (and without 'lvm2' direct 
work) only as a consequence of configured udev rules.

So now surely comes the obvious question -  why the 'setting' even exists when 
you should always use '/dev' anyway right ;) ?

And here the answer is longer -  lvm2 is very 'oldish' project from 'dark' era 
before udev took control over devices - and in this old era you could have 
configured different device directory for devices created by lvm2 - since it's 
been lvm2 physically creating these devices.

The usability for normal users is relatively questionable since almost every 
user wants his devices in /dev dir anyway, but couple wanted to maintain 
separate dir for lvm2 devices.

The 'other' use-case is for testing - where i.e. lvm2 test suite is/(or was) 
able to run its tests in completely isolated device directory.

But to be able to use this 'capability' - one has to enable other lvm.conf 
setting:  'activation/verify_udev_operations=1'  - when enabled lvm2 will 
ensure devices are in give directory.

But !!!! (and it's BIG BUT) this shall never be enabled on a system with 
running udevd and /dev  dir set - as basically nothing else then udevd is 
supposed to be creating anything in /dev dir.

So hopefully this explains most of the question you may have about this setting.

Regards

Zdenek

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

* Re: [linux-lvm] devices/dir configuration option in /etc/lvm/lvm.conf can be edited?
  2019-10-14 10:39 ` Zdenek Kabelac
@ 2019-10-14 10:52   ` Gang He
  2019-10-14 10:55     ` Zdenek Kabelac
  2019-10-14 13:19     ` Alasdair G Kergon
  0 siblings, 2 replies; 6+ messages in thread
From: Gang He @ 2019-10-14 10:52 UTC (permalink / raw)
  To: Zdenek Kabelac, LVM general discussion and development

Hi Zdenek,

Thanks for explaining.
That means we should tell the user, you should not edit this option (dir = "/dev") in the lvm.conf, right?

Thanks
Gang

> -----Original Message-----
> From: Zdenek Kabelac [mailto:zkabelac@redhat.com]
> Sent: 2019��10��14�� 18:40
> To: LVM general discussion and development <linux-lvm@redhat.com>; Gang
> He <GHe@suse.com>
> Subject: Re: devices/dir configuration option in /etc/lvm/lvm.conf can be
> edited?
> 
> Dne 14. 10. 19 v 10:00 Gang He napsal(a):
> > Hello List,
> >
> > By default, devices/dir configuration option in /etc/lvm/lvm.conf is "=/dev".
> > But, if I edit this configuration option, e.g. dir = "/dev/lvm", then lvcreate
> command will fail.
> >
> > sles12sp4-node:/dev # lvcreate -L2G -ay -n testlv vgdata
> >    /dev/lvm/vgdata/testlv: not found: device not cleared
> >    Aborting. Failed to wipe start of new LV.
> >
> > I am using lvm 2.02.183(or 180), this option can be edit individually?
> > or any other option will affect this option, then lead to lvcreate failure.
> 
> Hi
> 
> The option is not so easy to explain:
> 
> In the first place on a today's system you shall never ever need to change this
> setting - as majority of systems runs 'udev' or something similar in a fixed
> position /dev.
> 
> So symlinks & devices appears at this directory (and without 'lvm2' direct
> work) only as a consequence of configured udev rules.
> 
> So now surely comes the obvious question -  why the 'setting' even exists
> when you should always use '/dev' anyway right ;) ?
> 
> And here the answer is longer -  lvm2 is very 'oldish' project from 'dark' era
> before udev took control over devices - and in this old era you could have
> configured different device directory for devices created by lvm2 - since it's
> been lvm2 physically creating these devices.
> 
> The usability for normal users is relatively questionable since almost every
> user wants his devices in /dev dir anyway, but couple wanted to maintain
> separate dir for lvm2 devices.
> 
> The 'other' use-case is for testing - where i.e. lvm2 test suite is/(or was) able to
> run its tests in completely isolated device directory.
> 
> But to be able to use this 'capability' - one has to enable other lvm.conf
> setting:  'activation/verify_udev_operations=1'  - when enabled lvm2 will
> ensure devices are in give directory.
> 
> But !!!! (and it's BIG BUT) this shall never be enabled on a system with running
> udevd and /dev  dir set - as basically nothing else then udevd is supposed to
> be creating anything in /dev dir.
> 
> So hopefully this explains most of the question you may have about this
> setting.
> 
> Regards
> 
> Zdenek
> 
> 

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

* Re: [linux-lvm] devices/dir configuration option in /etc/lvm/lvm.conf can be edited?
  2019-10-14 10:52   ` Gang He
@ 2019-10-14 10:55     ` Zdenek Kabelac
  2019-10-14 13:19     ` Alasdair G Kergon
  1 sibling, 0 replies; 6+ messages in thread
From: Zdenek Kabelac @ 2019-10-14 10:55 UTC (permalink / raw)
  To: Gang He, LVM general discussion and development

Dne 14. 10. 19 v 12:52 Gang He napsal(a):
> Hi Zdenek,
> 
> Thanks for explaining.
> That means we should tell the user, you should not edit this option (dir = "/dev") in the lvm.conf, right?
> 

Basically yes.

The option is there for 'skilled' users who know exactly how the whole 'device 
creation process' works - essentially these days this option is mostly useful 
only for some testing...


Regards

Zdenek

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

* Re: [linux-lvm] devices/dir configuration option in /etc/lvm/lvm.conf can be edited?
  2019-10-14 10:52   ` Gang He
  2019-10-14 10:55     ` Zdenek Kabelac
@ 2019-10-14 13:19     ` Alasdair G Kergon
  2019-10-15  2:19       ` Gang He
  1 sibling, 1 reply; 6+ messages in thread
From: Alasdair G Kergon @ 2019-10-14 13:19 UTC (permalink / raw)
  To: LVM general discussion and development

On Mon, Oct 14, 2019 at 10:52:02AM +0000, Gang He wrote:
> That means we should tell the user, you should not edit this option (dir = "/dev") in the lvm.conf, right?

The existing comment is incomplete and should be updated to mention
the other effects.  The option pre-dates udev and so the "newer"
interlocking there ought to be mentioned.  The description of 'advanced'
could also be updated to explain that that means you should not change
it unless you know exactly what you are doing!  The option exists to
simplify some development, test and support scenarios where you want to
have two or more distinct userspace LVM instances running on a single
machine.  For example, to try to reproduce a certain type of
user-reported bug you might set up a temporary /dev in a non-default
location with contents that match that user's system and point the tools
at that using this option.

Alasdair

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

* Re: [linux-lvm] devices/dir configuration option in /etc/lvm/lvm.conf can be edited?
  2019-10-14 13:19     ` Alasdair G Kergon
@ 2019-10-15  2:19       ` Gang He
  0 siblings, 0 replies; 6+ messages in thread
From: Gang He @ 2019-10-15  2:19 UTC (permalink / raw)
  To: LVM general discussion and development

Hi Alasdair,

Thank for comments.
That means we should update the comments to the latest, this can help to tell the user "this is advanced option".

Thanks
Gang

> -----Original Message-----
> From: linux-lvm-bounces@redhat.com
> [mailto:linux-lvm-bounces@redhat.com] On Behalf Of Alasdair G Kergon
> Sent: 2019��10��14�� 21:20
> To: LVM general discussion and development <linux-lvm@redhat.com>
> Subject: Re: [linux-lvm] devices/dir configuration option in /etc/lvm/lvm.conf
> can be edited?
> 
> On Mon, Oct 14, 2019 at 10:52:02AM +0000, Gang He wrote:
> > That means we should tell the user, you should not edit this option (dir =
> "/dev") in the lvm.conf, right?
> 
> The existing comment is incomplete and should be updated to mention the
> other effects.  The option pre-dates udev and so the "newer"
> interlocking there ought to be mentioned.  The description of 'advanced'
> could also be updated to explain that that means you should not change it
> unless you know exactly what you are doing!  The option exists to simplify
> some development, test and support scenarios where you want to have two or
> more distinct userspace LVM instances running on a single machine.  For
> example, to try to reproduce a certain type of user-reported bug you might set
> up a temporary /dev in a non-default location with contents that match that
> user's system and point the tools at that using this option.
> 
> Alasdair
> 
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

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

end of thread, other threads:[~2019-10-15  2:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-14  8:00 [linux-lvm] devices/dir configuration option in /etc/lvm/lvm.conf can be edited? Gang He
2019-10-14 10:39 ` Zdenek Kabelac
2019-10-14 10:52   ` Gang He
2019-10-14 10:55     ` Zdenek Kabelac
2019-10-14 13:19     ` Alasdair G Kergon
2019-10-15  2:19       ` Gang He

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).