Hide Forgot
Description: Fail to build a disk pool with a disk without disk label Product version libvirt-1.2.8-10.el7.x86_64 parted-3.1-19.el7.x86_64 How producible 100% Steps: 1. Prepare a disk sdb without label (WARNING: data on the disk sdb will be lost) # dd if=/dev/zero of=/dev/sdb count=1 bs=512 2. Prepare a pool XML file test.xml: <pool type='disk'> <name>test</name> <source> <device path='/dev/sdb'/> <format type='dos'/> </source> <target> <path>/dev</path> </target> </pool> 3. Define the pool: # virsh define test.xml 4. Build the pool: # virsh pool-build test error: Failed to build pool test error: operation failed: Error checking for disk label Expected result: Successfully build the pool.
In old version of parted like parted-2.1-25, error message is shown in stdout when printing a disk info without disk label. Error: /dev/sda: unrecognised disk label This line has been moved to stderr in newer version of parted. So we should check both stdout and stderr when locating this message. Patch posted in upstream: https://www.redhat.com/archives/libvir-list/2014-December/msg00546.html
And I've just pushed the patch upstream: commit 97880078922049b08ae28af2579cca9610e642dc Author: Hao Liu <hliu> AuthorDate: Wed Dec 10 15:14:26 2014 +0800 Commit: Michal Privoznik <mprivozn> CommitDate: Wed Dec 10 10:55:23 2014 +0100 storage: Check stderr when matching parted output In old version of parted like parted-2.1-25, error message is shown in stdout when printing a disk info without disk label. Error: /dev/sda: unrecognised disk label This line has been moved to stderr in newer version of parted. So we should check both stdout and stderr when locating this message. This should fix bug: https://bugzilla.redhat.com/show_bug.cgi?id=1172468 Signed-off-by: Hao Liu <hliu> v1.2.11-rc1-24-g9788007
Verified on libvirt-1.2.14-1.el7.x86_64 Steps 1.define a disk pool with following xml # virsh pool-dumpxml disk <pool type='disk'> <name>disk</name> <uuid>b0b3c21e-31df-44d0-913e-f8f7bda080d1</uuid> <capacity unit='bytes'>0</capacity> <allocation unit='bytes'>0</allocation> <available unit='bytes'>0</available> <source> <device path='/dev/sdc'/> <format type='dos'/> </source> <target> <path>/dev</path> <permissions> <mode>0755</mode> <owner>-1</owner> <group>-1</group> </permissions> </target> </pool> 2. # parted /dev/sdc GNU Parted 3.1 Using /dev/sdc Welcome to GNU Parted! Type 'help' to view a list of commands. (parted) print Error: /dev/sdc: unrecognised disk label Model: Alcor Flash Disk (scsi) Disk /dev/sdc: 1048MB Sector size (logical/physical): 512B/512B Partition Table: unknown Disk Flags: (parted) 3. build the disk pool # virsh pool-build disk Pool disk built 4. # parted /dev/sdc GNU Parted 3.1 Using /dev/sdc Welcome to GNU Parted! Type 'help' to view a list of commands. (parted) print Model: Alcor Flash Disk (scsi) Disk /dev/sdc: 1048MB Sector size (logical/physical): 512B/512B Partition Table: msdos Disk Flags:
Set it to verified status according to comment #5
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. https://rhn.redhat.com/errata/RHBA-2015-2202.html