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

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


  • To: Sergey Vlasov <vsu@xxxxxxxxxxx>
  • From: "Mr. Teo En Ming (Zhang Enming)" <space.time.universe@xxxxxxxxx>
  • Date: Fri, 13 Nov 2009 11:17:00 +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 19:17:59 -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=ty1jyBYpL5nkn4sHkoNlbT73oBI6CWIU8KK7UxJmU8pE0piYpfcq7h08A2gzOF6Xga baopKKkoAQ6tBd5Ppbpc1TfpDF2sizmT4yqq9W2YJF2ad1nNAUNNx4wCJvpn/QfY8Pc3 tVIsdmL5PLLUPYZVDY4phydhhhk3KZg9uR78o=
  • List-id: Xen user discussion <xen-users.lists.xensource.com>



On Fri, Nov 13, 2009 at 5:40 AM, Sergey Vlasov <vsu@xxxxxxxxxxx> wrote:
On Fri, Nov 13, 2009 at 12:57:22AM +0800, Mr. Teo En Ming (Zhang Enming) wrote:
[...]
> # VM 11: Rocks 5.1 x86_64 HPC Compute Cluster HVM domU
>
> kpartx -av /dev/virtualmachines/rocks0001
>
> dd if=/dev/virtualmachines/rocks0001 of=$DEST/rocks0001.mbr bs=512 count=1
>
> partimage -d -M -b -z1 save /dev/mapper/virtualmachines-rocks0001p1
> $DEST/virtualmachines-rocks0001p1.img
>
> partimage -d -M -b -z1 save /dev/mapper/virtualmachines-rocks0001p2
> $DEST/virtualmachines-rocks0001p2.img
>
> partimage -d -M -b -z1 save /dev/mapper/virtualmachines-rocks0001p5
> $DEST/virtualmachines-rocks0001p5.img

Note that this VM (and some other VMs listed in your script) uses
logical partitions.  In this case just saving a copy of MBR will not
be enough to save partition layout - MBR describes only 4 primary
partitions, and restoring just MBR will not restore extended
partitions.

One way to backup the complete partition layout is by saving also
the output of "sfdisk -d $device"; the resulting file can be used as
input to sfdisk to restore all partitions, including logical ones.
Saving MBR is still needed together with sfdisk, because it saves
the boot code (used for HVM) and CHS geometry information (which can
be used during boot in some cases).

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)

iEYEARECAAYFAkr8gM8ACgkQW82GfkQfsqLa+QCaAqpO5NWhYHtKVi3M5ytERw27
eC0AnjsJuG34MAR1jZRejBiJCVybQvc1
=RRGH
-----END PGP SIGNATURE-----

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



Thank you for pointing this out. Otherwise I would made incomplete backups.

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?

Besides sfdisk, there are also other partitioning tools like fdisk, cfdisk, and parted.

Could these other tools also be used for backing up the partition geometry like sfdisk?

Thank you.

--
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®.