]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Fix "disk zap" sgdisk invocation 4636/head
authorOwen Synge <osynge@suse.com>
Tue, 17 Mar 2015 14:41:33 +0000 (15:41 +0100)
committerNathan Cutler <ncutler@suse.cz>
Sun, 10 May 2015 08:18:40 +0000 (10:18 +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>
(cherry picked from commit fdd7f8d83afa25c4e09aaedd90ab93f3b64a677b)

src/ceph-disk

index 6bd02201bd8b7efa71d1158ed325a09721f2402c..36576486e3f7fb39eb0904608f35199836d1a8e5 100755 (executable)
@@ -1018,6 +1018,13 @@ def zap(dev):
             [
                 'sgdisk',
                 '--zap-all',
+                '--',
+                dev,
+            ],
+        )
+        command_check_call(
+            [
+                'sgdisk',
                 '--clear',
                 '--mbrtogpt',
                 '--',