LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Reinstalling grub (https://www.linuxquestions.org/questions/linux-newbie-8/reinstalling-grub-418817/)

republicson 02-23-2006 01:50 PM

Reinstalling grub
 
I need to reinstall grub on my system. How do I do this? I am using Mandriva linux 2006 on KDE. My /boot/grub folder only contains "mdv-grub_splash.xpm.gz" and "menu.lst.example". Here is a link to the larger problem at hand, though reinstalling grub is the current issue.

reddazz 02-23-2006 02:07 PM

The best thing to do is to reinstall the kernel. If you reinstall the kernel, then all supporting files will be installed. You could also try to configure the bootloader from the Mandriva control center and see if that generates the right files.

republicson 02-23-2006 02:47 PM

How do I reinstall the kernel?

reddazz 02-23-2006 03:29 PM

Quote:

Originally Posted by republicson
How do I reinstall the kernel?

Check which version you are using by doing "uname -a" in a terminal. Download the kernel from a Mandriva mirror and reinstall it using "rpm -Uvh --nodeps" as root.

republicson 02-23-2006 06:48 PM

Running "uname -a" results in:

Code:

Linux localhost 2.6.12-12mdksmp #1 SMP Fri Sep 9 17:43:23 CEST 2005 i686 Intel(R) Pentium(R) 4 CPU 2.80GHz unknown GNU/Linux
Then, I went into the Mandriva Linux Control Center/Software Packages Installation and installed "kernel-i586-up-1GB-2.6.12.12mdk-1-1mdk". Then i checked the contents of /boot/grub which remained the same.

After looking under installed packages in the Control Center, I now see the package I installed and "kernel-smp-2.6.12.12mdk-1-1mdk". Did I install the wrong one. Should I uninstall both and reinstall the original one? Should everything be fixed?

Here's a screenshot of Control Center.

republicson 02-23-2006 06:56 PM

In addition

Code:

[root@localhost ~]# rpm -Uvh --nodeps
rpm: no packages given for install


Electro 02-23-2006 07:48 PM

As root, type grub-install. It will install the files for you if they are not there and place GRUB in the master boot record.

republicson 02-23-2006 08:15 PM

Tried it Electro. Here's the results:

Code:

[root@localhost michael]# grub-install
install_device not specified.
Usage: grub-install [OPTION] install_device
Install GRUB on your drive.

  -h, --help              print this message and exit
  -v, --version          print the version information and exit
  --root-directory=DIR    install GRUB images under the directory DIR
                          instead of the root directory
  --grub-shell=FILE      use FILE as the grub shell
  --no-floppy            do not probe any floppy drive
  --force-lba            force GRUB to use LBA mode even for a buggy
                          BIOS
  --recheck              probe a device map even if it already exists

INSTALL_DEVICE can be a GRUB device name or a system device filename.

grub-install copies GRUB images into the DIR/boot directory specfied by
--root-directory, and uses the grub shell to install grub into the boot
sector.

Report bugs to <bug-grub@gnu.org>.

Apparently I need to point grub-install to something, but I don't know what.

pixellany 02-23-2006 09:08 PM

Well, your printout tells the story. You need to tell grub-install WHERE to install. check grub manual (or maybe man grub-install)

republicson 02-23-2006 10:22 PM

I don't know where to install. I tried this:

Code:

[root@localhost michael]# grub-install /boot/grub
Format of install_device not recognized.
Usage: grub-install [OPTION] install_device
Install GRUB on your drive.

  -h, --help              print this message and exit
  -v, --version          print the version information and exit
  --root-directory=DIR    install GRUB images under the directory DIR
                          instead of the root directory
  --grub-shell=FILE      use FILE as the grub shell
  --no-floppy            do not probe any floppy drive
  --force-lba            force GRUB to use LBA mode even for a buggy
                          BIOS
  --recheck              probe a device map even if it already exists

INSTALL_DEVICE can be a GRUB device name or a system device filename.

grub-install copies GRUB images into the DIR/boot directory specfied by
--root-directory, and uses the grub shell to install grub into the boot
sector.

Report bugs to <bug-grub@gnu.org>.

I also tried this, but didn't follow it too well.

Code:

GRUB-INSTALL(8)                      FSF                      GRUB-INSTALL(8)

NAME
      grub-install - install GRUB on your drive

SYNOPSIS
      grub-install [OPTION] install_device

DESCRIPTION
      Install GRUB on your drive.

      -h, --help
              print this message and exit

      -v, --version
              print the version information and exit

      --root-directory=DIR
              install  GRUB images under the directory DIR instead of the root
              directory

      --grub-shell=FILE
              use FILE as the grub shell

      --no-floppy
              do not probe any floppy drive

      --force-lba
              force GRUB to use LBA mode even for a buggy BIOS

      --recheck
              probe a device map even if it already exists

      INSTALL_DEVICE can be a GRUB device name or a system device filename.

      grub-install copies GRUB images into the DIR/boot directory specfied by
      --root-directory, and uses the grub shell to install grub into the boot
      sector.

REPORTING BUGS
      Report bugs to <bug-grub@gnu.org>.

SEE ALSO
      The full documentation for grub-install is maintained as a Texinfo man-
      ual.  If  the info and grub-install programs are properly installed at
      your site, the command

      --no-floppy
              do not probe any floppy drive

      --force-lba
              force GRUB to use LBA mode even for a buggy BIOS

      --recheck
              probe a device map even if it already exists

      INSTALL_DEVICE can be a GRUB device name or a system device filename.

      grub-install copies GRUB images into the DIR/boot directory specfied by
      --root-directory, and uses the grub shell to install grub into the boot
      sector.

REPORTING BUGS
      Report bugs to <bug-grub@gnu.org>.

SEE ALSO
      The full documentation for grub-install is maintained as a Texinfo man-
      ual.  If  the info and grub-install programs are properly installed at
      your site, the command

      --no-floppy
              do not probe any floppy drive

      --force-lba
              force GRUB to use LBA mode even for a buggy BIOS

      --recheck
              probe a device map even if it already exists

      INSTALL_DEVICE can be a GRUB device name or a system device filename.

      grub-install copies GRUB images into the DIR/boot directory specfied by
      --root-directory, and uses the grub shell to install grub into the boot
      sector.

REPORTING BUGS
      Report bugs to <bug-grub@gnu.org>.

SEE ALSO
      The full documentation for grub-install is maintained as a Texinfo man-
      ual.  If  the info and grub-install programs are properly installed at
      your site, the command

              info grub-install

      should give you access to the complete manual.

grub-install (GNU GRUB 0.97)      May 2005                    GRUB-INSTALL(8)

As a result I tried this:

Code:

[root@localhost michael]# info grub-install
bash: info: command not found


nguyennh 02-23-2006 10:46 PM

Assume you want grub located at your Master Boot Record on /dev/hda , type this :
grub-install /dev/hda
Hope it helps you .

nguyennh 02-23-2006 10:48 PM

[root@localhost michael]# info grub-install
bash: info: command not found

=> You not installed info yet .

republicson 02-23-2006 11:05 PM

I tried it on various parts of my drive with the same error:

Code:

[root@localhost michael]# grub-install /dev/sda
The file /boot/grub/stage1 not read correctly.
[root@localhost michael]# grub-install /dev/sda5
The file /boot/grub/stage1 not read correctly.
[root@localhost michael]# grub-install /dev/hda
/dev/hda: Not found or not a block device.
[root@localhost michael]# grub-install /dev/sda6
The file /boot/grub/stage1 not read correctly.
[root@localhost michael]# grub-install /dev/hda6
/dev/hda6: Not found or not a block device.
[root@localhost michael]# grub-install /dev/sda3
/dev/sda3: Not found or not a block device.
[root@localhost michael]# grub-install /dev/sda1
The file /boot/grub/stage1 not read correctly.
[root@localhost michael]# grub-install /dev/sda
The file /boot/grub/stage1 not read correctly.
[root@localhost michael]# grub-install /dev/sda5
The file /boot/grub/stage1 not read correctly.


reddazz 02-24-2006 01:47 AM

Quote:

Originally Posted by republicson
In addition

Code:

[root@localhost ~]# rpm -Uvh --nodeps
rpm: no packages given for install


You did not stipulate which package to install. The right way is
Code:

# rpm -Uvh --nodeps kernel-version.rpm
kernel-version.rpm would be the version of the kernel you have downloaded and are going to install.

Anyway it seems like grub is not installed properly. I would uninstall it using rpmdrake and then reinstall it. After that reinstall your kernel so that it generates the right /boot/grub/menu.lst and other supporting files.

saran_talks 02-24-2006 08:09 AM

regarding Grub install
 
hai..isawyour message ..

this is steps wefollow...
1. Boot your system using first CD in boot prompt type "linux rescue"
2. after getting one popup window just type "chroot /mnt/sysimage"
3. and lastly you get prompt..and then type "grub-install/dev/hda"(before that yousure about hard diskis connected to mastrer or slave)
4. and them reboot your system

with regards
Saran


All times are GMT -5. The time now is 09:29 PM.