]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Fix "disk zap" sgdisk invocation 4037/head
authorOwen Synge <osynge@suse.com>
Tue, 17 Mar 2015 14:41:33 +0000 (15:41 +0100)
committerOwen Synge <osynge@suse.com>
Thu, 30 Apr 2015 09:11:42 +0000 (11:11 +0200)
Fixes #11143

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>

Signed-off-by: Owen Synge <osynge@suse.com>
Signed-off-by: Thorsten Behrens <tbehrens@suse.com>
src/ceph-disk

index df48a2a9c675a3f8d270c9ebea1e210db43ee4e3..1b29c8e977b561b235cbb07396319a29c97d0728 100755 (executable)
@@ -1053,6 +1053,13 @@ def zap(dev):
             [
                 'sgdisk',
                 '--zap-all',
+                '--',
+                dev,
+            ],
+        )
+        command_check_call(
+            [
+                'sgdisk',
                 '--clear',
                 '--mbrtogpt',
                 '--',