repairing a damaged grub with centos

10,309

You don't want to reinstall grub on the LVM. You need to install it on the volume (hard disk, RAID array...) that the motherboard firmware sees. Most commonly:

# grub-install /dev/sda

In some cases, something else other than /dev/sda will make more sense.

Share:
10,309

Related videos on Youtube

Ellouze Anis
Author by

Ellouze Anis

Updated on September 18, 2022

Comments

  • Ellouze Anis
    Ellouze Anis over 1 year

    I have a damaged grub in my centos system. to repairing this problem, I use rescue mode and then I execute this follwing comand :

    chroot /mnt/sysimage
    
    grub-install /dev/mapper/ddf1OSp3
    
    and then reboot ;
    

    when boot from hard disk, it's sshow error message "file not found"

    when I execute the same comand in grub.conf under grub CMD, it s work fine and the file existe !!

    how to proceed to resolve this problem

    information about system : linux kernel 2.6.

    repartition of disk:

    $ df
    
    /dev/mapper/ddf1OSp3    /
    
    /dev/mapper/ddf1OSp1    /boot
    
    /dev/sdd1               /data
    
    tmpfs                   /dev/shm
    
  • Ellouze Anis
    Ellouze Anis almost 10 years
    according to df command, the root of my system is located in this repartition "/dev/mapper/ddf1OSp3".
  • Warren Young
    Warren Young almost 10 years
    @EllouzeAnis: That doesn't matter. Grub is executed directly by the motherboard firmware (BIOS or EFI), which doesn't understand LVM. (/dev/mapper/* indicates that you're using LVM.) By putting Grub on the LVM, you've simply hidden it from the mobo FW. Besides, you don't install Grub on the root filesystem anyway. You generally install it on the first physical volume. The mobo FW runs Grub from there, and Grub then goes and finds your OS and boots that.