From 10d85e1126768f6c72f7d2a301ea7ca9ba59f8e0 Mon Sep 17 00:00:00 2001 From: Owen Synge Date: Tue, 17 Mar 2015 15:41:33 +0100 Subject: [PATCH] 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) --- src/ceph-disk | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ceph-disk b/src/ceph-disk index 6bd02201bd8b7..36576486e3f7f 100755 --- a/src/ceph-disk +++ b/src/ceph-disk @@ -1018,6 +1018,13 @@ def zap(dev): [ 'sgdisk', '--zap-all', + '--', + dev, + ], + ) + command_check_call( + [ + 'sgdisk', '--clear', '--mbrtogpt', '--', -- 2.39.5