Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Ubuntu copy & restore disk image over wan

Posted on 2010-11-25
12
Medium Priority
?
550 Views
Last Modified: 2012-06-27
How do I zip & copy running ubuntu hard disk image directly to the remote system over wan links without copying it on a local disk. And again I want to restore the zipped image directly from the remote system when required booting from live cd.
0
Comment
Question by:Thyagaraj03
  • 5
  • 3
  • 3
  • +1
12 Comments
 
LVL 9

Expert Comment

by:fcontrepois
ID: 34215890
I think rsync is able to do this. But you surely need to activate the boot loader from the  cd

Nb: take care of the dynamic folders like /dev or /proc for exampke
0
 

Author Comment

by:Thyagaraj03
ID: 34215907
How could I do this with rsync and how to activate the boot loader from cd?. Please post commands!.
0
 
LVL 9

Expert Comment

by:fcontrepois
ID: 34215928
That's an hard task.

Another way could be to use the pxe boot

Check https://wiki.koeln.ccc.de/index.php/Ubuntu_PXE_Install
0
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 17

Accepted Solution

by:
owensleftfoot earned 668 total points
ID: 34216109
0
 

Author Comment

by:Thyagaraj03
ID: 34216397
Thanks. Can't I do this with dd
0
 
LVL 35

Assisted Solution

by:torimar
torimar earned 1332 total points
ID: 34216830
You can - theoretically - use 'dd' over netcat.
But, as fcontrepois pointed out already, it's not an easy task. You need to be ready to dig through long instructions and run some testing.

Here are three articles that describe the method in less and more detail; one even offers scripts for automation:
http://digiassn.blogspot.com/2006/01/dd-over-netcat-for-cheap-ghost.html
http://linuxtipsandtricks.com/shell/disk-imaging-with-netcat-and-dd-with-ubuntu-linux/
http://www.rajeevnet.com/hacks_hints/os_clone/os_cloning.html

(Note that the last and most comprehensive article was written in 2001)

@owensleftfoot:
FOG only backups Windows systems.
0
 

Author Comment

by:Thyagaraj03
ID: 34217125
Instead of dd with netcat I'm using dd with ssh
The command I used to copy disk image over wan is below:
On a Running VM:
apt-get install pv
dd if=/dev/sda bs=64k conv=noerror,sync | pv | gzip -c -9 | ssh root@remote_server dd of=sdX.img.gz

On a New VM with no os I booted from ubuntu live cd I used the following commands:
sudo vim /etc/apt/sources.list file -------un commented the deb's
sudo apt-get update
sudo apt-get install pv

I used the following cmd to restore the image from the remote system, but it's not the right way to use as it's blurring up and down. I need the right syntax here:
ssh root@remote-ip dd if=sda.img.gz | gunzip -c -9 | pv | dd if=/dev/sda bs=64k conv=noerror,sync
but some how restored it

When I tried to install the grub, the device is not mounting. After I restarted, the system stalled at the grub load. How could I make it boot?. FYI, I'm trying to install on a new machine.
0
 
LVL 35

Expert Comment

by:torimar
ID: 34221091
There was no mentioning of the fact that this was about VMs.

Why didn't you simply copy over the virtual disk image (.vdi) or export/import the machine from the VBox interface?
0
 
LVL 9

Expert Comment

by:fcontrepois
ID: 34221242
With a VM it's easy :)
0
 

Author Comment

by:Thyagaraj03
ID: 34224456
No. I should do this on cloud servers. But before that I should ensure that what I'm going to do works fine with no harm to the system and I'll check this on vm's
0
 
LVL 35

Assisted Solution

by:torimar
torimar earned 1332 total points
ID: 34224801
Have you considered using MondoRescue: http://www.mondorescue.org/

Since it lets you restore to a completely wiped disk with other disk geometry, it will also be usable, I gues, for restoring to a different box, as long as system specs are comparable: http://www.mondorescue.org/docs/mondorescue-howto.html#AEN951
0
 

Author Comment

by:Thyagaraj03
ID: 34333336
I'll try this.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Backups and Disaster RecoveryIn this post, we’ll look at strategies for backups and disaster recovery.
Stellar Exchange Toolkit: this 5 in 1 toolkit comes loaded with mega-software tool. Here’s an introduction to tools’ usage and advantages:
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

916 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question