Bug 431901 - /dev/cdrom: open failed: no medium found
/dev/cdrom: open failed: no medium found
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: lvm2 (Show other bugs)
All Linux
low Severity low
: rc
: 5.7
Assigned To: LVM and device-mapper development team
Corey Marthaler
Depends On:
  Show dependency treegraph
Reported: 2008-02-07 13:23 EST by clive darra
Modified: 2010-12-23 10:14 EST (History)
8 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2010-12-23 10:14:42 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

  None (edit)
Description clive darra 2008-02-07 13:23:49 EST
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:
Comment 1 Dave Wysochanski 2008-02-12 11:28:02 EST
If you put this in your /etc/lvm/lvm.conf file and reboot, does it fix it?
filter = [ "r|/dev/cdrom|" ]
Comment 2 clive darra 2008-02-14 06:03:10 EST
fantastic this fixes it thanks

would it make any sense to make 
filter = [ "r|/dev/cdrom|" ]
enabled the default setting ?
Comment 3 Dave Wysochanski 2008-02-25 10:28:38 EST
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
	/* 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;

Comment 4 Riaan van Niekerk 2009-10-14 06:47:41 EDT
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/.*/" ]
    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)
Comment 6 Milan Broz 2010-12-23 10:14:42 EST
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.

Note You need to log in before you can comment on or make changes to this bug.