Skip to content

Commit

Permalink
disk_list: backward compatibility with old ceph-disk
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
leseb committed Jul 27, 2018
1 parent dd0a1e8 commit 74c78c1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/daemon/disk_list.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 74c78c1

Please sign in to comment.