RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 870128 - improve blkid documentation
Summary: improve blkid documentation
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: util-linux-ng
Version: 6.4
Hardware: x86_64
OS: Linux
unspecified
medium
Target Milestone: rc
: ---
Assignee: Karel Zak
QA Contact: qe-baseos-daemons
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-10-25 15:30 UTC by Joe Vlcek
Modified: 2013-11-21 20:44 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-11-21 20:44:05 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:1648 0 normal SHIPPED_LIVE util-linux-ng bug fix and enhancement update 2013-11-20 21:53:24 UTC

Description Joe Vlcek 2012-10-25 15:30:01 UTC
Description of problem:

On a vSphere VM, without the "-l" flag blkid returns no cdrom
device when it should according to the man page.

On the below bare-metal even when using the "-l" flag blkid doesn't
list the cdrom device.

# dmidecode
<snip>
Handle 0x0001, DMI type 1, 27 bytes
System Information
	Manufacturer: Hewlett-Packard
	Product Name: HP Z210 Workstation
	Version: Not Specified
	Serial Number: 2UA1230QGZ
	UUID: 3C8F4300-8ACF-11E0-8BB7-2C27D719FBBF
	Wake-up Type: Power Switch
	SKU Number: XM856AV
	Family: 103C_53335X G=D
</snip>


Version-Release number of selected component (if applicable):

I have seen this on RHEL6.3 and RHEL6.4


How reproducible:


Steps to Reproduce:
1.
 boot system with a cdrom
2. 
attempt to use blkid without "-l" flag to list the cdrom.
# blkid -tLABEL=CDROM -odevice


Actual results:
No output is produced

Expected results:

blkid should list the cdrom on bare-metal and vSphere without
having to specify the "-l" flag.

Without the "-l" flag blkid should, as described in the man page blkid(8),
print all of the devices that match the search parameter.

Additional info:

The device is correctly returned if the "-l" flag is used.

e.g.: 
# blkid -tLABEL=CDROM -odevice -l
/dev/sr0


However the blkid(8) man page states in the last sentence of the
description of the "-l" flag that:

             "If  this  option  is  not specified, blkid will print all of the
              devices that match the search parameter."


The "-l" flag is not needed on other platforms (e.g.: Fedora and Ubuntu)
and should behave as documented in the man page.

Comment 2 Joe Vlcek 2012-10-25 17:54:58 UTC
Some more observations:

#1)

Bare-metal seems to work OK:

It seems the reason I wasn't seeing any output on bare-metal is because
the label for the cdrom is not "CDROM" as it is on the VM. On bare-metal
the label for the cdrom is: "RHEL_6.3 x86_64 Disc 1"

What I observer on Bare-metal seem OK although the label seems a bit verbose.
What I observer on the vSphere VM seems incorrect.

On bare-metal:
--------------

# blkid /dev/cdrom 
/dev/cdrom: LABEL="RHEL_6.3 x86_64 Disc 1" TYPE="iso9660" 
# blkid -odevice -t LABEL="RHEL_6.3 x86_64 Disc 1"
/dev/cdrom
# blkid -odevice -t LABEL="RHEL_6.3 x86_64 Disc 1" -l
/dev/sr0

On vSphere VM:
--------------
# blkid -tLABEL=CDROM -odevice
# blkid -tLABEL=CDROM -odevice -l
/dev/sr0


#2) Oddly, on VM, the output seems to be correct after issuing
    blkid /dev/cdrom

On vSphere VM:
--------------
# blkid -tLABEL=CDROM -odevice
# blkid -tLABEL=CDROM -odevice -l
/dev/sr0
# blkid /dev/cdrom
/dev/cdrom: LABEL="CDROM" TYPE="iso9660" 
# blkid -tLABEL=CDROM -odevice
/dev/cdrom
# blkid -tLABEL=CDROM -odevice -l
/dev/sr0

Comment 3 RHEL Program Management 2012-12-14 08:20:51 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 4 Joe Vlcek 2012-12-14 13:58:10 UTC
Please consider addressing this for the next release.

Comment 5 Karel Zak 2012-12-20 08:46:02 UTC
The libblkid does not probe removable devices by default, these devices are not in /proc/partitions. This is expected behaviour to avoid performance issues.

If you manually specify the device name on command line (e.h. blkid /dev/cdrom) then the device is added to the /etc/blkid/blkid.tab) cache file and blkid will probe this device as well.

The command "blkid -l -t LABEL=" (or UUID=) works differently, it uses /dev/disk/by-label udev symlinks to translate the tag to device name, so it bypasses the cache as well as /proc/partitions.

Maybe it's confusing (and badly documented), but all this is expected behaviour.

We have backported new command lsblk(8) to RHEL6, you can try to use lsblk --fs if you want to have overview of the devices and labels.

Note that, the latest 3.x kernels probably list removable in the /proc/partitions.

Comment 11 errata-xmlrpc 2013-11-21 20:44:05 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-1648.html


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