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] Re: How to Backup and Restore MBR within Logical Volume

To: Sergey Vlasov <vsu@xxxxxxxxxxx>
Subject: Re: [Xen-users] Re: How to Backup and Restore MBR within Logical Volumes?
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
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=en+bwjuNFdJxBa7bE4pEsmUafEJdQ1Jel6z3I8afoOg=; b=E9Rqr89yAgGSwX9qlgBFIWjaD233dvxxmgaTQgUkyrwoZRRHfrNYK/ko1QfDYKkBS7 dXWGOQDuLPVn1rLJHd4E2B3mz5EGM1tMMborwk857/tHxmKR88M0s03T0iou1TPwa5me L/N7jk6GJ//nyruQN1PwT3QhFggoMm7oTY+4k=
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=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20091112214031.GA8607@xxxxxxxxxx>
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> <4AFBD787.1090309@xxxxxxxxxxxxxxxx> <f712b9cf0911120152v4db222ddn94cf3ab449caa29a@xxxxxxxxxxxxxx> <7207d96f0911120202h41e8d6b6q3d322e2572d9ab5e@xxxxxxxxxxxxxx> <f712b9cf0911120210h652e5c3fja02e5a6e94742068@xxxxxxxxxxxxxx> <7207d96f0911120237k506c4a30nfe38703eb507f49f@xxxxxxxxxxxxxx> <f712b9cf0911120453g237599b5tebe0f2e1417bb51d@xxxxxxxxxxxxxx> <f712b9cf0911120857v38ec5c06tf1ee2867eb22297@xxxxxxxxxxxxxx> <20091112214031.GA8607@xxxxxxxxxx>
Sender: xen-users-bounces@xxxxxxxxxxxxxxxxxxx


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
<Prev in Thread] Current Thread [Next in Thread>