LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-23-2006, 01:50 PM   #1
republicson
Member
 
Registered: Feb 2006
Location: Springfield, MO
Distribution: Ubuntu Dapper 6.06
Posts: 35

Rep: Reputation: 15
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.
 
Old 02-23-2006, 02:07 PM   #2
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
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.
 
Old 02-23-2006, 02:47 PM   #3
republicson
Member
 
Registered: Feb 2006
Location: Springfield, MO
Distribution: Ubuntu Dapper 6.06
Posts: 35

Original Poster
Rep: Reputation: 15
How do I reinstall the kernel?
 
Old 02-23-2006, 03:29 PM   #4
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
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.
 
Old 02-23-2006, 06:48 PM   #5
republicson
Member
 
Registered: Feb 2006
Location: Springfield, MO
Distribution: Ubuntu Dapper 6.06
Posts: 35

Original Poster
Rep: Reputation: 15
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.
 
Old 02-23-2006, 06:56 PM   #6
republicson
Member
 
Registered: Feb 2006
Location: Springfield, MO
Distribution: Ubuntu Dapper 6.06
Posts: 35

Original Poster
Rep: Reputation: 15
In addition

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

Last edited by republicson; 02-23-2006 at 06:57 PM.
 
Old 02-23-2006, 07:48 PM   #7
Electro
LQ Guru
 
Registered: Jan 2002
Posts: 6,042

Rep: Reputation: Disabled
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.
 
Old 02-23-2006, 08:15 PM   #8
republicson
Member
 
Registered: Feb 2006
Location: Springfield, MO
Distribution: Ubuntu Dapper 6.06
Posts: 35

Original Poster
Rep: Reputation: 15
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.
 
Old 02-23-2006, 09:08 PM   #9
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Well, your printout tells the story. You need to tell grub-install WHERE to install. check grub manual (or maybe man grub-install)
 
Old 02-23-2006, 10:22 PM   #10
republicson
Member
 
Registered: Feb 2006
Location: Springfield, MO
Distribution: Ubuntu Dapper 6.06
Posts: 35

Original Poster
Rep: Reputation: 15
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
 
Old 02-23-2006, 10:46 PM   #11
nguyennh
Member
 
Registered: Feb 2006
Location: Vietnam
Distribution: FC , RH , SuSE
Posts: 106

Rep: Reputation: 15
Assume you want grub located at your Master Boot Record on /dev/hda , type this :
grub-install /dev/hda
Hope it helps you .
 
Old 02-23-2006, 10:48 PM   #12
nguyennh
Member
 
Registered: Feb 2006
Location: Vietnam
Distribution: FC , RH , SuSE
Posts: 106

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

=> You not installed info yet .
 
Old 02-23-2006, 11:05 PM   #13
republicson
Member
 
Registered: Feb 2006
Location: Springfield, MO
Distribution: Ubuntu Dapper 6.06
Posts: 35

Original Poster
Rep: Reputation: 15
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.
 
Old 02-24-2006, 01:47 AM   #14
reddazz
LQ Guru
 
Registered: Nov 2003
Location: N. E. England
Distribution: Fedora, CentOS, Debian
Posts: 16,298

Rep: Reputation: 77
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.
 
Old 02-24-2006, 08:09 AM   #15
saran_talks
LQ Newbie
 
Registered: Feb 2006
Location: Chennai
Posts: 1

Rep: Reputation: 0
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
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
reinstalling GRUB vineet7kumar Linux - Newbie 1 01-15-2006 12:02 PM
reinstalling grub vineet7kumar Linux - General 2 01-10-2006 07:57 AM
GRUB not reinstalling jboo Linux - Software 5 10-02-2005 10:55 AM
reinstalling GRUB 0perat0r Linux - Newbie 7 05-02-2005 02:30 PM
Reinstalling grub darkangel29 Linux - Newbie 3 04-03-2005 05:53 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration