Welcome to the Slackware Documentation Project

This is an old revision of the document!

How to copy files \ directories \ filesystems via network.

The article describes ways of copying content over network. When upgrading a home server, I copy all the data from the old server to a new system. In the examples below, I work from the new server and both servers are on the same subnet:

  • New server (IP:
  • Old server (IP:

Both the ssh and scp commands communicate over a secure connection (TCP port 22). Please note that you need to enable the sshd daemon on the remote host.

Files \ single folder copying

If you need a copy of standalone files or folders, you can use an scp util:

scp -r -v -p root@ /From_Old_Server


  • -r key do recursive , copy all data in “/etc” folder and all its subfolders.
  • -p key preserve file attributes, like a creation, modification times.
  • -v gives us verbose output.

In there example we copy “/etc” folder from computer ( actually, “Old” server), to folder “/From_Old_Server” in local computer ( “new” server).

Sadly, but that command ( scp ) cannot copy whole system disk, contains “/proc”, “/dev” and even “/lost+found” catalog, who is it in every mounted extX filesystem partition - at that places “scp” stuck and stops.

Thanks to Patrick, “Volkerdi” gives us workaround for that situation:

Copy whole filesystem


ssh root@ "(cd / ; tar cf - . )" | (mkdir -p /From_Old_Server ; cd /From_Old_Server ; umask 000 ; tar xvf -)

help us transfer full filesystems without stuck and pain from “old” to “new” computer.


  • Originally written by John Ciemgals 2013/02/10 03:51
  • With help from Patrick Volkerding

In Other Languages
Translations of this page?:
QR Code
QR Code howtos:general_admin:files_filesystem_copying_over_network (generated for current page)