Bug 870128 - improve blkid documentation
improve blkid documentation
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: util-linux-ng (Show other bugs)
x86_64 Linux
unspecified Severity medium
: rc
: ---
Assigned To: Karel Zak
: ManPageChange
Depends On:
  Show dependency treegraph
Reported: 2012-10-25 11:30 EDT by Joe Vlcek
Modified: 2013-11-21 15:44 EST (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2013-11-21 15:44:05 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)

External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:1648 normal SHIPPED_LIVE util-linux-ng bug fix and enhancement update 2013-11-20 16:53:24 EST

  None (edit)
Description Joe Vlcek 2012-10-25 11:30:01 EDT
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
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

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

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

How reproducible:

Steps to Reproduce:
 boot system with a cdrom
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.

# blkid -tLABEL=CDROM -odevice -l

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 13:54:58 EDT
Some more observations:


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"
# blkid -odevice -t LABEL="RHEL_6.3 x86_64 Disc 1" -l

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

#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
# blkid /dev/cdrom
/dev/cdrom: LABEL="CDROM" TYPE="iso9660" 
# blkid -tLABEL=CDROM -odevice
# blkid -tLABEL=CDROM -odevice -l
Comment 3 RHEL Product and Program Management 2012-12-14 03:20:51 EST
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 08:58:10 EST
Please consider addressing this for the next release.
Comment 5 Karel Zak 2012-12-20 03:46:02 EST
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 15:44:05 EST
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.


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