diff --git a/meta/recipes-support/expand-on-first-boot/files/expand-last-partition.sh b/meta/recipes-support/expand-on-first-boot/files/expand-last-partition.sh
index 57055cc..7ebb3e5 100755
--- a/meta/recipes-support/expand-on-first-boot/files/expand-last-partition.sh
+++ b/meta/recipes-support/expand-on-first-boot/files/expand-last-partition.sh
@@ -38,7 +38,8 @@ if [ "$DISK_SIZE" -lt "$MINIMAL_SIZE" ]; then
 	exit 0
 fi
 
-LAST_PART="$(sfdisk -d "${BOOT_DEV}" 2>/dev/null | tail -1 | cut -d ' ' -f 1)"
+LAST_PART_NAME="$(lsblk -l -o NAME "${BOOT_DEV}" | tail -1)"
+LAST_PART="/dev/${LAST_PART_NAME}"
 
 # Transform the partition table as follows:
 #
@@ -79,6 +80,19 @@ if [ ! -d "${MOUNT_POINT}" ]; then
 	exit 1
 fi
 
+START_TIME="$(date +%s)"
+
+# Wait for udev to create the symlink to the partition in /dev/block/ as
+# systemd-growfs depends on it
+while ! readlink /dev/block/* | grep -q "${LAST_PART_NAME}"; do
+    sleep 0.1
+    CURRENT_TIME="$(date +%s)"
+    if [ $(( CURRENT_TIME - START_TIME )) -gt "5" ]; then
+        echo "Could not find symlink to last part in /dev/block/."
+        exit 1
+    fi
+done
+
 mount "${LAST_PART}" "${MOUNT_POINT}"
 /lib/systemd/systemd-growfs "${MOUNT_POINT}"
 umount "${MOUNT_POINT}"
