archive mirror
 help / color / mirror / Atom feed
From: Andrei Borzenkov <>
Subject: [linux-lvm] Option devices/dir different from /dev does not work
Date: Sun, 27 Jan 2019 00:14:14 +0300	[thread overview]
Message-ID: <> (raw)

I attempt to put device nodes for volumes in sub-directory of /dev to
avoid accidental conflict between device name and volume group and
general /dev pollution. VxVM always did it, using /dev/vx as base
directory, so I would use something like /dev/lvm.

Option devices/dir sounds like exactly the right one based on description:

# Directory in which to create volume group device nodes.

Unfortunately it appears to have no effect, LVM devices are still
created directly under /dev. The only device under /dev/lvm is
/dev/lvm/mapper/control ...

I suspect the reason is, device nodes are created by udev and it does
not know anything about LVM settings:

# Create symlinks for top-level devices only.
ENV{DM_VG_NAME}=="?*", ENV{DM_LV_NAME}=="?*",
SYMLINK+="$env{DM_VG_NAME}/$env{DM_LV_NAME}", GOTO="lvm_end"

Is it intentional? In this case at the very least comment in lvm.conf
should explicitly say that this setting has no effect if udev
integration is enabled.

openSUSE Tumbleweed just updated.

10:~ # lvm2
10:~ # lvmconfig --type full devices/dir
10:~ # ls -l /dev/lvm
total 0
drwxr-xr-x 2 root root 60 Jan 27 00:05 mapper
10:~ # pvs
  PV         VG     Fmt  Attr PSize  PFree
  /dev/sdb   vgTEST lvm2 a--  10.00g 9.90g
10:~ # vgs
  VG     #PV #LV #SN Attr   VSize  VFree
  vgTEST   1   1   0 wz--n- 10.00g 9.90g
10:~ # lvs
  LV      VG     Attr       LSize   Pool Origin Data%  Meta%  Move Log
Cpy%Sync Convert
  lvTEST vgTEST -wi-a----- 100.00m

10:~ # ls -l /dev/vgTEST
total 0
lrwxrwxrwx 1 root root 7 Jan 27 00:05 lvTEST -> ../dm-0
10:~ # ls -l /dev/lvm/mapper
total 0
crw------- 1 root root 10, 236 Jan 27 00:05 control
10:~ # ls -l /dev/mapper
total 0
crw------- 1 root root 10, 236 Jan 27 00:05 control
lrwxrwxrwx 1 root root       7 Jan 27 00:05 vgTEST-lvTEST -> ../dm-0

             reply	other threads:[~2019-01-26 21:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-26 21:14 Andrei Borzenkov [this message]
2019-01-28 10:01 ` [linux-lvm] Option devices/dir different from /dev does not work Zdenek Kabelac
2019-01-28 10:29 ` Peter Rajnoha

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).