From 5ca41e1d2345979e9e25c358cdbd12724bf898c6 Mon Sep 17 00:00:00 2001 From: David Disseldorp Date: Wed, 2 Dec 2015 01:46:40 +0100 Subject: [PATCH] ceph-disk: warn for prepare partitions with bad GUIDs If ceph-disk is a given partition device argument for prepare, it leaves the GPT GUID as is and doesn't check whether the partition's existing GUID matches the expected value. Print a warning in such cases. Fixes: #13943 Signed-off-by: David Disseldorp --- src/ceph-disk | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/ceph-disk b/src/ceph-disk index 7f4a00988f314..83f85eb4fa096 100755 --- a/src/ceph-disk +++ b/src/ceph-disk @@ -1599,6 +1599,11 @@ def prepare_dev( if is_partition(data): LOG.debug('OSD data device %s is a partition', data) rawdev = data + + ptype = get_partition_type(rawdev) + if ptype != ptype_osd: + LOG.warning('incorrect partition UUID: %s, expected %s' + % (ptype, ptype_osd)) else: LOG.debug('Creating osd partition on %s', data) try: -- 2.39.5