Hide Forgot
Description of problem: LVM will fail to create volumegroup if the hostname contains invalid caracter (especialy a slash) Version-Release number of selected component (if applicable): How reproducible: Yes, it is reproducible. Steps to Reproduce: 1. change hostname to something invalid, for example, execute: hostname foo/bar 2. Try creating a VG, for example, execute lvm vgcreate TEST /dev/sdd9 Actual results: % lvm vgcreate TESTVG /dev/sdd9 Couldn't create temporary archive name. Volume group "TESTVG" metadata archive failed. Expected results: a more explicit error message. Additional info: This problem occured while doing automatic kickstart deployment with anaconda.
Well, we definitely need to escape such characters.
OK, this is only a temporary file name creation. Also, we can't set the hostname containing '/' with recent versions of the 'hostname' command (I don't know the exact version, but the Fedora rawhide version if 'hostname' already checks that). Though we can still set it directly using 'sethostname' from unistd.h. Since this is really a corner case, I think we don't need any complex escape sequences here. We'll simply replace the '/' with '?'. Patch is upstream now (v2.02.86).
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: A hostname containing '/' character caused LVM commands to fail while generating an archive of current metadata. Since the hostname is part of the temporary archive filename, we ended up with a file path that was ambiguous and it caused the whole archive operation to fail. To fix this, we replace any '/' character with '?' character in the hostname string and then we use it to compose the temporary archive filename.
Adding QA ack for 6.2. Devel will need to provide unit testing results however before this bug can be ultimately verified by QA.
Fixed verified in the latest rpms. [root@grant-01 ~]# hostname foo/bar [root@foo/bar ~]# vgcreate TEST /dev/sd[bc][12] Volume group "TEST" successfully created 2.6.32-193.el6.x86_64 lvm2-2.02.87-1.el6 BUILT: Fri Aug 12 06:11:57 CDT 2011 lvm2-libs-2.02.87-1.el6 BUILT: Fri Aug 12 06:11:57 CDT 2011 lvm2-cluster-2.02.87-1.el6 BUILT: Fri Aug 12 06:11:57 CDT 2011 udev-147-2.37.el6 BUILT: Wed Aug 10 07:48:15 CDT 2011 device-mapper-1.02.66-1.el6 BUILT: Fri Aug 12 06:11:57 CDT 2011 device-mapper-libs-1.02.66-1.el6 BUILT: Fri Aug 12 06:11:57 CDT 2011 device-mapper-event-1.02.66-1.el6 BUILT: Fri Aug 12 06:11:57 CDT 2011 device-mapper-event-libs-1.02.66-1.el6 BUILT: Fri Aug 12 06:11:57 CDT 2011 cmirror-2.02.87-1.el6 BUILT: Fri Aug 12 06:11:57 CDT 2011
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. http://rhn.redhat.com/errata/RHBA-2011-1522.html