From fdd7f8d83afa25c4e09aaedd90ab93f3b64a677b 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 --- src/ceph-disk | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/ceph-disk b/src/ceph-disk index df48a2a9c675a..1b29c8e977b56 100755 --- a/src/ceph-disk +++ b/src/ceph-disk @@ -1053,6 +1053,13 @@ def zap(dev): [ 'sgdisk', '--zap-all', + '--', + dev, + ], + ) + command_check_call( + [ + 'sgdisk', '--clear', '--mbrtogpt', '--', -- 2.39.5