Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 382315 - sys-fs/lvm2 does not work per default with loopback devices in Gentoo
Summary: sys-fs/lvm2 does not work per default with loopback devices in Gentoo
Status: RESOLVED NEEDINFO
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: All Linux
: Normal enhancement
Assignee: Robin Johnson
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-08 20:41 UTC by Marcus Becker
Modified: 2011-09-13 17:07 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
vanilla lvm.conf (lvm.conf,28.31 KB, text/plain)
2011-09-13 16:35 UTC, Marcus Becker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marcus Becker 2011-09-08 20:41:14 UTC
per default the following option in /etc/lvm/lvm.conf prevents lvm2 to work with loopback devices:
obtain_device_list_from_udev = 0


Reproducible: Always

Steps to Reproduce:
1. dd if=/dev/zero of=myimage.img bs=1024 count=20480
2. losetup -f myimage.img (assuming /dev/loop0 is free)
3. pvcreate /dev/loop0
Actual Results:  
PV creaed successfully but noy found by lvm

Expected Results:  
PV creaed successfully and found by lvm
Comment 1 Marcus Becker 2011-09-08 20:41:54 UTC
arg, the original setting is:
obtain_device_list_from_udev = 1
Comment 2 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2011-09-13 05:26:05 UTC
The stock lvm.conf from upstream (2.02.88) has obtain_device_list_from_udev=1. You must have changed it at some point.

You should go and alter the filter, or change that setting back
Comment 3 Marcus Becker 2011-09-13 07:14:43 UTC
Sorry but you read the bug report wrongly, I corrected my statement in the second comment.

The stock upstream setting prevents lvm to detect loopback devices, by using udev.
Yes, I checked the filters and left them all default.
Comment 4 Robin Johnson archtester Gentoo Infrastructure gentoo-dev Security 2011-09-13 08:20:40 UTC
I don't follow, can you please clarify which setting of obtain_device_list_from_udev causes it to work?

And you're sure your filters aren't excluding loop devices?

I can't reproduce this with EITHER setting for obtain_device_list_from_udev, provided I add: |a/dev/loop.*| to my filter.
Comment 5 Marcus Becker 2011-09-13 16:35:59 UTC
Created attachment 286363 [details]
vanilla lvm.conf

this is the lvm.conf after I deleted it and emerged
sys-fs/lvm2-2.02.88  USE="lvm1 readline static static-libs (-clvm) (-cman) (-selinux)" 0 kB

Here are my steps (ignore the /dev/ptmx -.-):
disi-bigtop lvm_img # dd if=/dev/zero of=myimage.img bs=1024 count=20480
20480+0 records in
20480+0 records out
20971520 bytes (21 MB) copied, 0.0374487 s, 560 MB/s
disi-bigtop lvm_img # losetup /dev/loop1 myimage.img
disi-bigtop lvm_img # pvcreate /dev/loop1
File descriptor 5 (/dev/ptmx) leaked on pvcreate invocation. Parent PID 4729: -su
  Writing physical volume data to disk "/dev/loop1"
  Physical volume "/dev/loop1" successfully created
disi-bigtop lvm_img # pvscan
File descriptor 5 (/dev/ptmx) leaked on pvscan invocation. Parent PID 4729: -su
  No matching physical volumes found
Comment 6 Marcus Becker 2011-09-13 17:07:22 UTC
disi-bigtop ~ # nano /etc/lvm/lvm.conf
changed:
obtain_device_list_from_udev = 0
disi-bigtop ~ # pvscan
File descriptor 5 (/dev/ptmx) leaked on pvscan invocation. Parent PID 14681: -su
  PV /dev/loop1                      lvm2 [20.00 MiB]
  Total: 1 [20.00 MiB] / in use: 0 [0   ] / in no VG: 1 [20.00 MiB]