What is the best way to do a carbon copy backup to a usb ssd?

what is the best way to do a carbon copy backup to a usb ssd?

Define carbon copy please

easy: rsync

If you’re comfortable with the command line, then rsync would be a good choice.

What to use also depends on what you’re backing up and how you plan to restore it. It also depends on what you mean be carbon copy. If it’s a usb-drive formatted for fat32, you might not be able to faithfully copy all permissions.

But let say you have a normal user folder to backup, and let’s also say the usb-drive is formatted with a Linux filesystem. You might be do something like:

rsync -ax -HAX --delete  --sparse --progress  ~/myFolder/ /mnt/someUsbDrive/myFolderBackup/

The rsync man page will fill you in on the options I’ve suggested, but basically this recursively copies the folder including ownerships, permissions and any special file attributes. Plus it deletes files in the destination that don’t exist on the source (to create exact carbon copy).

If “carbon copy” means an exact bit-by-bit copy of a device (hdd, nvme, …) or a partition on a device then dd should do what you are looking for.

But you must ensure that the target device is large enough to hold all of the source (i.e. not only the data of the source but the “empty space” as well).

Making a complete and identical backup to an external usb disk

I think the words “complete” and “identical” are a bit superfluous, except when you have a special meaning for it that deviates from what most people think backups are.

And you fail to tell what you want to backup. A set of files? A file system? A mass-storage device?

I want to make a identical snapshot of my internal SSD to an external drive

I do again not understand the meaning of “identical” here. Or do you really think people love to make copies that are not identical to their originals?

But in the case of making a copy of all the bytes of a disk, I would advice dd . And as mentioned above, difference of size may matter. Not only when the target is smaller (obvious), but also when it is larger then the source, depending on what is on the source.

what was mention earlier in the thread “bit by bit” is what I am going for, since what I want to do is just boot a live disk and use sudo cp to rewrite my internal ssd with a snapshot

Or take a look on “clonezilla”.

1 Like

More mystery :wink:. Bit-by-bit? That would be dd or btrfs send . That said, it is totally unclear what sudo cp has to do with all this.

1 Like

@40476 It’s all or nothing with the dd command, aside from the horendous write operation to the disk which won’t be fast (recommend a powered USB device). Maybe something like timeshift will suffice.

I don’t use snapshots here, I only care for my data, so a fresh install and configure if needed takes way less than an hour.

I would suggest coming up with a few scenarios for you system(s). Have three devices of the same size, decide on the backup test, do it to the external media, pop in the third device and use the backup to restore and see how it goes…

I have a data partition that I use rsync over ssh to another system, I then have a script to restore configs required as well as setup my $HOME as files and softlinks…

this is from the clonezilla website

The partition to be imaged or cloned has to be unmounted

does this mean I would have to unmount my system disk first?

1 Like

also, is this the proper command?

dd if=/dev/sda | dd of=/dev/sdb

There was no mentioning of “system disk” before. But yes, when you want to make a byte for byte copy of anything, it should not be used at the same time because then you could get inconsistent results. And when the source is, or contains, file systems, then those should be unmounted. Doing it with dd , cp or Clonezilla.

BTW, it seems that some of the posters here interpret your usage of “snapshot” as meaning a Btrfs snapshot (and give advice based on that). I interpreted in this topic “snapshot” as being a synonym of “backup” and of “copy”. Please read my advice as based on that: complete independent of what the bytes on the device mean to represent.

@40476 I would add progress dd if=/dev/sda | dd of=/dev/sdb status=progress

Nice for some people. My idea would more be instead of staring at the progress, going to the pub. But that is all very personal :wink:

1 Like
usr_40476@localhost:~> sudo if=/dev/sda | dd of=/dev/sdc status=progress
dd: failed to open '/dev/sdc': Permission denied

dd if=/dev/sda of=/dev/sdb status=progress