Link to home
Start Free TrialLog in
Avatar of Thyagaraj03
Thyagaraj03

asked on

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.
Avatar of Frank Contrepois
Frank Contrepois
Flag of United Kingdom of Great Britain and Northern Ireland image

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
Avatar of Thyagaraj03
Thyagaraj03

ASKER

How could I do this with rsync and how to activate the boot loader from cd?. Please post commands!.
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
ASKER CERTIFIED SOLUTION
Avatar of owensleftfoot
owensleftfoot

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks. Can't I do this with dd
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
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?
With a VM it's easy :)
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
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I'll try this.