gentoo:netcat_disk_copy
Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| gentoo:netcat_disk_copy [2010/01/26 10:29] – created deva | gentoo:netcat_disk_copy [2013/10/28 08:19] (current) – deva | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ======Netcat disc copy====== | ======Netcat disc copy====== | ||
| + | NOTE: The netcat binary can be compiled with the ' | ||
| + | |||
| =====Copy an entire partition===== | =====Copy an entire partition===== | ||
| The client is a computer with ip 192.168.0.10.\\ | The client is a computer with ip 192.168.0.10.\\ | ||
| Line 23: | Line 25: | ||
| The server (the computer on which the disc to be copied resides) must run the following as root: | The server (the computer on which the disc to be copied resides) must run the following as root: | ||
| <code bash> | <code bash> | ||
| - | tar cvj . | nc -q 0 192.168.0.10 10000 | + | tar --preserve -cvj . | nc -q 0 192.168.0.10 10000 |
| </ | </ | ||
| Line 31: | Line 33: | ||
| The client (the computer on which the image is to be stored) must run the following as someuser: | The client (the computer on which the image is to be stored) must run the following as someuser: | ||
| <code bash> | <code bash> | ||
| - | nc -l -p 10000 > files.bz2 | + | nc -l -p 10000 > files.tar |
| </ | </ | ||
| The server (the computer on which the disc to be copied resides) must run the following as root: | The server (the computer on which the disc to be copied resides) must run the following as root: | ||
| <code bash> | <code bash> | ||
| - | tar cv . | nc -q 0 192.168.0.10 10000 | + | tar --preserve |
| </ | </ | ||
| + | =====Restoring files from tar===== | ||
| + | Assuming the server (the computer to have its files restored) has ip 192.168.0.59\\ | ||
| + | On the client (the computer containing the backed up files) run the following: | ||
| + | <code bash> | ||
| + | nc -l -p 10000 | tar --preserve -xvf - | ||
| + | </ | ||
| + | |||
| + | On the server, change to the directory into which the files should be restoed and run the command: | ||
| + | <code bash> | ||
| + | cat files.tar | nc -q 0 192.168.0.59 10000 | ||
| + | </ | ||
| + | |||
| + | =====Restoring partition from tar===== | ||
| + | TODO | ||
| + | |||
| + | =====Restoring disk from bz2 archive===== | ||
| + | Sender: | ||
| + | < | ||
| + | bzcat -d centos_6.4_minimal_desktop.dd.bz2 | nc -q 0 192.168.0.51 10000 | ||
| + | </ | ||
| + | |||
| + | Receiver: | ||
| + | < | ||
| + | nc -l 10000 | dd of=/dev/sda | ||
| + | </ | ||
gentoo/netcat_disk_copy.1264498147.txt.gz · Last modified: by deva
