<br><br><div class="gmail_quote">On Fri, Nov 13, 2009 at 5:40 AM, Sergey Vlasov <span dir="ltr"><<a href="mailto:vsu@altlinux.ru">vsu@altlinux.ru</a>></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;">
On Fri, Nov 13, 2009 at 12:57:22AM +0800, Mr. Teo En Ming (Zhang Enming) wrote:<br>
[...]<br>
<div class="im">> # VM 11: Rocks 5.1 x86_64 HPC Compute Cluster HVM domU<br>
><br>
> kpartx -av /dev/virtualmachines/rocks0001<br>
><br>
> dd if=/dev/virtualmachines/rocks0001 of=$DEST/rocks0001.mbr bs=512 count=1<br>
><br>
> partimage -d -M -b -z1 save /dev/mapper/virtualmachines-rocks0001p1<br>
> $DEST/virtualmachines-rocks0001p1.img<br>
><br>
> partimage -d -M -b -z1 save /dev/mapper/virtualmachines-rocks0001p2<br>
> $DEST/virtualmachines-rocks0001p2.img<br>
><br>
> partimage -d -M -b -z1 save /dev/mapper/virtualmachines-rocks0001p5<br>
> $DEST/virtualmachines-rocks0001p5.img<br>
<br>
</div>Note that this VM (and some other VMs listed in your script) uses<br>
logical partitions.  In this case just saving a copy of MBR will not<br>
be enough to save partition layout - MBR describes only 4 primary<br>
partitions, and restoring just MBR will not restore extended<br>
partitions.<br>
<br>
One way to backup the complete partition layout is by saving also<br>
the output of "sfdisk -d $device"; the resulting file can be used as<br>
input to sfdisk to restore all partitions, including logical ones.<br>
Saving MBR is still needed together with sfdisk, because it saves<br>
the boot code (used for HVM) and CHS geometry information (which can<br>
be used during boot in some cases).<br>
<br>-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v1.4.10 (GNU/Linux)<br>
<br>
iEYEARECAAYFAkr8gM8ACgkQW82GfkQfsqLa+QCaAqpO5NWhYHtKVi3M5ytERw27<br>
eC0AnjsJuG34MAR1jZRejBiJCVybQvc1<br>
=RRGH<br>
-----END PGP SIGNATURE-----<br>
<br>_______________________________________________<br>
Xen-users mailing list<br>
<a href="mailto:Xen-users@lists.xensource.com">Xen-users@lists.xensource.com</a><br>
<a href="http://lists.xensource.com/xen-users" target="_blank">http://lists.xensource.com/xen-users</a><br></blockquote></div><br><br><br>Thank you for pointing this out. Otherwise I would made incomplete backups.<br><br>
Would it be best practice to always backup both the MBR and the partition geometry using sfdisk whenever cloning our harddisks on desktops and servers?<br><br>Besides sfdisk, there are also other partitioning tools like fdisk, cfdisk, and parted.<br>
<br>Could these other tools also be used for backing up the partition geometry like sfdisk?<br><br>Thank you.<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>