tar is intended to work on the file level
You can use
tar to create an archive of directories and files, and the archive may or may not be compressed.
This way you can backup the content of the root partition, /, and other partition(s), that you may have in your system.
Examples (run when running another system, e.g. booted from a USB pendrive)
sudo mkdir /mnt/sd1
sudo mkdir /mnt/sd2
sudo mkdir /mnt/sd3
sudo mount /dev/nvme0n1p1 /mnt/sd1
sudo mount /dev/nvme0n1p2 /mnt/sd2
sudo mount /dev/nvme0n1p3 /mnt/sd3
sudo tar -cvzf root.tar.gz /mnt/sd1
sudo tar -cvzf home.tar.gz /mnt/sd2 # optional
sudo tar -cvzf data.tar.gz /mnt/sd3 # optional
It is easy to access a single backed up file, particularly if you do not compress the archive. This is good.
But the partition table (and BIOS bootloader (necessary to boot in BIOS mode)) will not be backed up.
Clonezilla works on a whole drive
You can use Clonezilla, which is a tool to clone or create a [compressed] image of the content of a whole drive with partitions and bootloaders, everything.
- Download a Clonezilla iso file,
- create a USB boot drive,
- boot from it and
- let Clonezilla do it for you.
Clonezilla is smart enough to only copy used blocks in the file system(s) and skip free space. It will also compress the image, so it is both faster and creates a much smaller image (compared to plain cloning with for example
dd). The image is not one file, but a directory with a set of files, and you use Clonezilla to restore from the image.
Clonezilla has also several checkpoints to help you identify the drives and make sure that, when backing up, you are reading from the correct drive, and when restoring, that you are writing to the correct drive.