Error when generating artifact for system update

Hi!

I was following the Tutorial to deploy a system update:

mender-artifact write rootfs-image \
    -f ssh://"${USER}@${IP_ADDRESS}" \
    -t "${DEVICE_TYPE}" \
    -n system-v1 \
    -o system-v1.mender \
    -S "${SSH_ARG}"

I get the following error:
time=“2025-02-06T16:01:31+01:00” level=error msg=“Device-local data is stored on the partition being snapshotted: /var/lib/mender. The recommended approach is to have a separate data-partition mounted on "/data" and add a symbolic link (/var/lib/mender → /data). Consult either Overview | Mender documentation Debian family or Overview | Mender documentation case you use Yocto”
time=“2025-02-06T16:01:31+01:00” level=error msg=“data store (/var/lib/mender) is located on filesystem /”
imgFilesystemType error: imgFilesystemType: blkid command failed: exit status 2

How do I fix this?

Hi @adhn,

Using mender-artifact to snapshot a live device will not automagically add a Mender integration. So in order for this to work, the image on the device has to be already Mender aware, in terms of a persistent /data partition, A/B root filesystem partitions and the bootloader integration.

You can create such an image in various ways, like using mender-convert or a Yocto build for example.

Greetz,
Josef