diff options
-rw-r--r-- | 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 GRUB 2 bootloader. <license/> <version>1</version> -<date>2011-10-10</date> +<date>2011-10-11</date> <chapter> <title>About</title> @@ -56,6 +56,65 @@ Some examples of new features: <chapter> <title>Installation</title> + +<section> +<title>Optional: Creating Backup of Existing GRUB Legacy Installation</title> +<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 disk with +Linux around (<uri link="http://www.gentoo.org/main/en/where.xml">Gentoo +LiveDVD</uri> or <uri link="http://www.sysresccd.org/">System Rescue CD</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="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=<keyword>/dev/sda</keyword> of=<keyword>/path/to/backup</keyword>/first-sectors count=63</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) and +<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="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=<keyword>/path/to/backup</keyword>/first-sectors of=<keyword>/dev/sda</keyword> count=63</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 backup. +</note> + +<warn> +Writing directly to disk sectors (even those that are outside of partitions +in typical setup) is risky operation and will make your data <e>inaccessible</e> +if you changed your parititon layout between backup and restore. Other slower +and safer option would be chrooting into your Gentoo installation and +re-installing bootloader - you can use <uri link="/doc/en/handbook/">Gentoo +Handbook</uri> for that task. +</warn> + +</body> +</section> + <section> <title>Setting Useflags</title> <body> |