Difference between revisions of "Transfer image compressed via SSH"

From Univention Wiki

Jump to: navigation, search
(Link angepasst.)
Line 1: Line 1:
Mit Standard-Linux-Werkzeugen können das Auslesen und Übertragen von Festplattenimages (etwa im Rahmen einer [[Migrating_a_native_UCS_installation_to_UVMM#Copying_the_harddrive | physical-to-virtual Migration]]) unkompliziert vorgenommen werden.
+
{{Cool Solutions Disclaimer|Repository=no|UCS=3.2}}
  
dd if=/dev/sda | gzip | ssh root@<Host> " gunzip | dd of=/var/lib/libvirt/images/image.img" bs=2K
+
This article describes the how to of copying Harddrive Images compressed via SSH.
  
Ruft man den obigen Befehl nach dem Booten von einer Linux-Live-CD auf, liest das Programm '''dd''' die Festplatte '''/dev/sda''' aus.  
+
== Introduction ==
 +
The copy procedure can be easily done with standard Linux system tools.
  
Die Ausgabe wird mit '''gzip''' komprimiert, per '''ssh''' auf einen entfernten Rechner übertragen, dort mit '''gunzip''' entpackt und in die Datei '''image.img''' am angegebenen Pfad geschrieben.
+
To copy an image from your local device ''/dev/sda'' to a virtualization host, execute the following command:
  
Das Festsetzen der Blockgröße auf 2 Kbyte macht die Übertragung großer Dateien performanter.
+
<pre>
 +
dd if=/dev/sda | gzip | ssh root@<HOST> " gunzip | dd of=/var/lib/libvirt/images/image.img
 +
</pre>
 +
 
 +
== Explanation ==
 +
 
 +
'''dd''' reads the Harddrive ''/dev/sda/'', the output is being compressed by '''gzip'''. The compressed file will be transmitted to the foreign host with '''ssh''' and there decompressed with gunzip which writes the file to the given path. The block size of 2 Kbyte makes the transmission of bigger files more performant.

Revision as of 10:05, 23 October 2014

Produktlogo UCS Version 3.2

Note: Cool Solutions are articles documenting additional functionality based on Univention products. Not all of the shown steps in the article are covered by Univention Support. For questions about your support coverage contact your contact person at Univention before you want to implement one of the shown steps.

Also regard the legal notes at Terms of Service.


This article describes the how to of copying Harddrive Images compressed via SSH.

Introduction

The copy procedure can be easily done with standard Linux system tools.

To copy an image from your local device /dev/sda to a virtualization host, execute the following command:

dd if=/dev/sda | gzip | ssh root@<HOST> " gunzip | dd of=/var/lib/libvirt/images/image.img

Explanation

dd reads the Harddrive /dev/sda/, the output is being compressed by gzip. The compressed file will be transmitted to the foreign host with ssh and there decompressed with gunzip which writes the file to the given path. The block size of 2 Kbyte makes the transmission of bigger files more performant.

Personal tools