• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 595
  • Last Modified:

Ubuntu copy & restore disk image over wan

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
Thyagaraj03
Asked:
Thyagaraj03
  • 5
  • 3
  • 3
  • +1
3 Solutions
 
Frank ContrepoisVP Technical SalesCommented:
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
 
Thyagaraj03Author Commented:
How could I do this with rsync and how to activate the boot loader from cd?. Please post commands!.
0
 
Frank ContrepoisVP Technical SalesCommented:
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
Network Scalability - Handle Complex Environments

Monitor your entire network from a single platform. Free 30 Day Trial Now!

 
owensleftfootCommented:
0
 
Thyagaraj03Author Commented:
Thanks. Can't I do this with dd
0
 
torimarCommented:
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
 
Thyagaraj03Author Commented:
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
 
torimarCommented:
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
 
Frank ContrepoisVP Technical SalesCommented:
With a VM it's easy :)
0
 
Thyagaraj03Author Commented:
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
 
torimarCommented:
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
 
Thyagaraj03Author Commented:
I'll try this.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Network Scalability - Handle Complex Environments

Monitor your entire network from a single platform. Free 30 Day Trial Now!

  • 5
  • 3
  • 3
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now