<br><br><div class="gmail_quote">On Thu, Nov 12, 2009 at 6:18 PM, Geert Janssens <span dir="ltr">&lt;<a href="mailto:info@kobaltwit.be">info@kobaltwit.be</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div class="im">On Thursday 12 November 2009, you wrote:<br>
&gt; &gt; dd if=/dev/virtualmachines/windows7-x64 of=mbr.w7-x64 bs=512 count=1<br>
&gt;<br>
&gt; I think if you do this, you are only backing up the first 512 bytes of the<br>
&gt; logical volume, not the MBR.<br>
&gt;<br>
&gt; Someone correct me if I am wrong.<br>
<br>
</div>I did some tests just to be sure. As far as I can tell, dd interacts with lvm<br>
in exactly the same way as with a physical disk or a loop device.<br>
<br>
In the test I copied the first sector directly from the lvm partition or via<br>
the loop device. It results in exactly the same sector being copied.<br>
<br>
Also, if you try fdisk -l on the lvm disk or the loop device, it results in<br>
the same output.<br>
<br>
Below is the output from my tests:<br>
<br>
[root@aragorn:~]# losetup /dev/loop1 /dev/base/kobaltwit_f11_disk<br>
<br>
[root@aragorn:~]# fdisk -l /dev/base/kobaltwit_f11_disk<br>
<br>
Disk /dev/base/kobaltwit_f11_disk: 10.7 GB, 10737418240 bytes<br>
255 heads, 63 sectors/track, 1305 cylinders<br>
<div class="im">Units = cylinders of 16065 * 512 = 8225280 bytes<br>
<br>
</div><div class="im">                       Device Boot      Start         End      Blocks   Id<br>
System<br>
</div>/dev/base/kobaltwit_f11_disk1   *           1        1305    10482381   83<br>
Linux<br>
[root@aragorn:~]# fdisk -l /dev/base/kobaltwit_f11_disk<br>
<br>
Disk /dev/base/kobaltwit_f11_disk: 10.7 GB, 10737418240 bytes<br>
255 heads, 63 sectors/track, 1305 cylinders<br>
<div class="im">Units = cylinders of 16065 * 512 = 8225280 bytes<br>
<br>
</div><div class="im">                       Device Boot      Start         End      Blocks   Id<br>
System<br>
</div>/dev/base/kobaltwit_f11_disk1   *           1        1305    10482381   83<br>
Linux<br>
<br>
[root@aragorn:~]# dd if=/dev/base/kobaltwit_f11_disk of=mbr.lvm bs=512 count=1<br>
1+0 records in<br>
1+0 records out<br>
512 bytes (512 B) copied, 7.6e-05 seconds, 6.7 MB/s<br>
<br>
[root@aragorn:~]# dd if=/dev/loop1 of=mbr.loop bs=512 count=1<br>
1+0 records in<br>
1+0 records out<br>
512 bytes (512 B) copied, 0.000151 seconds, 3.4 MB/s<br>
<br>
[root@aragorn:~]# diff mbr.l*<br>
[root@aragorn:~]#<br>
<br>
These test seem to indicate to me that the lvm layer in completely transparent<br>
to userland tools such as fdisk or dd.<br>
<br>
So I still think the losetup step is superfluous and possibly causing<br>
unnecessary overhead.<br>
<div><div></div><div class="h5"><br>
Geert<br>
<br>
--<br>
Kobalt W.I.T.<br>
Web &amp; Information Technology<br>
Brusselsesteenweg 152<br>
1850 Grimbergen<br>
<br>
Tel  : +32 479 339 655<br>
Email: <a href="mailto:info@kobaltwit.be">info@kobaltwit.be</a><br>
<br>
</div></div></blockquote></div><br>Thank you!<br><br>I will omit the losetup step.<br clear="all"><br>-- <br>Mr. Teo En Ming (Zhang Enming) Dip(Mechatronics) BEng(Hons)(Mechanical Engineering)<br>Alma Maters:<br>(1) Singapore Polytechnic<br>
(2) National University of Singapore<br>My Primary Blog: <a href="http://teo-en-ming-aka-zhang-enming.blogspot.com">http://teo-en-ming-aka-zhang-enming.blogspot.com</a><br>My Secondary Blog: <a href="http://enmingteo.wordpress.com">http://enmingteo.wordpress.com</a><br>
My Youtube videos: <a href="http://www.youtube.com/user/enmingteo">http://www.youtube.com/user/enmingteo</a><br>Email: <a href="mailto:space.time.universe@gmail.com">space.time.universe@gmail.com</a><br>Mobile Phone (Starhub Prepaid): +65-8369-2618<br>
Street: Bedok Reservoir Road<br>Country: Singapore<br>