If both computers are on the same (safe) LAN, I recommend a different approach using netcat
. This is usually much faster as it doesn't encrypt the data.
root@good_host$ cd good_partition; netcat -l -p 1234 | tar xvpmf -
root@bad_host$ tar -cv -f- --exclude=/proc --exclude=/sys / | netcat good_host.ip 1234
which opens a listening port 1234 on the good machine netcat -l -p 1234
and pipes the incoming data to tar
to extract (preserving mtime and permissions). The bad host sends the data to this port, also using tar
and netcat
. I included some --exclude
parameters, as /proc
and /sys
are virtual filesystems and hence useless on the new host. (especially the file representing your RAM in (/proc/kcore
) will add an unnecessary amount of data).
However, you should (also) consider to make a dd
dump of the failing drive's partitions:
user@good_host$ cd good_partition; netcat -l -p 1234 > dump_of_bad_partition_1.dd
root@bad_host$ dd if=/dev/sda1 | netcat good_host.ip 1234
where you had to adopt /dev/sda1
to the right device. Do that with other partitions on the failing drive, too.
With that dump you are sure, that you did not miss any important metadata (like ACLs) which tar
won't capture.
offtopic. not a programming question. but try
ssh user@failingsys "tar cfz - /" > oldsys.tar.gz
– None – 2013-05-11T04:46:30.750You want to take care that you do not tar /dev/ (e.g. /dev/random, /dev/sdX, ... ). Ditto /proc/ – Hennes – 2013-05-11T10:00:03.417