From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1RDi7U-0002R7-6A for garchives@archives.gentoo.org; Tue, 11 Oct 2011 19:36:08 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3AEF921C0C7; Tue, 11 Oct 2011 19:36:00 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id F17F221C0C7 for ; Tue, 11 Oct 2011 19:35:59 +0000 (UTC) Received: from pelican.gentoo.org (unknown [66.219.59.40]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 0A24D1B400E for ; Tue, 11 Oct 2011 19:35:59 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by pelican.gentoo.org (Postfix) with ESMTP id 658EB80042 for ; Tue, 11 Oct 2011 19:35:58 +0000 (UTC) From: "Matěj Laitl" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Matěj Laitl" Message-ID: <7774e7be933cc6498528d492a343083e1c4a14e1.matej@gentoo> Subject: [gentoo-commits] dev/scarabeus:master commit in: docs/ X-VCS-Repository: dev/scarabeus X-VCS-Files: docs/grub-2-guide.xml X-VCS-Directories: docs/ X-VCS-Committer: matej X-VCS-Committer-Name: Matěj Laitl X-VCS-Revision: 7774e7be933cc6498528d492a343083e1c4a14e1 Date: Tue, 11 Oct 2011 19:35:58 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: X-Archives-Hash: a80f61396ebad458263c270bb5a566fc commit: 7774e7be933cc6498528d492a343083e1c4a14e1 Author: Mat=C4=9Bj Laitl laitl cz> AuthorDate: Tue Oct 11 18:55:35 2011 +0000 Commit: Mat=C4=9Bj Laitl laitl cz> CommitDate: Tue Oct 11 18:55:35 2011 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Ddev/scarabeus.git;= a=3Dcommit;h=3D7774e7be GRUB 2 Guide: add section about backing up a bootloader --- docs/grub-2-guide.xml | 61 +++++++++++++++++++++++++++++++++++++++++++= +++++- 1 files changed, 60 insertions(+), 1 deletions(-) diff --git a/docs/grub-2-guide.xml b/docs/grub-2-guide.xml index 8b587d6..02fac52 100644 --- a/docs/grub-2-guide.xml +++ b/docs/grub-2-guide.xml @@ -27,7 +27,7 @@ This guide shows you how to install and configure the G= RUB 2 bootloader. =20 1 -2011-10-10 +2011-10-11 =20 About @@ -56,6 +56,65 @@ Some examples of new features: =20 Installation + +
+Optional: Creating Backup of Existing GRUB Legacy Installation</t= itle> +<body> + +<p> +Playing with bootloader always brings the danger of leaving your system = in +unbootable state. Fortunately no data is lost in most cases and recovery= is not +hard, but we recommend you to have a bootable CD, DVD or a USB flash dis= k with +Linux around (<uri link=3D"http://www.gentoo.org/main/en/where.xml">Gent= oo +LiveDVD</uri> or <uri link=3D"http://www.sysresccd.org/">System Rescue C= D</uri> +will do) and to backup your current bootloader setup. If your current +bootloader is GRUB legacy, following code sample may help you backing it= up. +</p> + +<pre caption=3D"Backing up GRUB"> +# <comment># copy grub modules and configuration</comment> +# <i>cp -a /boot/grub <keyword>/path/to/backup</keyword>/</i> +# <comment># backup the MBR and GRUB stage 1.5</comment> +# <i>dd if=3D<keyword>/dev/sda</keyword> of=3D<keyword>/path/to/backup</= keyword>/first-sectors count=3D63</i> +</pre> + +<note> +Replace <c>/dev/sda</c> with device node of the disk you boot from (this= is +usually and the whole disk like <e>sda</e>, not a partition like sda1) a= nd +<c>/path/to/backup</c> with path to your favourite backup medium. +</note> + +<p> +When something goes wrong, you can restore previous grub installation by +booting some Linux live media and issuing following commands. +</p> + +<pre caption=3D"Restoring GRUB from backup"> +# <comment># move old grub files out of the way</comment> +# <i>mv /boot/grub /boot/grub.nonfunctional</i> +# <comment># copy grub back to /boot</comment> +# <i>cp -a <keyword>/path/to/backup</keyword>/grub /boot/</i> +# <comment># replace MBR and next 62 sectors of sda with backed up copy = (DANGEROUS!)</comment> +# <i>dd if=3D<keyword>/path/to/backup</keyword>/first-sectors of=3D<keyw= ord>/dev/sda</keyword> count=3D63</i> +</pre> + +<note> +Replace <c>/dev/sda</c> with device node of the disk you boot from and +<c>/path/to/backup</c> with path to the place where you've stored your b= ackup. +</note> + +<warn> +Writing directly to disk sectors (even those that are outside of partiti= ons +in typical setup) is risky operation and will make your data <e>inaccess= ible</e> +if you changed your parititon layout between backup and restore. Other s= lower +and safer option would be chrooting into your Gentoo installation and +re-installing bootloader - you can use <uri link=3D"/doc/en/handbook/">G= entoo +Handbook</uri> for that task. +</warn> + +</body> +</section> + <section> <title>Setting Useflags