[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • To: Geert Janssens <info@xxxxxxxxxxxx>
  • 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
  • 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=
  • List-id: Xen user discussion <xen-users.lists.xensource.com>



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

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.