diff options
author | Matěj Laitl <matej@laitl.cz> | 2011-10-11 20:55:35 +0200 |
---|---|---|
committer | Matěj Laitl <matej@laitl.cz> | 2011-10-11 20:55:35 +0200 |
commit | 7774e7be933cc6498528d492a343083e1c4a14e1 (patch) | |
tree | 730dff78aa3cd8b8a15fd9fa38d63975e77eb8e5 | |
parent | Update guide. Patch from Moritz Schlarb. (diff) | |
download | scarabeus-7774e7be933cc6498528d492a343083e1c4a14e1.tar.gz scarabeus-7774e7be933cc6498528d492a343083e1c4a14e1.tar.bz2 scarabeus-7774e7be933cc6498528d492a343083e1c4a14e1.zip |
GRUB 2 Guide: add section about backing up a bootloader
-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> |