Difference between revisions of "Grub"

From Linuxintro
imported>ThorstenStaerk
imported>ThorstenStaerk
Line 1: Line 1:
 
= reinstall grub =
 
= reinstall grub =
 
  grub-install --recheck --no-floppy --root-directory=/path/to/root /dev/hda
 
  grub-install --recheck --no-floppy --root-directory=/path/to/root /dev/hda
 +
 +
= 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
  
 
= determine entry to be booted next time =
 
= determine entry to be booted next time =

Revision as of 06:12, 1 December 2010

reinstall grub

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

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

determine entry to be booted next time

grub-reboot entry-number

grub's command line

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

backup partition table

To backup your partition table:

sfdisk -d /dev/hda > hda.pt

To restore it:

sfdisk /dev/hda < hda.pt

See also