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 20:50:01 +0800
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 04:51:00 -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=pmQykjKJw40upMTAYHiLGhQmpu0PTrscVQaY6lFoTzI=; b=MF92x0OTwMwqjiJTEG0m7288tM/AlPJM4tMx7/EvAiSofzkVIUtoYRacYpM4jWwqQk rFTLUxaQYmyZb+ebjJqMrOkRlkqY9uDgwQO/dtMAPFmijFLLYBqhT3bbznAgxIiRQI0j nBb5+RMW4rkDekMHjwLcd5m0OmYQCvqOKz5BU=
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=RLf50bsANGaTVkC1fp3FZ6BDrrJyKD4Pzc4iii03xw56WqIucldrssrYJQKT3lkwhi dPwdMK6B/WHZCKbiqVvHmm89YK53oRb9axiVuttwwSx4ap6ZdI5hXM79PiE6E8cweQVu rCeAnTxFJ8YIlrkiDWsIWhDRxNFUmIOvoNJ5s=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <200911121118.35229.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> <f712b9cf0911120145y5b234074xc33aea518df862e2@xxxxxxxxxxxxxx> <200911121118.35229.info@xxxxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx


On Thu, Nov 12, 2009 at 6:18 PM, Geert Janssens <info@xxxxxxxxxxxx> wrote:
On Thursday 12 November 2009, you wrote:
> > 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.

I did some tests just to be sure. As far as I can tell, dd interacts with lvm
in exactly the same way as with a physical disk or a loop device.

In the test I copied the first sector directly from the lvm partition or via
the loop device. It results in exactly the same sector being copied.

Also, if you try fdisk -l on the lvm disk or the loop device, it results in
the same output.

Below is the output from my tests:

[root@aragorn:~]# losetup /dev/loop1 /dev/base/kobaltwit_f11_disk

[root@aragorn:~]# fdisk -l /dev/base/kobaltwit_f11_disk

Disk /dev/base/kobaltwit_f11_disk: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

                      Device Boot      Start         End      Blocks   Id
System
/dev/base/kobaltwit_f11_disk1   *           1        1305    10482381   83
Linux
[root@aragorn:~]# fdisk -l /dev/base/kobaltwit_f11_disk

Disk /dev/base/kobaltwit_f11_disk: 10.7 GB, 10737418240 bytes
255 heads, 63 sectors/track, 1305 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

                      Device Boot      Start         End      Blocks   Id
System
/dev/base/kobaltwit_f11_disk1   *           1        1305    10482381   83
Linux

[root@aragorn:~]# dd if=/dev/base/kobaltwit_f11_disk of=mbr.lvm bs=512 count=1
1+0 records in
1+0 records out
512 bytes (512 B) copied, 7.6e-05 seconds, 6.7 MB/s

[root@aragorn:~]# dd if=/dev/loop1 of=mbr.loop bs=512 count=1
1+0 records in
1+0 records out
512 bytes (512 B) copied, 0.000151 seconds, 3.4 MB/s

[root@aragorn:~]# diff mbr.l*
[root@aragorn:~]#

These test seem to indicate to me that the lvm layer in completely transparent
to userland tools such as fdisk or dd.

So I still think the losetup step is superfluous and possibly causing
unnecessary overhead.

Geert

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

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


Thank you!

I will omit the losetup step.

--
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
_______________________________________________
Xen-users mailing list
Xen-users@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-users
<Prev in Thread] Current Thread [Next in Thread>