From f4712b3143d94689f2d1e922793cebc224e0d87a Mon Sep 17 00:00:00 2001 From: illiliti Date: Wed, 13 May 2020 16:38:21 +0300 Subject: [PATCH] ensure that blkid able to read info from device fix symlink --- device-helper | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/device-helper b/device-helper index 44409fe..91e726d 100755 --- a/device-helper +++ b/device-helper @@ -20,7 +20,7 @@ create_symlink() exec > /dev/null 2>&1 # avoid race condition - while [ ! -e "/dev/${dev_name}" ]; do sleep 1; done + while ! blkid "/dev/${dev_name}"; do sleep 1; done for line in $(blkid "/dev/${dev_name}"); do case "${line%%=*}" in UUID) @@ -40,6 +40,6 @@ create_symlink() [ -e "/sys/block/${dev_name}/dm/name" ] && { mkdir -p /dev/mapper read -r dm_name < "/sys/block/${dev_name}/dm/name" - ln -s "/dev/${dev_name}" "/dev/mapper/${dm_name}" + ln -sf "/dev/${dev_name}" "/dev/mapper/${dm_name}" } }