Description of problem: During startup I get the message Setting up Logical Volume Management: /dev/cdrom: open failed: no medium found No volume groups found Version-Release number of selected component (if applicable): How reproducible: everytime i start Steps to Reproduce: 1. build (without using any lvm) 2. boot 3. watch screen Actual results: Setting up Logical Volume Management: /dev/cdrom: open failed: no medium found No volume groups found Expected results: Setting up Logical Volume Management: No volume groups found Additional info:
If you put this in your /etc/lvm/lvm.conf file and reboot, does it fix it? filter = [ "r|/dev/cdrom|" ]
fantastic this fixes it thanks would it make any sense to make filter = [ "r|/dev/cdrom|" ] enabled the default setting ?
Looking into this. Internally does not look like it is as simple as just adding a string to 'defaults.h' but hopefully we can do this fairly easily. We need to add a bit of infrastructure to add default filters to the config_tree created from the default values. In the process we might also add infrastructure for other things such as preferred_names. Key functions seem to be _init_filter_components and create_config_tree_from_string. We have 'cft_override' which gives a potential example of how we could turn a string into a config_tree. However, we really need to merge in some default strings into 'cmd->cft', not 'cft_override', since the former tree contains the default values used. Basically if a "devices/filter" line does not exist in lvm.conf, we want to add the default string in 'cft'. So it looks like it would go in the below 'then' clause of _init_filter_components: /* regex filter. Optional. */ if (!(cn = find_config_tree_node(cmd, "devices/filter"))) log_very_verbose("devices/filter not found in config file: " "no regex filter installed"); else if (!(filters[nr_filt++] = regex_filter_create(cn->v))) { log_error("Failed to create regex device filter"); return NULL; }
On the current version (RHEL 5.4) if I apply the suggested change from Comment #1, I get a "WARNING: Ignoring duplicate config node: filter (seeking filter)" message above the original error message. Apparently newer versions of LVM require that all changes be consolidated into a single line. To get rid of it, I had to change filter = [ "a/.*/" ] to filter = [ "r|/dev/cdrom|", "a/.*/" ] Taking a step back: This bug has not been assigned yet. Would it be possible to get a status update on this bug? What are the chances that this will be fixed in RHEL 5? If they are low to non-existent (as the workaround is known), would it not be better to close it with WONTFIX than keep it around until after RHEL 5 moves into Production 2 or Production 3, when it is even less likely to be fixed. (I apologize if this is not the right place to ask this type of question and will gladly take any suggestions as to the proper route to follow)
I think that device with no medium should report zero size, thus it should be filtered out by sysfs filter (which is default on) before lvm tries to open it. Closing this, there is simple workaround to avoid this message if some strange configuration causes this message. If you think it there is a bug, please open a ticket with Red Hat support, thanks.