From: Owen Synge Date: Tue, 17 Mar 2015 14:41:33 +0000 (+0100) Subject: Fix "disk zap" sgdisk invocation X-Git-Tag: v0.94.2~23^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6a04b55df76faad9b1b0770fbe6038b3b8c7d645;p=ceph.git Fix "disk zap" sgdisk invocation 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 in ceph-deploy. Created by Vincent Untz Signed-off-by: Owen Synge Signed-off-by: Thorsten Behrens (cherry picked from commit fdd7f8d83afa25c4e09aaedd90ab93f3b64a677b) --- diff --git a/src/ceph-disk b/src/ceph-disk index 70c713777904..1f6239944ab5 100755 --- a/src/ceph-disk +++ b/src/ceph-disk @@ -1054,6 +1054,13 @@ def zap(dev): [ 'sgdisk', '--zap-all', + '--', + dev, + ], + ) + command_check_call( + [ + 'sgdisk', '--clear', '--mbrtogpt', '--',