timeshift can be GUI or command line. really it is a set of features that just use RSync, but it makes stuff easy so might be worth a look. (fully supported on Ubuntu.)
I see now what you want to do. Unfortunately, doing this while the device is in use (and potentially being written to) will lead to an inconsistent image that may or may not be functional. This type of backup can only be created offline.
Install 2nd drive
Boot clonezilla,
Select source drive, select destination dirve, and select disk to disk copy
When complete the copy will also be bootable.
When you boot clonezilla live.
( from your optical or usb drive ) you are not running the os on your hard drive.
So essentially it is not being written to at all
It wil be dd copied from the systems hdd to the second or destination drive.
And it includes the boot sector information from the source.
This make the cloned drive bootable as well.
This is all i use.
With a desktop computer equipped with hot swap bays, swapping a drive is as fast as shutdowm, swap tray, and reboot.
Even with a slow machine your only looking at 3 to 5 minutes downtime.
If youve never used clonezilla i highly suggest going to their site and take the time to read it carefully.
There are many ways to clone a drive, but for most general purposes you should select disk to disk clone.
You can also do just partition cloning by various methods as well.
And with the net clone option ( machine to machine( or multiple simultanious machine to machine) you can really go big
However a word of caution on this method.
Net cloning must not be connected to the internet or any machine you dont want erased.
You can use whatever method you wish.
Most live backup solutions short of direct copying only copy data and can be recovered by restoration.
But reading data formats without the proper software just results in errors.
The problem that generally arises is that people rarely log document backups specifically.
Important data is backed up frequently depending on the amount of work that was done.
Or when installing new software.
Windows repair dates allowed you to recover your system to set save points. You could choose from to undo a problem following an update or install.
This took over the intrinsic need for backups.
But did not address the loss of work.
Backing up prior to a system software change allowed up to date data files.
In the event of a fatal system crash, your os could be restored, drive could be replaced, os installed, and data restored from the backup with very little data loss.
Archiving files is an art form if done properly!
Transcribing information from older media to newer keeps the data in up to date media.
This serves a purpose for research reasons
Logging the backups was not difficult but many regard logging or even backing up data as a pain in the arse.
Keeping a log book is simple. Date, reason, comment, machine, and initials
And the log book can be anything from a notebook, to an actual log book.
( note here (Not a file on a computer, failure of that drive or corruption of that file and your index is lost))
In the past 25 years most people have virtually forgotten the importance of backups because of the ever increasing size of storage media.
And then piss and moan when they lose gigabytes or terabytes of data when the drives take a s#!t
Yeah im showing my age here🤣
Im an old fart!
I tend to be a bit surley because when my customers blame their machines for losing their data from crashes. ( they expect me to rescue them from their own preventable screw ups)
And get obnoxious when you cant recover a dead drive.
But, larger storage reduced pruning/ effective choice in what to keep, whee before, the limit meant one had to prune, and also backed up what was left, now pruning less needed, backup not considered either?
Ive gotta admit though, first time using clonezilla can be very daunting because there are so many choices.
But under guidance in proper choice and method, its dead simple after the first couple times.
We used to clone drives at work with a kangaroo hardware disk cloner ( gawd that thing was slow)
And it took about 6 hours to clone a 40 gig drive.
Clonezilla did it in 10 minutes ( this was about 15 years ago)
Aside from the hash file number the copies were identical
In the term as a boot drive yes both are able to boot. But your system will boot from the default or higher level in the boot order.
Cloning a boot drive gives you a redundant os drive. In the event your original fails, its just a simple swap out without the hassle of re installing everything.
Non os storage can be cloned as well.
The only issue you may run afoul on is hotswap of the old scsi hdd’s in a raid ( damn im showing my age now)
But then when the system boots, if the boot loader is grub it looks for the OS by UUID, and when the OS boots by default it mounts volumes by UUID. If the UUIDs are not unique, you might get either. I mentioned it because I did it, and the booted OS was not from the drive I’d chosen in the boot order.
Generally the drive you are cloning is not left in the machine but reserved as a safety copy.
Disk to disk cloning is making an exact copy including the boot sectors.
However partition to partition cloning make exact copies of source partition onto the destination disk.
Clonezilla is powerful! Of that there no doubt.
Many of its functions can be done in terminal but clonzilla is far easier.
Gparted is another power tool.
I used to use dban to wipe drives but it doesnt work very well on sata/ pata drives.
While it does blank them it will close with errors.
So run gparted repartion the drive.
Shut down, reboot gparted, delete the partitions and repartition it again.
Any old data is unrecoverable.