LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Virtualization and Cloud (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/)
-   -   how to restore backup from an LVM Guest OS on KVM Lucid (https://www.linuxquestions.org/questions/linux-virtualization-and-cloud-90/how-to-restore-backup-from-an-lvm-guest-os-on-kvm-lucid-835153/)

tkmsr 09-29-2010 06:00 AM

how to restore backup from an LVM Guest OS on KVM Lucid
 
I have a Ubuntu 64 bit 10.04 instance running.KVM is used for virtualization.
4 Guest Operating Systems are running on it.
I created 4 lvms after installing the Host OS.
I have a volume group nintendo which have four lvms
as
Code:

lvscan
  ACTIVE    '/dev/nintendo/lvm1' [100.00 GiB] inherit
  ACTIVE    '/dev/nintendo/lvm2' [150.00 GiB] inherit
  ACTIVE    '/dev/nintendo/lvm3' [50.00 GiB] inherit
  ACTIVE    '/dev/nintendo/lvm4' [100.00 GiB] inherit

but in the above 4 lvms I did not created swap partitions.
These things were taken care via virt-manager when I installed the guest OS.
So when I took backup I did not took backup of swap paritions.
I have the complete directory structure from lvm1 which I took the backup.
If I have to replace one of the lvm with the original backup then is just copying the complete directory structure going to work.
Or there is some elegant way to do this?

acid_kewpie 09-29-2010 06:07 AM

it's quite unclear what you're doing here really, you want to know how to restore a backup of one LVM device? Well if that's the case then KVM has nothign to do with any of this, and you simply have a boring block device in the LVM LV, the contents of which you can dd in and out as often as you desire. Obviously the KVM instance should be shut down throughout changes, but it's fairly simple stuff there. Swap should have no relevance in any of this. You shouldn't need swap in a vm, as I understand it you should allocate as much memory ass you see fit and KVM will swap out the physical host memory to host based swap if need be, but either way a swap partition would be inside the LV, so just more binary data when looking at it at the LVM level.

tkmsr 09-29-2010 06:12 AM

Quote:

Originally Posted by acid_kewpie (Post 4112441)
you want to know how to restore a backup of one LVM device?

Yes.
I got the following error when I tried to boot from the backup on USB
Code:

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/manager.py", line 652, in restore_saved_callback
    newconn.restore(file_to_load)
  File "/usr/share/virt-manager/virtManager/connection.py", line 681, in restore
    self.vmm.restore(frm)
  File "/usr/lib/python2.6/dist-packages/libvirt.py", line 1453, in restore
    if ret == -1: raise libvirtError ('virDomainRestore() failed', conn=self)
libvirtError: operation failed: image magic is incorrect

When I took the backup I created a snpashot of LVM and mounted that
snapshot in some location.This mounted directory I copied on a USB via rsync and I am trying to boot this.


All times are GMT -5. The time now is 04:10 AM.