From 74c78c1bb5a6524f950bc8d9ed50963e5ca922cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Han?= Date: Fri, 27 Jul 2018 11:56:01 +0200 Subject: [PATCH] disk_list: backward compatibility with old ceph-disk MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Older version of ceph-disk (when bluestore wasn't around) was creating the lockbox partition for dmcrypt on partition number 3. With bluestore this partition is now on position number 5. So we need to test if this partition exists, if it does we use it. Closes: https://bugzilla.redhat.com/show_bug.cgi?id=1609007 Signed-off-by: Sébastien Han --- src/daemon/disk_list.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/daemon/disk_list.sh b/src/daemon/disk_list.sh index 9c5161f89..578254c4a 100755 --- a/src/daemon/disk_list.sh +++ b/src/daemon/disk_list.sh @@ -97,7 +97,14 @@ function start_disk_list () { # usually after a reboot they don't go created udevadm trigger - lockbox_uuid=$(get_part_uuid "$(dev_part "${OSD_DEVICE}" 5)") + # latest versions of ceph-disk (after bluestore) put the lockbox partition on 5 + # where already deployed clusters with an earlier version of ceph-disk will do that + # on partition 3 + local lock_partition_num=5 + if [ ! -b "$(dev_part "${OSD_DEVICE}" $lock_partition_num)" ]; then + lock_partition_num=3 + fi + lockbox_uuid=$(get_part_uuid "$(dev_part "${OSD_DEVICE}" $lock_partition_num)") data_uuid=$(get_part_uuid "$(dev_part "${OSD_DEVICE}" 1)") data_part=$(dev_part "${OSD_DEVICE}" 1) mount_lockbox "$data_uuid" "$lockbox_uuid" 1> /dev/null