Bug 621515 - partition --onpart doesn't work with /dev/disk/by-path
Summary: partition --onpart doesn't work with /dev/disk/by-path
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: anaconda
Version: 6.0
Hardware: All
OS: Linux
Target Milestone: rc
: ---
Assignee: Chris Lumens
QA Contact: Release Test Team
Depends On: 683873
Blocks: 647893
TreeView+ depends on / blocked
Reported: 2010-08-05 10:40 UTC by Alexander Todorov
Modified: 2011-05-19 12:32 UTC (History)
10 users (show)

Fixed In Version: anaconda-13.21.84-1
Doc Type: Bug Fix
Doc Text:
Clone Of: 512053
Last Closed: 2011-05-19 12:32:00 UTC

Attachments (Terms of Use)
anaconda.log (5.10 KB, text/plain)
2010-08-05 10:50 UTC, Alexander Todorov
no flags Details
blkid output (241 bytes, text/plain)
2010-08-05 10:50 UTC, Alexander Todorov
no flags Details
ls -lR /dev/disk output (737 bytes, text/plain)
2010-08-05 10:50 UTC, Alexander Todorov
no flags Details
program.log (17.16 KB, text/plain)
2010-08-05 10:50 UTC, Alexander Todorov
no flags Details
storage.log (47.89 KB, text/plain)
2010-08-05 10:51 UTC, Alexander Todorov
no flags Details
syslog (41.08 KB, text/plain)
2010-08-05 10:51 UTC, Alexander Todorov
no flags Details
udevadm info --export-db from the system (60.23 KB, text/plain)
2010-08-06 15:59 UTC, Alexander Todorov
no flags Details

System 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 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]

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]

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

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

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
+            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

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.


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