It has been determined already in this question that tar
cannot read input from stdin
.
How else can a dd
output be archived directly possibly without using any compression? The purpose of doing everything in a single task is to avoid to write the dd
output to the target disk twice (once as a raw file and once as an archive), and to avoid to perform two different tasks, which is a waste of time (since the input file must be read and written and the output read, processed and written again), and can be impossible if the target drive is almost full.
I'm planning to do multiple backups of drives, partitions and folders, and I'd like to benefit both from the ease of having everything stored into a single file and from the speed of each backup / potential restore task.
dd if=/dev/sdXY | tar ...
, but why nottar
directly:tar cf foo.tar /dev/sdXY
?stdout
and has not a proper entry into the filesystem it cannot be archived directly by simply piping it totar
. Anyway my bad, i wrote partitions but i actually want this to work for whole drives, and that's the reason why i need to usedd
firsttar
just packs all the files together, while i need to keep the partition scheme as welltar
does not backupMBR
/GPT
, since those sectors are outside of the filesystem "scope", therefore no partition table is backed up, and you'll need to recreate the partition scheme manually once you made a back up withtar
, while withdd
there's no such needtar
does back upMBR
/GPT
right? So how would you restore from a backup? Let's say itar cf sda.tar /dev/sda
and move the tarball tosdb
, then i switch the originalsda
disk for a newer one of the same capacity. This disk comes of course with just unallocated space. How would you restore starting from this point?