]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
Fix "disk zap" sgdisk invocation
authorOwen Synge <osynge@suse.com>
Thu, 7 Aug 2014 09:23:09 +0000 (11:23 +0200)
committerNathan Cutler <ncutler@suse.cz>
Mon, 20 Apr 2015 12:30:24 +0000 (14:30 +0200)
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: Thorsten Behrens <tbehrens@suse.com>
(cherry picked from commit 328cd17546187fb3e17766a1148012c43e25e205)
(cherry picked from commit d54a8b1f5b8ffbd948503cfbf27e7c3f55b5c542)

src/ceph-disk

index c3c6951442093c0b530907c85ee7a1978bfd1d1c..b6d1418b3ce913939e8d342b51f87c4eabf8f251 100755 (executable)
@@ -1063,6 +1063,13 @@ def zap(dev):
             [
                 'sgdisk',
                 '--zap-all',
+                '--',
+                dev,
+            ],
+        )
+        command_check_call(
+            [
+                'sgdisk',
                 '--clear',
                 '--mbrtogpt',
                 '--',