1

I have two drives setup as follows: First HDD

Second SSD

My goal is to boot into a Linux 22.04 install on the first drive pictured located on partition labelled "Admin-1", and use the "Disks" utility to create a clone of the partition labelled "WebDev-1" on the second drive pictured (which contains another installation of Linux 22.04). I want to save this .img file on the partition labelled "WebDev-1-Backup" which you can see in the first image. Both partitions are the exact same number of bytes.

Unfortunately, when I've tried to do this using disks and "create partition image" I get an error message that looks like this:

enter image description here

I use the "WebDev-1" partition as an os to boot into to try and do some web development stuff, the problem is in the process of installing various things its common to brick the install, which is why I want to use the "Admin-1" Ubuntu image to periodically create clones of it for backup and restoration when things go wrong.

Not sure why I'm getting this error message, or if there is another slightly different way of doing this. The goal is basically just to have "WebDev-1-Backup" partition be an exact copy of the "WebDev-1" partition that I can overwrite and replace as needed.

I was able to accomplish something very similar in the past, and I thought I was only using the Disks utility to do it, but I may be misremembering. Any tips appreciated.

1 Answers1

0

I wasn't able to figure out how to do this using disks, but I found that I was able to accomplish the goal by using a couple of terminal commands instead:

To backup: sudo sh -c "dd if=/dev/sdb3 status=progress | xz -c > /media/laraki/WebDev-1-Backup.img.xz"

(replace /dev/sdb3 with whatever partition you want to backup, and /media/laraki/WebDev-1-Backup with the location and name of your desired backup file)

To restore from backup: sudo sh -c "xz -d -c /media/laraki/WebDev-1-Backup.img.xz | dd of=/dev/sdb3 status=progress"

(Here again just replace with your location of backup file and the partition you want to restore. )

In my case these worked and allow me to login to my "admin" os to create and restore from backup points.

Don't use these commands on a partition which is currently in use as apparently it could lead to corrupted data.