WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-users

Re: [Xen-users] How to Backup and Restore MBR within Logical Volumes?

To: Geert Janssens <info@xxxxxxxxxxxx>
Subject: Re: [Xen-users] How to Backup and Restore MBR within Logical Volumes?
From: "Mr. Teo En Ming (Zhang Enming)" <space.time.universe@xxxxxxxxx>
Date: Thu, 12 Nov 2009 09:45:28 +0000
Cc: "Community assistance, encouragement, and advice for using Fedora." <fedora-list@xxxxxxxxxx>, space.time.universe@xxxxxxxxx, xen-users@xxxxxxxxxxxxxxxxxxx, Fedora Xen <fedora-xen@xxxxxxxxxx>
Delivery-date: Thu, 12 Nov 2009 01:46:21 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type; bh=iy2ZAHMHhnJYBtQCTY9qH/iJ9yyCf8uz5g8ttHlh0dw=; b=x/ohVqMfGCm9U7hIhInVfdk9T52JWbDAD+A+R9mSQXYzXBtXPP+6b3rvPFsLE6XKS8 NkpPMjU57lwbEILEANzT722MWTQ+nOBR1EDEsL04OYh/TmzN7xg9YFTzW0eiOIrCzwEB YIeQfqa36f9KnWyr0IWGV+/9q5milkZ0rOEx0=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=Y0/g1gPjkgk4Vx+7jBkGhsV81KTHAobGI6/RY9xaLAd7v8kQArcfi3ujjSWDFyRcW6 owRUn0PFgTqL/gjOb7Jq0i4Nz4h9lahSHE5u2to9MX/PTbzUP7aoLPAJq2q6ssmH5Vva sUj5CFOHR8JD0Dvqex+UzNNLrR464BGxO4CGA=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <200911121036.33057.info@xxxxxxxxxxxx>
List-help: <mailto:xen-users-request@lists.xensource.com?subject=help>
List-id: Xen user discussion <xen-users.lists.xensource.com>
List-post: <mailto:xen-users@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-users>, <mailto:xen-users-request@lists.xensource.com?subject=unsubscribe>
References: <f712b9cf0911120123l685a1c53te4d0c7b7634b3e60@xxxxxxxxxxxxxx> <200911121036.33057.info@xxxxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx
> dd if=/dev/virtualmachines/windows7-x64 of=mbr.w7-x64 bs=512 count=1

I think if you do this, you are only backing up the first 512 bytes of the logical volume, not the MBR.

Someone correct me if I am wrong.

--
Mr. Teo En Ming (Zhang Enming) Dip(Mechatronics) BEng(Hons)(Mechanical Engineering)
Alma Maters:
(1) Singapore Polytechnic
(2) National University of Singapore
My Primary Blog: http://teo-en-ming-aka-zhang-enming.blogspot.com
My Secondary Blog: http://enmingteo.wordpress.com
My Youtube videos: http://www.youtube.com/user/enmingteo
Email: space.time.universe@xxxxxxxxx
Mobile Phone (Starhub Prepaid): +65-8369-2618
Street: Bedok Reservoir Road
Country: Singapore

On Thu, Nov 12, 2009 at 9:36 AM, Geert Janssens <info@xxxxxxxxxxxx> wrote:
On Thursday 12 November 2009, Mr. Teo En Ming (Zhang Enming) wrote:
> Hi All,
>
> I have several Xen virtual machines within logical volumes using LVM2. I
> did not use disk images for performance reasons.
>
> Conventionally, if I want to clone my virtual machines, I have to dd the LV
> to an image file. But this consumes a lot of time and harddisk space.
>
> So, instead of doing that, I want to use losetup and kpartx with my logical
> volumes, which contain operating systems of virtual machines.
>
> I can backup the filesystems of a virtual machine in this way:
>
> # losetup /dev/loop1 /dev/virtualmachines/windows7-x64
>
Are you sure you need to call losetup first ?

I remember I used kpartx directly on the lvm containing my vbd.

Also, I think you can treat the lvm based vbd as a real disk.

So
dd if=/dev/virtualmachines/windows7-x64 of=mbr.w7-x64 bs=512 count=1

should backup your mbr.

Anyone correct me if I'm wrong please.

Geert

--
Kobalt W.I.T.
Web & Information Technology
Brusselsesteenweg 152
1850 Grimbergen

Tel  : +32 479 339 655
Email: info@xxxxxxxxxxxx


_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users




_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users