Skip to content

Commit 97788a3

Browse files
authored
Merge pull request #113 from rancher-sandbox/bind-mount-data-dirs
2 parents 1de95ce + be0c8bb commit 97788a3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pkg/cidata/cidata.TEMPLATE.d/boot/05-persistent-data-volume.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,8 @@ if [ "$(awk '$2 == "/" {print $3}' /proc/mounts)" == "tmpfs" ]; then
4444
fi
4545
for DIR in ${DATADIRS}; do
4646
if [ -d /mnt/data"${DIR}" ]; then
47-
[ -e "${DIR}" ] && rm -rf "${DIR}"
48-
ln -s /mnt/data"${DIR}" "${DIR}"
47+
mkdir -p "${DIR}"
48+
mount --bind /mnt/data"${DIR}" "${DIR}"
4949
fi
5050
done
5151
fi

0 commit comments

Comments
 (0)