Bug 702430 - Regression: list-harddrives output not always processable by part command
Summary: Regression: list-harddrives output not always processable by part command
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: anaconda
Version: 6.1
Hardware: All
OS: Linux
urgent
high
Target Milestone: rc
: ---
Assignee: Chris Lumens
QA Contact: Release Test Team
URL:
Whiteboard:
Keywords:
Depends On:
Blocks: RHEL62CCC 846801 846802
TreeView+ depends on / blocked
 
Reported: 2011-05-05 16:15 UTC by Stephan Mueller
Modified: 2012-08-08 18:29 UTC (History)
10 users (show)

(edit)
Clone Of:
(edit)
Last Closed: 2011-05-19 12:40:36 UTC


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2011:0530 normal SHIPPED_LIVE anaconda bug fix and enhancement update 2011-05-18 17:44:52 UTC

Description Stephan Mueller 2011-05-05 16:15:38 UTC
Description of problem:

To support formatting of the hard disk with kickstart, the list-harddrives command is used to obtain the list of devices. This list is later on used with the part kickstart command.

I use the following code to determine the partitioning 
destination which is present in a kickstart script (note, the listing is 
somewhat simplified):

DISKS_AVAILABLE="$(list-harddrives | cut -d' ' -f1)"
...
DISKS_INST=$(echo "$DISKS_AVAILABLE" | head -1)
...
clearpart --all --drives=$DISKS_INST
...
part $PVNAME --size=1 --grow --ondisk=$DISK_INST
...

For normal devices, that works, but for a cciss controller, list-harddrives procduces "c0d0" but part expects "cciss/c0d0". Therefore, the code above fails.

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

6.1 RC


How reproducible:

See above

Expected results:

The device list output of list-harddrives should be parsable/understandable by the kickstart part command.

Additional info:

This functionality used to work in RHEL5

Comment 2 Chris Lumens 2011-05-05 16:50:42 UTC
Untested, but I believe this would work:

diff --git a/command-stubs/list-harddrives-stub b/command-stubs/list-harddrives-stub
index 4025186..25d9eb0 100755
--- a/command-stubs/list-harddrives-stub
+++ b/command-stubs/list-harddrives-stub
@@ -27,7 +27,8 @@ def main(argv):
     lst = set()
 
     for dev in filter(lambda d: d.type != parted.DEVICE_DM, parted.getAllDevices()):
-        lst.add((os.path.basename(dev.path), dev.getSize()))
+        path = dev.path.lstrip("/dev/")
+        lst.add((path, dev.getSize()))
 
     lst = list(lst)
     lst.sort()

In the installation environment, you'd apply that to the list-harddrives script.  It gets renamed during environment composition.

Comment 4 RHEL Product and Program Management 2011-05-05 19:29:39 UTC
This request was evaluated by Red Hat Product Management for inclusion
in a Red Hat Enterprise Linux maintenance release. Product Management has 
requested further review of this request by Red Hat Engineering, for potential
inclusion in a Red Hat Enterprise Linux Update release for currently deployed 
products. This request is not yet committed for inclusion in an Update release.

Comment 12 Jan Stodola 2011-05-10 12:44:54 UTC
The change in RC4 (anaconda-13.21.116-1.el6) breaks 'list-harddrives' on s390x:

[anaconda root@rtt6 root]# list-harddrives 
asdb 2347.734375
asdc 2347.734375
asdd 2347.734375

With RC3 (anaconda-13.21.115-1.el6), results are OK:
[anaconda root@rtt6 root]# list-harddrives 
dasdb 2347.734375
dasdc 2347.734375
dasdd 2347.734375

Whole path of the devices:
/dev/dasdb
/dev/dasdc
/dev/dasdd

Moving back to ASSIGNED.

Comment 13 Steve Grubb 2011-05-10 15:11:47 UTC
The S390x is also going through certification.

Comment 17 Jan Stodola 2011-05-11 11:30:34 UTC
Tested on build RHEL6.1-20110510.1 (RC5.1) with anaconda-13.21.117-1.el6.

On a system with a cciss controller:
sh-4.1# list-harddrives 
cciss/c0d0 114439.21875

on a x86_64 system with ordinary sda drive:
sh-4.1# list-harddrives 
sda 152627.835938

on s390x with one DASD drive:
[anaconda root@rtt6 root]# list-harddrives 
dasdb 9390.9375

x86_64 system running in kvm with one vda drive:
-bash-4.1# list-harddrives 
vda 26624.0


Also tested with a kickstart utilizing the list-harddrives command:

...
%include /partitioning

%pre
#!/bin/bash
INSTALL_DEVICE="$(list-harddrives | cut -d' ' -f1 | head -n 1)"
echo "bootloader --location=mbr --driveorder=$INSTALL_DEVICE --append='console=ttyS0,115200 crashkernel=auto'" > /partitioning
echo "clearpart --all" >> partitioning
echo "part /boot --fstype=ext4 --size=500 --ondisk=$INSTALL_DEVICE" >> /partitioning
echo "part pv.104002 --grow --size=1 --ondisk=$INSTALL_DEVICE" >> /partitioning
echo "volgroup vg_hpbl460cg501 --pesize=4096 pv.104002" >> /partitioning
echo "logvol /home --fstype=ext4 --name=lv_home --vgname=vg_hpbl460cg501 --grow --size=100" >> /partitioning
echo "logvol / --fstype=ext4 --name=lv_root --vgname=vg_hpbl460cg501 --grow --size=1024 --maxsize=51200" >> /partitioning
echo "logvol swap --name=lv_swap --vgname=vg_hpbl460cg501 --grow --size=1024 --maxsize=10048" >> /partitioning
%end

Moving to VERIFIED.

Comment 18 Karen Skweres 2011-05-16 17:34:18 UTC
HP verified by Mike Miller.

Comment 19 errata-xmlrpc 2011-05-19 12:40:36 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2011-0530.html


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