I have a diet pi install on a rock64 running a music server but I often get corrupted sd cards which force me to reinstall on a fresh card. Is there a way for me to update the dietpi.txt file inside the rock64 dietpi img file so that I can just do a fresh boot directly into the desired setup? If not, can I simply clone the SD card from my properly setup system to create a custom img file?
Lastly, is there an specific dietpi tool to migrate the boot drive to something other than the SD card, like a more reliable USB?
Theoretically using another Linux box should enable you to access the dietpi.txt on the SD card. Or you try to open the img file using an archive tool like 7zip.
Of course you could create your own image from an existing installation. However this would require as well a different Linux box to be able to run our own image tool. This will generate a compressed DietPi image via the dietpi-imager script.
For reference: I followed the info in link above and it worked as expected. It takes a few seconds to begin the boot sequence (i’m guessing it is because the USB boot is the last fallback) but it works perfect in the USB 2 ports. I haven’t gotten it to work in the USB 3 port but it’s already way better with USB 2 than with the SD card.
Thanks. From what I understand, this should creates a bootable clone img file from my working install so I can use balena or dd to image any drive I may need to and get the exact same environment. Correct? If so, this is perfect.
A related question: does dietpi-backup restore the exact file system, with all custom apt installs and modifications? If so, I should just be able to install the base diet pi image, run a restore on a previous backup and get the exact same setup, even the non standard diet pi modifications I may have made. Correct?
yes dietpi-imager will create a 1:1 clone from an existing installation.
yes dietpi-backup will backup your entire system and all components installed. The only thing excluded are USB drives mounted to /mnt/something. There is as well a possibility to restore a backup during first initial boot already. This would require dietpi.txt to be adjusted beforehand
# Restore a DietPi-Backup on first boot: 0 => disable | 1 => interactive restore (show list of found backups) | 2 => non-interactive restore (restore first found backup)
# - Simply attach the drive/disk/stick with contains the backup. All attached drives will be mounted temporarily and searched automatically.