missing device nodes for vg, but vg appears in scan
Hi,
I am using lvm2 2.01.09 on Gentoo Linux. My kernel version is 2.6.15 and I'm using udev 079. I hope the @redhat.com suffix doesn't mean this is a Red Hat-only list, but if it does I'll gladly take my question elsewhere (I have not received an answer on the Gentoo forums).
I am trying to set up an LVM2 VG using a loop device. My problem is that device nodes are never created for my VG. However, my VG shows up in scans (vgscan) and displays (vgdisplay). Even vgscan --mknodes does not make the nodes. Because I never get a node for my VG, I can't figure out how I am supposed to create LV's in it.
I have the modules loop, dm-mod and dm-snapshot loaded. Therefore, I do have /dev/mapper/control. Here is what I have done so far:
o Create file and set up to use with loop device
# dd if=/dev/zero of=/local/snapshot bs=1M count=512 # losetup /dev/loop0 /local/snapshot o Set up the PV # pvcreate /dev/loop0 o Create the VG # vgcreate snapshot /dev/loop0
At this point commands like this fail:
# lvcreate -L512 -s -n backup snapshot Path required for Logical Volume "snapshot" The origin name should include the volume group. # lvcreate -L512 -s -n backup /dev/snapshot "/dev/snapshot": Invalid path for Logical Volume The origin name should include the volume group.
I have read in the docs that "vgscan" is run automatically now and that I should expect to see my VG in /dev. This does not happen so I do the following:
o Try to activate the VG
# vgchange -a y snapshot 0 logical volume(s) in volume group "snapshot" now active o Try running vgscan manually # vgscan Reading all physical volumes. This may take a while... Found volume group "snapshot" using metadata type lvm2 # vgscan --mknodes Reading all physical volumes. This may take a while... Found volume group "snapshot" using metadata type lvm2 o No results in /dev, try vgdisplay # vgdisplay --- Volume group --- VG Name snapshot System ID Format lvm2 Metadata Areas 1 Metadata Sequence No 1 VG Access read/write VG Status resizable MAX LV 0 Cur LV 0 Open LV 0 Max PV 0 Cur PV 1 Act PV 1 VG Size 508.00 MB PE Size 4.00 MB Total PE 127 Alloc PE / Size 0 / 0 Free PE / Size 127 / 508.00 MB VG UUID RG5GM3-WrEZ-PmCM-Fl0A-wjAy-Udqo-xLASVj
It looks like my VG is there, but it still isn't showing up in /dev. I read something about how if udev isn't configured properly, you will get devices like /dev/dm-# where # is 0-9, instead of named VG nodes. I don't have those either, but I follow the instructions which are to uncomment a line in my udev rules:
KERNEL=="dm-[0-9]*", PROGRAM="/sbin/devmap_name %M %m", NAME="%k",
SYMLINK+="%c"
I learn that devmap_name is included with multipath-tools, so I install those, version 0.4.6. I reload my udev rules and repeat the steps above, but there is no change. Then I wonder if this has anything to do with the multipath target in the kernel configuration for the device mapper. I enable it, reboot for good measure, and load the multipath module. I repeat the steps above, but there is still no change.
At this point I wonder if udev has some problem outside the scope of my imagination, so I try to see if I can use vgscan to create nodes outside of /dev by editing lvm.conf. When I run vgscan --mknodes, however, it still only creates mapper/control. I guess I shouldn't have really expected that to work, but it's still weird.
Please CC me on replies as I am not subscribed to the list.
--Geoff Mishkin <[email protected]>
Quoted 2 lines · Geoff Mishkin
I am using lvm2 2.01.09 on Gentoo Linux. My kernel version is 2.6.15 and I'm using udev 079.
I'm running 2.6.15 also using lvm
Quoted 5 lines
I am trying to set up an LVM2 VG using a loop device. My problem is that device nodes are never created for my VG. However, my VG shows up in scans (vgscan) and displays (vgdisplay). Even vgscan --mknodes does not make the nodes. Because I never get a node for my VG, I can't figure out how I am supposed to create LV's in it.
First make sure that /etc/lvm/lvm.conf is not filtering out /dev/loop/ devices. Based on the ouput you gave from pvcreate I guess that it isn't, but you should double check anyway. Also read through the options in that file one might jump out at you.
Quoted 2 lines
I have the modules loop, dm-mod and dm-snapshot loaded. Therefore, I do have
/dev/mapper/control. Here is what I have done so far:
dm-mod is the only required module. Well and loop for your set up.
Quoted 8 lines
It looks like my VG is there, but it still isn't showing up in /dev. I read something about how if udev isn't configured properly, you will get devices like /dev/dm-# where # is 0-9, instead of named VG nodes. I don't have those either, but I follow the instructions which are to uncomment a line in my udev rules:
KERNEL=="dm-[0-9]*", PROGRAM="/sbin/devmap_name %M %m", NAME="%k",
SYMLINK+="%c"
I looked at my /etc/udev/rules.d/50-udev.rules and I have the following:
# dm devices (ignore them) KERNEL=="dm-[0-9]*", OPTIONS="ignore_device" # create a symlink named after the device map name # note devmap_name comes with extras/multipath #KERNEL=="dm-[0-9]*", PROGRAM="/sbin/devmap_name %M %m", NAME="%k", SYMLINK+="%c" KERNEL=="device-mapper", NAME="mapper/control"
I'm just not sure why they aren't getting created. Even without vgscan you should get the devices if you are using udev. Maybe you upgraded udev and zapped the new rules during and etc-update or dispatchconf.
Signature · 1 line
Zac Slade
Hi, and thanks for the response. Unfortunately it is still not working. For completeness, I have:
device-mapper: 4.4.0-ioctl (2005-01-12) (Kernel)
device-mapper 1.01.03 (Userspace)
Quoted 12 lines · Zac Slade
Quoted 2 lines · Geoff Mishkin
I am using lvm2 2.01.09 on Gentoo Linux. My kernel version is 2.6.15 and I'm using udev 079.
I'm running 2.6.15 also using lvm
Quoted 5 lines
I am trying to set up an LVM2 VG using a loop device. My problem is that device nodes are never created for my VG. However, my VG shows up in scans (vgscan) and displays (vgdisplay). Even vgscan --mknodes does not make the nodes. Because I never get a node for my VG, I can't figure out how I am supposed to create LV's in it.
Quoted 5 lines
First make sure that
/etc/lvm/lvm.confis not filtering out/dev/loop/devices. Based on the ouput you gave from pvcreate I guess that it isn't, but you should double check anyway. Also read through the options in that file one might jump out at you.
I checked this and it is fine. No other options jump out at me.
Quoted 5 lines
Quoted 2 lines
I have the modules loop, dm-mod and dm-snapshot loaded. Therefore, I do have
/dev/mapper/control. Here is what I have done so far:dm-mod is the only required module. Well and loop for your set up.
Okay well I suppose I'd need dm-snapshot eventually if I ever get this part working. :)
Quoted 9 lines
Quoted 8 lines
It looks like my VG is there, but it still isn't showing up in /dev. I read something about how if udev isn't configured properly, you will get devices like /dev/dm-# where # is 0-9, instead of named VG nodes. I don't have those either, but I follow the instructions which are to uncomment a line in my udev rules:
KERNEL=="dm-[0-9]*", PROGRAM="/sbin/devmap_name %M %m", NAME="%k",
SYMLINK+="%c"
Quoted 9 lines
I looked at my
/etc/udev/rules.d/50-udev.rulesand I have the following:# dm devices (ignore them) KERNEL=="dm-[0-9]*", OPTIONS="ignore_device" # create a symlink named after the device map name # note devmap_name comes with extras/multipath #KERNEL=="dm-[0-9]*", PROGRAM="/sbin/devmap_name %M %m", NAME="%k", SYMLINK+="%c" KERNEL=="device-mapper", NAME="mapper/control"
Now this is interesting. So you say that you have working volume groups on loop devices? But you still have the "ignore_device" option active. So I went backed and switched this in my udev rules but it still didn't work.
Quoted 3 lines
I'm just not sure why they aren't getting created. Even without vgscan you should get the devices if you are using udev. Maybe you upgraded udev and zapped the new rules during and etc-update or dispatchconf.
I'm pretty careful about doing etc-update, and that section of my udev rules now looks the same as yours. Is there anything else specific you think the problem could be?
--Geoff Mishkin <[email protected]>