LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (https://www.linuxquestions.org/questions/fedora-35/)
-   -   grub-install (https://www.linuxquestions.org/questions/fedora-35/grub-install-595044/)

ronty 10-27-2007 11:45 AM

grub-install
 
Hi I have just installed fedora 7 on sda and it installed the grub menu ok
I then Installed suse 10.3 on sdb it installed grub on sda.

I don't like suse so I want to reinstall grub for fedora 7.

grub-install --root-directory=/boot /dev/sda...sda0...hda...hda0 does not work. Has anybody got any ideas?

no other operating systems on either disks!

thanks

alunduil 10-27-2007 11:58 AM

Why not just add an entry into the grub configuration that is used to allow the other operating system?

Regards,

Alunduil

stoat 10-27-2007 01:12 PM

Hello ronty,

Since you don't like SUSE, you may very soon be removing it (and it's boot loader files). So, to reinstall GRUB in the master boot record using Fedora's stage1, boot with your F7 DVD into linux rescue. After chroot /mnt/sysimage at the sh prompt, try grub-install /dev/sda. If you get a "No corresponding drive in BIOS" error, try grub-install --recheck /dev/sda. That should cause your machine to boot into Fedora's GRUB menu to which you can even add SUSE until you decide once and for all to keep it or dump it.

ronty 10-27-2007 02:23 PM

Thanks when I try what you suggested it then says grub-install: command not found

stoat 10-27-2007 03:08 PM

Quote:

Originally Posted by ronty

Thanks when I try what you suggested it then says grub-install: command not found

If you...
  1. Boot from your Fedora 7 DVD
  2. Select "Rescue installed system"
  3. Answer prompts and follow directions
  4. Select your Fedora 7 partition (if offered a choice of multiple systems; otherwise disregard this)
  5. Enter chroot /mnt/sysimage at the sh-3.2# prompt
...then the command grub-install /dev/sda will work. I just tried it again for the nth time to reassure myself.

However, if you are issuing that command in a terminal in your running Fedora system, then you must become root for grub-install to work because it also rewrites files in the /boot/grub directory. If you become root in the terminal with su, then you must issue the command as /sbin/grub-install /dev/sda. If you become root in the terminal with su -, then simply grub-install /dev/sda will work.

It all has to do with the path you are using depending on how you are logged in with the terminal. See the different $PATH values for user, su, and su - on my machine...
Code:

[user@localhost ~]$ echo $PATH
/usr/kerberos/bin:/usr/lib/ccache:/usr/local/bin:/usr/bin:/bin:/home/user/bin

[user@localhost ~]$ su
Password:
[root@localhost user]# echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib/ccache:/usr/local/bin:/usr/bin:/bin:/home/user/bin

[user@localhost ~]$ su -
Password:
[root@localhost ~]# echo $PATH
/usr/kerberos/sbin:/usr/kerberos/bin:/usr/lib/ccache:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin

Sorry, I didn't invent this.

ronty 10-28-2007 03:00 AM

Thanks for the information given.
Problem solved. I installed Debian on sdb installed boot blocks on sda and this time Fedora re-installed boot blocks on sda exactly as you suggested. It must have been a conflict with Suse boot blocks.
Thanks


All times are GMT -5. The time now is 12:54 AM.