A short time ago I successfully migrated my instance of DietPi to an SSD connected to a RaspberryPi4 and have now been running for a few days with no issues.
Since everything was stable, I thought to backup my SSD so that I can restore to any other SSD if needed.
I first tried to make a backup as with my SD cards via the win32Imager tool, but it was impossible to make it recognize the SDD disk.
Makes sense, I thought to myself. So I tried to make a backup with Acronis True Image as I did a few times with bootable disks containing Windows.
Unfortunately, even if the program indicates that everything went well, no restored disk works on the RaspberryPI. (Yes I always selected to keep it MBR)
Specifically, in Acronis, I tried to make a backup on my copmputer and restore it : Not booting.
After I used the disk-to-disk clone option, but still not booting once connected to the Pi.
When I plug in the cloned disk, the Raspberry won’t boot while the original SSD boots in seconds when plugged into the same USB adapter to SATS adapter.
Am I missing something about cloning Linux or PI or DietPI disk? Should I be using another software or tweek some parameters?
DietPI is running on a RaspberryPi 4, 1gb ram, 120 gb SSD.
Hey peurnoel,
maybe you only saved and restored ext4/vfat boot partition and missed the other? Or maybe the software you used couldn’t handle ext4 or vfat. Take a look into you backup and make sure both partitions are there.
If not:
Alternative way of image / backup creation:
If you are able to boot up another machine with DietPi (maybe via VM or you flash the x86_64 version to a USB stick and boot from there) and connect your SSD there, than you could use the dietpi-imager script to create an image of your disk.
Or on any other linux machine you could use dd command to create also an image of the disk.
If you are not so experienced with fdsik and the command line stuff and you can’t use another DietPi machine to use the imager, you can use dietpi-backup to backup to another external disk. It’s not exactly what you are looking for, I think (because you need to flash a fresh installation and then do the restore, if you want to use this backup on another machine. BTW the restore can be done automatically at first boot)
I don’t know if Acronis True Image support those format, I will take a look at this. I was kinda hoping that “cloning” a disk was almost like a blind copy but maybe it’s just that.
Also, I can confirm I made sure that every partitions was backed up and restored in the process.
I will have a look at the dietpi-imager script because I still have dietpi on an SD card from where I did my initial copy to the SSD.
I was kinda hoping something easier like an old school “disk ghosting” but if this is the only way, I will do it.
I will try to find time this week and keep you updated.
In the meantime, If you think of something else, do not hesitate.
Clonezilla should be able to do it…but I think it’s a separate “boot” option
I have a Ventoy pendrive that I keep a version of clonezilla and a 2nd laptop that has a microsd card and can boot from USB, haven’t tried it but it should be able to ghost the disk
https://rufus.ie/ can do a raw image creation, but it will have the size of the whole SSD. If you have another DietPi system or VM, the dietpi-imager indeed has become a nice choice for backups, since it shrinks filesystem and partition first and packs the image into a 7z archive.
But yeah “cloning” for me is bit-per-bit copying the whole disk ao should always work. Probably some flashing tools try black magic when flashing back the image. On Windows for this I can also always recommend Rufus.
I take a look at the script and to my understanding this going to do a .img of the disk.
The tool/software I know to flash or restore this type of image are for usb stick or sd/micro sdcard.
Can you do the restore to a SSD with ease from this format or you need to do more step like I did initialy to go from a system running on a microsd card to an SSD?
Just closed the pi, disconnected the disk, connected it to my Windows machine, created a raw image, zipped it to get a rar file of about 23gb for a 120gb ssd to finally unzip it and write it to a spare SSD I had of 240gb and it WORKED.
Very nice result, 23gb is way to much compare to the acronis image that was about 8gb or 9gb, but at least it worked straight away.
I realy wanted to try the script first but I’m way too noob to figure out how to get it to dietPi system, compile it, run it and give it the appropriate parameters.
To my curiosity, is there supposed to be a “how to” guide with the script?
Have a nice day and thank you again for the tips so far.
I guess you are thinking to complicate. There is nothing to compile, install or to configure. Simply boot a Linux box and run the script.
As an example, flash DietPi on a SD card, place it in your Pi and boot the system. If you did not change the boot order, SD card should be taken over SSD. Means your system should boot into the system located on SD card and leave the SSD untouched. Once up and running, start the imager script.
Jep, the 23 GiB are probably due to non-zeroed empty space. dietpi-imager reduces the filesystem size first and fills remaining empty space in gaps with zeros via zerofree, so it can be compressed more effectively. Not sure how Acronis does it, as long as it does not support ext4 to know where used data is and where not, or it doesn’t which is the reason the resulting image doesn’t boot?