User Tools

Site Tools


blog:copy_a_filesystem_from_one_computer_to_another_using_tar_and_netcat

This is an old revision of the document!


Copy a filesystem from one computer to another using tar and netcat

If you need to transfer an entire filesystem from one machine to another, for example, when you get a new computer, do the following steps.

  1. Boot both PCs with any Linux live CD (for example, Knoppix), and make sure they can access each other via the network.
  2. On the source machine, mount the partition containing the filesystem to be copied, and start the transfer using netcat and tar:
    cd /mnt/sda1

tar -czpsf - . | pv -b | nc -l 3333

  1. On the destination machine, mount the partition to receive the filesystem, and start the process:

cd /mnt/sda1

nc 192.168.10.101 3333 | pv -b | tar -xzpsf -

The nc (netcat) command is used for any kind of TCP connections between two hosts. The pv (progress viewer) command is used to display the progress of the transfer. tar is used to archive the files on the source machine and un-archive them on the destination.

~~LINKBACK~~

Discussion

Enter your comment. Wiki syntax is allowed:
   ____   _  __   ____   __ __  __  __
  / __/  / |/ /  / __/  / // / / / / /
 / _/   /    /  / _/   / _  / / /_/ / 
/___/  /_/|_/  /___/  /_//_/  \____/
 
blog/copy_a_filesystem_from_one_computer_to_another_using_tar_and_netcat.1255334394.txt.gz · Last modified: 2009-10-12 09:59 by brb