Linux 15.070 Themen, 107.540 Beiträge

Grub-Sicherung

TimmintoR 2°°4 / 5 Antworten / Baumansicht Nickles

Hi,
ich hab vor mir mal noch Vista auf den Laptop zu hauen und möchte vorher gerne meinen MBR mit Grub sichern. Wenn ich nun mit dd die ersten 512 Byte der ersten Festplatte sichere und nach der Vista Installation (danach wird der MBR wahrscheinlich überschrieben sein) wieder zurückspiele sollte doch alles wieder funktionieren?! Oder ist die Partitionstabelle dort auch schon enthalten?

Danke schon mal


Gruß

TimmintoR 2°°4

Linux.DOS.Windows - The Good.The Bad.The Ugly
bei Antwort benachrichtigen
KarstenW TimmintoR 2°°4 „Grub-Sicherung“
Optionen

Klar, in den ersten 512 Byte ist nicht nur das Bootprogramm sondern auch die Partitionstabelle enthalten. Die Partitionstabelle wird sich nach der Installation von deinem neuen Windows ändern.
Deshalb kannst du nicht das grub Backup nach der Installation von Vista zurückschreiben.
Den grub kannst du einfach mit Hilfe von Knoppix Live CD neu installieren:

3.2 Installing GRUB natively
Caution: Installing GRUB's stage1 in this manner will erase the normal boot-sector used by an OS.
GRUB can currently boot GNU Mach, Linux, FreeBSD, NetBSD, and OpenBSD directly, so using it on a boot sector (the first sector of a partition) should be okay. But generally, it would be a good idea to back up the first sector of the partition on which you are installing GRUB's stage1. This isn't as important if you are installing GRUB on the first sector of a hard disk, since it's easy to reinitialize it (e.g. by running `FDISK /MBR' from DOS).
If you decide to install GRUB in the native environment, which is definitely desirable, you'll need to create a GRUB boot disk, and reboot your computer with it. Otherwise, see Installing GRUB using grub-install.
Once started, GRUB will show the command-line interface (see Command-line interface). First, set the GRUB's root device4 to the partition containing the boot directory, like this:
grub> root (hd0,0)

Mit diesem Befehl gibst du die root-Partition an, wenn du keine eigene /boot-Partition hast. (hd0,0) ist /dev/hda1

If you are not sure which partition actually holds this directory, use the command find (see find), like this:
grub> find /boot/grub/stage1

Wenn du die root-Partition (/boot-Partition) nicht kennst, dann kann du mit "find /boot/grub/stage1" dir die genaue grub Bezeichnung deiner root-Partition ausgeben lassen, um sie dann bei root() anzugeben.

This will search for the file name /boot/grub/stage1 and show the devices which contain the file.
Once you've set the root device correctly, run the command setup (see setup):
grub> setup (hd0)

Mit "setup (hd0)" wird der grub in den MBR installiert, aber erst die root-Partition (/boot-Partition) angeben.

This command will install the GRUB boot loader on the Master Boot Record (MBR) of the first drive. If you want to put GRUB into the boot sector of a partition instead of putting it in the MBR, specify the partition into which you want to install GRUB:
grub> setup (hd0,0)

If you install GRUB into a partition or a drive other than the first one, you must chain-load GRUB from another boot loader. Refer to the manual for the boot loader to know how to chain-load GRUB.
After using the setup command, you will boot into GRUB without the GRUB floppy. See the chapter Booting to find out how to boot your operating systems from GRUB.

Im Prinzip brauchst du nur diese drei Befehle eingeben, nachdem du die grub shell mit "grub" als root gestartet hast.

Zum Nachlesen:

http://www.gnu.org/software/grub/manual/grub.html

PS: Findet du nicht auch das die Sprache Deutsch etwas exzentrisch ist mit dem Großschreiben der Substative ;-).
Das wäre mal eine echte Rechtschreibreform gewesen.

Debian GNU/Linux https://www.debian.org/index.de.html
bei Antwort benachrichtigen
higgl TimmintoR 2°°4 „Grub-Sicherung“
Optionen

Alternativ könntest du Vista den MBR ruhig überschreiben lassen (wie erwartet macht es das nämlich tatsächlich), später von einer LiveCD booten und Grub einfach neu in den MBR schreiben.
(etwa so)

Never argue with an idiot. They drag you down to their level and then beat you with experience.
bei Antwort benachrichtigen
TimmintoR 2°°4 higgl „Alternativ könntest du Vista den MBR ruhig überschreiben lassen wie erwartet...“
Optionen

Vielen Dank euch beiden für die schnelle Antwort. Ich werde es gleich morgen ausprobieren :)



Gruß

TimmintoR 2°°4

Linux.DOS.Windows - The Good.The Bad.The Ugly
bei Antwort benachrichtigen
TimmintoR 2°°4 Nachtrag zu: „Vielen Dank euch beiden für die schnelle Antwort. Ich werde es gleich morgen...“
Optionen

Ach ja, gibt es eine Grub Boot Disk auch als CD-Image zum Download?



Gruß

TimmintoR 2°°4

Linux.DOS.Windows - The Good.The Bad.The Ugly
bei Antwort benachrichtigen
TimmintoR 2°°4 Nachtrag zu: „Ach ja, gibt es eine Grub Boot Disk auch als CD-Image zum Download? Gruß...“
Optionen

Sorry für die dumme Frage, direkt unter dem Artikel von Karsten ist eine Methode beschrieben, wie man eine solche CD selbst erstellen kann....



Gruß

TimmintoR 2°°4

Linux.DOS.Windows - The Good.The Bad.The Ugly
bei Antwort benachrichtigen