Difference between revisions of "Grub"

From Linuxintro
imported>ThorstenStaerk
imported>ThorstenStaerk
Line 1: Line 1:
= reinstall grub =
+
GRUB is the '''gr'''ant 'u'nified 'b'ootloader, in use by most Linux distributions, e.g. Ubuntu and SUSE. You may probably want to print this page because if the bootloader is broken, there is no chance to get into the system for repair instructions, you will need to have a printout.
  grub-install --recheck --no-floppy --root-directory=/path/to/root /dev/hda
+
 
 +
= grub's command line =
 +
  grub> kernel /boot/vmlinuz
 +
grub> initrd /boot/initrd
 +
grub> boot
  
 
= repair grub =
 
= repair grub =
Line 9: Line 13:
 
  $ chroot /media/hda3
 
  $ chroot /media/hda3
 
  $ grub-install /dev/hda
 
  $ grub-install /dev/hda
 +
 +
= reinstall grub =
 +
grub-install --recheck --no-floppy --root-directory=/path/to/root /dev/hda
  
 
= determine entry to be booted next time =
 
= determine entry to be booted next time =
 
  grub-reboot ''entry-number''
 
  grub-reboot ''entry-number''
 
= grub's command line =
 
grub> kernel /boot/vmlinuz
 
grub> initrd /boot/initrd
 
grub> boot
 
  
 
= backup partition table =
 
= backup partition table =

Revision as of 19:40, 29 December 2011

GRUB is the grant 'u'nified 'b'ootloader, in use by most Linux distributions, e.g. Ubuntu and SUSE. You may probably want to print this page because if the bootloader is broken, there is no chance to get into the system for repair instructions, you will need to have a printout.

grub's command line

grub> kernel /boot/vmlinuz
grub> initrd /boot/initrd
grub> boot

repair grub

Boot from Knoppix,

$ mount /dev/hda3 /media/hda3
$ mount --bind /dev /media/hda3/dev
$ mount --bind /proc /media/hda3/proc
$ chroot /media/hda3
$ grub-install /dev/hda

reinstall grub

grub-install --recheck --no-floppy --root-directory=/path/to/root /dev/hda

determine entry to be booted next time

grub-reboot entry-number

backup partition table

To backup your partition table:

sfdisk -d /dev/hda > hda.pt

To restore it:

sfdisk /dev/hda < hda.pt

See also