--- /dev/null
+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>
+---
+ src/ceph-disk | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/src/ceph-disk b/src/ceph-disk
+index c67f2f3..1113135 100755
+--- a/src/ceph-disk
++++ b/src/ceph-disk
+@@ -916,6 +916,13 @@ def zap(dev):
+ [
+ 'sgdisk',
+ '--zap-all',
++ '--',
++ dev,
++ ],
++ )
++ command_check_call(
++ [
++ 'sgdisk',
+ '--clear',
+ '--mbrtogpt',
+ '--',
+++ /dev/null
-From: Owen Synge <osynge@suse.com>
-Date: Thu, 7 Aug 2014 10:21:18 +0200
-Subject: [PATCH] cephdisk:Preparing a block device add --mbrtogpt to sgdisk.
-
-Convert an MBR or BSD disklabel disk to a GPT disk. As a safety
-measure, use of this option is required on MBR or BSD disklabel
-disks if you intend to save your changes, in order to prevent
-accidentally damaging such disks.
----
- src/ceph-disk | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/src/ceph-disk b/src/ceph-disk
-index c67f2f3..0920b68 100755
---- a/src/ceph-disk
-+++ b/src/ceph-disk
-@@ -1191,6 +1191,7 @@ def prepare_dev(
- command_check_call(
- [
- 'sgdisk',
-+ '--mbrtogpt',
- '--largest-new=1',
- '--change-name=1:ceph data',
- '--partition-guid=1:{osd_uuid}'.format(
+ Accepted patch from Dirk Mueller <dmueller@suse.com>
- Install 95-ceph-osd-alt.rules on older suse versions.
+ Fix bnc#890736
- + Suggestion from Dirk Mueller <dmueller@suse.com>
+ + Suggestion from Vincent Untz <vuntz@suse.com>
-------------------------------------------------------------------
Thu Aug 7 08:45:27 UTC 2014 - tbehrens@suse.com
Patch0014: 0014-osdmaptool-test-map-pgs.t-fix-escap.patch
Patch0015: 0015-Convert-remaining-init-script-actio.patch
Patch0016: 0016-Fix-bnc-890345-wrong-service-name-f.patch
-Patch0017: 0017-cephdisk-Preparing-a-block-device-a.patch
+Patch0017: 0017-Fix-disk-zap-sgdisk-invocation.patch
# Please do not add patches manually here, run update_git.sh.
#################################################################################