Univention Bugzilla – Bug 31925
pvcreate fails if partition has been removed but PV signature has not been removed
Last modified: 2013-11-20 17:21:19 CET
From Bug 18771 Comment 2: > Die beiden Partitionierungsmodule 65_partition.py und 66_gpt_partition.py > wurden um den Aufruf "pvremove -ff <device>" direkt vor dem pvcreate erweitert, > welcher noch existierende PV-Signaturen entfernen soll. "pvremove --force --force $DEVICE" asks interactively for confirmation which fails. If "yes | pvremove --force --force $DEVICE" is called, the removals works without interaction. This happens often and should be fixed for UCS 3.2.
*** Bug 29279 has been marked as a duplicate of this bug. ***
A wrapper script for pvremove has been added: ---[/sbin/wrapper-yes-pvremove]--- #!/bin/sh yes | pvremove "$@" --- In 65_partition.py and 66_gpt_partition.py the corresponding pvremove calls have been replaced with a call of the wrapper script. univention-installer (9.0.19-1) unstable; urgency=low Entry in changelog-3.2.xml has been added. QA: → use autopartitioning layout → remove LVMPV partition → create 2 new partition at disk space used by the prior LVMPV partition via gdisk → partprobe /dev/sda → call "pvcreate /dev/$PARTITION" on both partitions → call "vgcreate vgfoo /dev/$PART1 /dev/$PART2" → jump back to installer terminal → press F5 → use autopartitioning → write partitioning layout to disk → check logfile /tmp/installer.log PARTITION-GPT:3310: waiting for udev to settle down PARTITION-GPT:3305: running ['/sbin/wrapper-yes-pvremove', '-ff', '/dev/sda4'] PARTITION-GPT:3309: ===(exitcode=0)====> ['/sbin/wrapper-yes-pvremove', '-ff', '/dev/sda4'] STDERR: => File descriptor 3 (pipe:[5013]) leaked on pvremove invocation. Parent PID 2566: /bin/sh => Couldn't find device with uuid 67yjDS-dzMf-1ca2-jrQl-4GQ7-SiNG-LN8Lf0. => WARNING: Wiping physical volume label from /dev/sda4 of volume group "vgfoo" => yes: Broken pipe => STDOUT: => Really WIPE LABELS from physical volume "/dev/sda4" of volume group "vgfoo" [y/n]? Labels on physical volume "/dev/sda4" successfully wiped => PARTITION-GPT:3310: waiting for udev to settle down PARTITION-GPT:3305: running ['/sbin/pvcreate', '/dev/sda4'] PARTITION-GPT:3309: ===(exitcode=0)====> ['/sbin/pvcreate', '/dev/sda4'] STDERR: => File descriptor 3 (pipe:[5013]) leaked on pvcreate invocation. Parent PID 1282: /bin/python2.6 => STDOUT: => Physical volume "/dev/sda4" successfully created => PARTITION-GPT:3310: waiting for udev to settle down
PV signatures are removed noninteractive: OK Changelog: OK
(In reply to Sönke Schwardt-Krummrich from comment #2) > A wrapper script for pvremove has been added: I use that for Ticket #2013090221002951, because the previous PV was not over-written and the file-system was not re-created, which caused the installation to fail, since the file-system still contained the data of a previous failed installation. diff --git univention-installer/installer/modules/66_gpt_partition.py univention-installer/installer/modules/66_gpt_partition.py index d71ba39..84197e1 100644 --- a/branches/ucs-3.2/ucs-3.2-0/base/univention-installer/installer/modules/66_gpt_partition.py +++ b/branches/ucs-3.2/ucs-3.2-0/base/univention-installer/installer/modules/66_gpt_partition.py @@ -1297,10 +1297,10 @@ class object(content): return '%sp%s' % (dev_match.group(), number) return '%s%s' % (device, number) - def run_cmd(self, cmd, log_stdout=True, log_stderr=True): + def run_cmd(self, cmd, log_stdout=True, log_stderr=True, stdin=None): self.parent.debug('(profile) run_cmd(%r)' % (cmd,)) proc = subprocess.Popen(cmd, bufsize=0, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - (stdout, stderr) = proc.communicate() + (stdout, stderr) = proc.communicate(stdin) self.parent.debug('===(exitcode=%d)====' % proc.returncode) if stdout and log_stdout: self.parent.debug('stdout of %r:\n=> %s' % (cmd, '\n=> '.join(stdout.split('\n')))) @@ -1391,7 +1391,7 @@ class object(content): if PARTFLAG_LVM in flaglist: self.parent.debug('%s: lvm flag' % device) ucsvgname = self.parent.container['lvm']['ucsvgname'] - self.run_cmd(['/sbin/pvcreate', device]) + self.run_cmd(['/sbin/pvcreate', '-ff', device], stdin='y\n') if not vgcreated: self.run_cmd(['/sbin/vgcreate', '--physicalextentsize', '%sk' % B2KiB(self.parent.container['lvm']['vg'][ ucsvgname ]['PEsize']),
UCS 3.2 has been released: http://docs.univention.de/release-notes-3.2-en.html http://docs.univention.de/release-notes-3.2-de.html If this error occurs again, please use "Clone This Bug".