File 0011-Fix-disk-zap-sgdisk-invocation.patch of Package ceph.627
From: Owen Synge <osynge@suse.com>
Date: Thu, 7 Aug 2014 11:23:09 +0200
Subject: [PATCH] Fix "disk zap" sgdisk invocation
If the metadata on the disk is truly invalid, sgdisk would fail to zero
it in one go, because --mbrtogpt apparently tried to operate on the
metadata it read before executing --zap-all.
Splitting this up into two separate invocations to first zap everything
and then clear it properly fixes this issue.
Based on patch by Lars Marowsky-Bree <lmb@suse.com> in ceph-deploy.
Created by Vincent Untz <vuntz@suse.com>
(cherry picked from commit 97747491ba64ffe1df344c3c15068afe73e951bb)
---
src/ceph-disk | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/src/ceph-disk b/src/ceph-disk
index 6bd0220..3657648 100755
--- a/src/ceph-disk
+++ b/src/ceph-disk
@@ -1018,6 +1018,13 @@ def zap(dev):
[
'sgdisk',
'--zap-all',
+ '--',
+ dev,
+ ],
+ )
+ command_check_call(
+ [
+ 'sgdisk',
'--clear',
'--mbrtogpt',
'--',