Would this work or would I have problems:
Using dd command to backup an entire SSD containing dual boot Windows/Ubuntu partitions into an .iso file, with the intent to then dd that iso back onto the same size SSD in the case of a drive failure?
Like everyone has said there’s way better ways of doing it.
HOWEVER if you wanted to use dd you totally could. I’d recommend piping into something like gzip/zstd to save some space though.
dd if=/dev/sda | gzip >/mnt/backup_disk/sda.gz
You could also use restic backup the raw block device too.
That being said, clonezilla is exactly what you want
It would technically work, yes.
But also, you’re wasting a lot of storage space that way, especially if you do it often. You really only should backup your home directory, it contains all your data. You can simply re-install the rest from the internet.
you can even mount the image as a loop device (i suggest read only (ro)) to extract files
Many years ago I tried it, but didn’t really read up on it. Wanted to back up my Pi’s sdcard while the system was running. I even fucking named that script “online-backup”.
Now every time I ran that, after hours, I noticed my Pi was crashing, and never booted back up. I used chinese sd cards so I blamed it on them.
But this happened multiple times, just to learn I was using dd absolutely wrong.
dd was always a scary utility to me, and still is. I fucked up things with dd, regardless I quadruple checked everything 😅
but to answer the question; it’s possible, but you really need to know what are you doing.
Don’t do this. If you have a 1TB drive with only 10GB being occupied, your image will be 1TB, and you will need a >1TB drive to store it, and another to restore it.
If you only backup the data you could do it in a much smaller size drive and it will be a lot faster to perform backups (otherwise you will need hours every time you want to create a new image).