Skip to content

Commit 1408d99

Browse files
committed
osd_disk_activate: resolve device symlink
When using OSD_DEVICE variable with /dev/disk/by-[id|path] then the partition name is different for the ceph data partition. There's an additional '-part' prefix before the partition number. Instead of managing this prefix and considering that files located in the /dev/disk/by-[id|path] directories are symlinks then we can resolve the symlink to get the actual device /dev/xxxx. Closes: ceph#1480 Signed-off-by: Dimitri Savineau <[email protected]>
1 parent 21d0b04 commit 1408d99

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/daemon/osd_scenarios/osd_disk_activate.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ function osd_activate {
88
exit 1
99
fi
1010

11+
if [ -L "${OSD_DEVICE}" ]; then
12+
OSD_DEVICE=$(readlink -f ${OSD_DEVICE})
13+
fi
14+
1115
if ! parted --script "${OSD_DEVICE}" print | grep -qE '^ 1.*ceph data'; then
1216
log "ERROR: ${OSD_DEVICE} doesn't have a ceph metadata partition"
1317
exit 1

0 commit comments

Comments
 (0)