Captured Moments » Eventually interesting stuff about Linux, Programming, Software, Photography.

Tags

  PHP     Programming     Windows     Nikon     Sony     Web     Live     Software     LMMag     Work     Linux     GPS     Ubuntu     F-Spot     Weather     Photography     Gimp     UFRaw     Usability     Hugin     Bibble     Plugin     Qt         Photoblog     C++     Panorama  

My Flickr Photos

Books on blurb.com

aus der ev. Kirche Sulzbach (Ts.)
Julia und Paul
Wellner Bou

Admin area

I am not sure why, while upgrading, installing and uninstalling some stuff my system broke, so that on booting, just after the boot line selection in the grub(2) menu, the error “command not found: initrd” (or similar) appeared.

You can fix the grub installation again using any kind of live CD. I used the Knoppix CD.

  • Boot the live CD
  • Mount your boot partition, for example to /mnt. In my case
    mount -t auto /dev/sda1 /mnt
  • Bind your /dev directory to the mounted partition:
    mount -o bind /dev/ /mnt/dev
  • Chroot into your boot partition
    chroot /mnt
  • Mount your proc directory
    mount -t proc proc /proc
  • Mount your sys file system (/sys)
    mount -t sysfs sysfs /sys
  • Ready, now you can use your system almost as if you booted in it. You can reinstall grub, kernel images, create initrd images, fix the menu.lst or grub.cfg or whatever you want.

And, by the way, if grub is giving you something like

error: the symbol grub_machine_fini was not found
on booting, it is installed to the wrong hard disk (or not installed). Install it to the master boot record of the hard disk (not to the partition!) In my case:
grub-install /dev/sda
(and not sda1)

  1. Pedro

    Thanks!

  2. Anon

    Thanks! Please note that you should use live CD with the same architecture as system you want to repair or chroot won’t work.