Bug 621515

Summary: partition --onpart doesn't work with /dev/disk/by-path
Product: Red Hat Enterprise Linux 6 Reporter: Alexander Todorov <atodorov>
Component: anacondaAssignee: Chris Lumens <clumens>
Status: CLOSED ERRATA QA Contact: Release Test Team <release-test-team>
Severity: medium Docs Contact:
Priority: medium    
Version: 6.0CC: atodorov, borgan, coughlan, ddumas, dgregor, james.brown, mmahudha, orion, snagar, tao
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: anaconda-13.21.84-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: 512053 Environment:
Last Closed: 2011-05-19 12:32:00 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---
Bug Depends On: 683873    
Bug Blocks: 647893    
Attachments:
Description Flags
anaconda.log
none
blkid output
none
ls -lR /dev/disk output
none
program.log
none
storage.log
none
syslog
none
udevadm info --export-db from the system none

Description Alexander Todorov 2010-08-05 10:40:58 UTC
+++ This bug was initially created as a clone of Bug #512053 +++

--- Additional comment from atodorov@redhat.com on 2010-08-05 13:38:50 EEST ---

(In reply to comment #18)
> 
> > * ignoredisk --only-use=
> > * partition --onpart=
> 
> Not tested.
> 

ignore-disk --only-use tested and works, however partition --onpart doesn't.

Since this bug covers several kickstart commands which were tested and PASS I'll move it to VERIFIED and open a separate one for the --onpart issue.

Comment 1 Alexander Todorov 2010-08-05 10:45:38 UTC
Description of problem:

Installing with ks.cfg which contains the partition --onpart command doesn't work when the partition path is specified as /dev/disk/by-path/...


Steps to reproduce:

1) Prepare a system with 2 disks and known partitioning. In my case this is a KVM guest with vda and vdb disks where vda contains /boot and PV and vdb has a single xfs partition. 

2) Start a second install on the same system with the following ks.cfg snippet:

bootloader --location=mbr
clearpart --none

part /boot --fstype=ext4 --size=500 --ondisk=/dev/disk/by-path/virtio-pci-virtio1
part swap --size=2048 --ondisk=/dev/disk/by-path/virtio-pci-virtio1
part / --fstype=ext4 --size=500 --grow --ondisk=/dev/disk/by-path/virtio-pci-virtio1

part /mydata --fstype=xfs --size=500 --grow --onpart=/dev/disk/by-path/virtio-pci-virtio2-part1 --noformat

Actual results:
Anaconda gives error: No preexisting partition with the name "disk/by-path/virtio-pci-virtio2-part1" was found.

Expected results:
installation compeltes.

Additional info:
blkid and ls /dev/disk/by-path report that this partition exists. Logs will be attached.

Comment 3 Alexander Todorov 2010-08-05 10:50:20 UTC
Created attachment 436810 [details]
anaconda.log

Comment 4 Alexander Todorov 2010-08-05 10:50:30 UTC
Created attachment 436812 [details]
blkid output

Comment 5 Alexander Todorov 2010-08-05 10:50:46 UTC
Created attachment 436813 [details]
ls -lR /dev/disk output

Comment 6 Alexander Todorov 2010-08-05 10:50:57 UTC
Created attachment 436814 [details]
program.log

Comment 7 Alexander Todorov 2010-08-05 10:51:07 UTC
Created attachment 436815 [details]
storage.log

Comment 8 Alexander Todorov 2010-08-05 10:51:24 UTC
Created attachment 436816 [details]
syslog

Comment 9 Chris Lumens 2010-08-05 13:36:08 UTC
Could you also attach the output of udevadm info --export-db?

Comment 11 Alexander Todorov 2010-08-06 15:59:53 UTC
Created attachment 437194 [details]
udevadm info --export-db from the system

Comment 12 Chris Lumens 2010-08-20 20:06:09 UTC
diff --git a/storage/udev.py b/storage/udev.py
index 12116f6..62ef214 100644
--- a/storage/udev.py
+++ b/storage/udev.py
@@ -49,8 +49,12 @@ def udev_resolve_devspec(devspec):
             ret = dev
             break
         else:
+            spec = devspec
+            if not spec.startswith("/dev/"):
+                spec = os.path.normpath("/dev/" + spec)
+
             for link in dev["symlinks"]:
-                if devspec == link:
+                if spec == link:
                     ret = dev
                     break

Comment 14 RHEL Product and Program Management 2010-10-29 21:33:03 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 17 Alexander Todorov 2011-03-10 14:56:34 UTC
Blocked by bug #683873

Comment 18 Alexander Todorov 2011-03-11 10:50:33 UTC
Tested with:

bootloader --location=mbr

clearpart --drives=vda --all

part /boot --fstype=ext4 --size=1024 --ondisk=/dev/disk/by-path/pci-0000:00:05.0-virtio-pci-virtio1
part swap --size=1024 --ondisk=/dev/disk/by-path/pci-0000:00:05.0-virtio-pci-virtio1
part / --fstype=ext4 --size=500 --grow --ondisk=/dev/disk/by-path/pci-0000:00:05.0-virtio-pci-virtio1

part /mydata --fstype=ext4 --onpart=/dev/disk/by-path/pci-0000:00:06.0-virtio-pci-virtio2-part1 --noformat


With anaconda-13.21.104-1.el6.x86_64. All works as expected.

Comment 19 Orion Poplawski 2011-03-17 19:14:08 UTC
Would it be possible to get an updates image for this?

Comment 20 errata-xmlrpc 2011-05-19 12:32:00 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