0

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
1

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.

  • according to df command, the root of my system is located in this repartition "/dev/mapper/ddf1OSp3". – Ellouze Anis Jun 4 '14 at 8:08
  • @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. – Warren Young Jun 4 '14 at 8:27
0

maybe this tutorial can help you?

Dual Boot Installation with Grub

Installation of Grub2 and dual boot with windows 10

If your Grub configuration is not as you like follow this tutorial. First reinstall Grub.

sudo yum reinstall grub2-tools

Login as root in a terminal

su

In another terminal , get information about your Windows 10 hard drive, in my case it was named '/dev/sdb1'

sudo fdisk -l

In my configuration, my windows 10 disk was on another hard drive. Follow only if you are in the same situation.

In the root terminal, navigate to the grub configuration directory

 cd  /etc/grub.d/

Now we must find the UUID of your Windows 10 hard drive, enter this command in your non-root terminal

ls -l /dev/disk/by-uuid

Find the UUID code next to your disk something like: 40S863A9D8619F12

Now in the root terminal enter the command:

nano 40_custom

Inside this file enter your windows 10 configuration using GRUB standard. Use the UUID code previously found inside the configuration. In my case my config is:

menuentry 'Windows 10' {
        insmod ntfs
        insmod ntldr
        insmod part_msdos
        insmod search_fs_uuid
        search --fs-uuid --no-floppy --set=root 40S863A9D8619F12
        ntldr /bootmgr
}

Save and exit nano. Now we need to generate a new GRUB configuration file. Enter the command:

grub2-mkconfig --output=/boot/grub2/grub.cfg

Voilà !!!! Try the configuration with a fresh restart

Source: http://dareneiri.github.io/Configuring-Grub-2-on-CentOS-7/ https://ihaveabackup.net/article/grub2-entry-for-windows-10-uefi

(Optional) Install GRUB customizer

If you want to have a sexy GRUB menu you can install grub-customizer using this tutorial: https://centos.pkgs.org/7/epel-x86_64/grub-customizer-5.0.6-1.el7.x86_64.rpm.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.