Copying a Disk Image Over SSH

  1. Enter the following command on the receiving machine. Replace 123.45.67.89 with the Linode’s IP address and /home/archive/linode.img with the path where you want to store the disk image:
    ssh root@123.45.67.89 "dd if=/dev/xvda " | dd of=/home/archive/linode.img
  2. The receiving machine will connect to the Linode. Type yes and press Enter to continue connecting:
    The authenticity of host '123.45.67.89 (123.45.67.89)' can't be established.
    RSA key fingerprint is 39:6b:eb:05:f1:28:95:f0:da:63:17:9e:6b:6b:11:4a.
    Are you sure you want to continue connecting (yes/no)? yes
  3. Enter the root password for the Linode, as shown below
    Warning: Permanently added '123.45.67.89' (RSA) to the list of known hosts.
    root@123.45.67.89's password:
  4. The transfer starts. You’ll see output similar to the following.
    4096000+0 records in
    4096000+0 records out
    2097152000 bytes (2.1 GB) copied, 371.632 seconds, 5.6 MB/s
    4096000+0 records in
    4096000+0 records out
    2097152000 bytes (2.1 GB) copied, 364.002 s, 5.8 MB/s

Note that copying your disk image can take a while. Be patient!

Verifying the Disk Image

Once the copy has completed, you can verify it by mounting the image on the receiving machine. Here’s how:

  1. Log in to the receiving machine as root by entering the following command and entering the root user’s password:
    su
  2. Make a directory on the receiving machine by entering the following command:
    mkdir linode
  3. Mount the disk image by entering the following command, replacing linode.img with the name of the disk image:
    mount -o loop linode.img linode
  4. View the directories stored on the disk image by entering the following command:
    ls linode/
  5. You should see the directories on the disk images, similar to the ones shown below:
    bin   dev  home  lost+found  mnt  proc  sbin     srv  tmp  var
    boot  etc  lib   media       opt  root  selinux  sys  usr
Advertisements

Share your thoughts with us!!!

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s