Hi NGajic (Community Member)
You can certainly backup ext4 partitions or the entire image to another flash after mounting it (SDcard/USB dongle). I would use dd as it is straightforward. Then flash the partition back for later use using STM32CubeProgrammer.
If you have an SDcard reader, it is a no brainer job. Otherwise use the board USB mass storage feature in u-boot (in a boot console), ums 0 mmc 0 if you have USB connected (usb OTG on DK2 board)
maybe some help on this page: https://wiki.st.com/stm32mpu/wiki/How_to_populate_the_SD_card_with_dd_command
which is describing the reverse way (from local binaries to SD image), but I think analyzing the script could bring information how to do the reverse (from SD image to local binaries).