User Tools

Site Tools


bash:transfer_disk_over_ssh

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

bash:transfer_disk_over_ssh [2014/11/12 14:59] – created biggibash:transfer_disk_over_ssh [2014/11/12 15:29] (current) – removed biggi
Line 1: Line 1:
-Recently I had to move some VPSes from one server to another, as the old server was being shut down (new cheaper and faster host). To minimize the downtime, I took data from one LVM volume and put it directly in the LVM of the new server. 
  
-Receiving side: 
-<code>time nc -l 19000 | pigz -d -k -c - | dd of=/dev/vps-vg/vps04</code> 
-**Explanation:** 
-  * I use "time" just for stats (so it's not required) 
-  * I set up a listening netcat socket on port 19000, awaiting data from the "sending side" 
-  * I decompress incoming data from netcat with pigz ("-" is for data coming from "stdin") 
-  * Finally I put the decompressed data into the new LVM volume with "dd" (dd grabs its data from stdin if no "if" parameter is set) 
- 
-Sending side: 
-<code>dd if=/dev/vg0/vps04 bs=4096k | pigz -9 -b 4096 -c | nc RECEIVING.SERVER.TLD 19000</code> 
-**Explanation:** 
-  * I read the data with dd 
-  * I compress it with pigz 
-  * I then use netcat to send the data. 
- 
-**NOTE:** You need to start the "receiving side" first, otherwise the "sending side" will fail due to netcat being unable to establish a connection. 
bash/transfer_disk_over_ssh.1415800786.txt.gz · Last modified: 2015/08/15 22:56 (external edit)

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki