Skip to content

Commit be0c8bb

Browse files
committed
Use bind mounts instead of symlinks to move directories to data volume
This makes the relocation more transparent to apps and users because symlinks are sometimes treated differently. Signed-off-by: Jan Dubois <[email protected]>
1 parent 1de95ce commit be0c8bb

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)