LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices



Reply
 
Search this Thread
Old 12-04-2003, 02:27 AM   #1
amatin
LQ Newbie
 
Registered: Nov 2003
Posts: 12

Rep: Reputation: 0
installing grub


Greetings,

Sorry if this is a repeat. I'm trying to re-install grub. I had a working linux (redhat 9) installation, followed the HOWTO to copy the disk to a larger disk. That failed, and now, I can not boot the original Linux drive. I think I need to re-install grub (the loader I was using). I have done the following:

Booted from the installation diskette. gone in to rescue mode. run grub and grub-install. GRub gives me an 'invalid device" when I try to install to /dev/hda. grub-install goes down a long path of finding files...(all on my hard drive)

I've done the following:

grub
install --root-directory=/boot /dev/hda
Error 12: Invalid device requested.
(fails)

i've done:
grub-install /dev/hda
fails searching for stage1 file or grub-install

I've tried to install using upgrade, but that fails to update grub since i've not updated the kernel.

Jus *how* do you install grub, outside of an initial install???

TIA
Brian
 
Old 12-04-2003, 04:35 AM   #2
Faecal
Member
 
Registered: Sep 2002
Location: York, UK
Distribution: Debian Sid
Posts: 215

Rep: Reputation: 30
>install --root-directory=/boot /dev/hda
This line fails because inside grub, the device naming scheme is different. But never mind, this probably wasn't the way to to it.

To use grub-install, you'll need to have the filesystem with grub's files mounted. For instance, having booted from a rescue disc on my system, I might do something like:
Code:
mount -t ext2 /dev/hda1 /mnt/foo
grub-install --root-directory=/mnt/foo/ /dev/hda
Naturally, this changes for different devices and mount points. If you have a separate /boot/ partition that contains your grub stage1 files and so on, you'll want to mount this rather than your root partition.
 
Old 12-04-2003, 05:22 AM   #3
amatin
LQ Newbie
 
Registered: Nov 2003
Posts: 12

Original Poster
Rep: Reputation: 0
thanks for the reply.

I did the variation where the directory is mounted...and gave it the directory

grub-install --root-directory=/mnt/sysimage/boot /dev/hda
(which is where allegly my boot partiion lives)

i get an error back
/sbin/grub : not found

now...this will lead to the path issues....if I copy it up..ect...then various pars of grub will fail.

There has *got* to be a way to simply install grub. Like fdisk /mbr.

?
TIA
Brian
 
Old 12-04-2003, 06:48 AM   #4
coolamit78
Member
 
Registered: Aug 2003
Location: New Delhi, India
Distribution: RHEL AS 3/4, Windows XP
Posts: 546

Rep: Reputation: 31
Well, I can't suggest u anything different, but would give u the appropriate steps to re-install grub.

1. Boot from your CD and type 'linux rescue'

2. chroot /mnt/sysimage

3. /sbin/grub-install /dev/hda

These are the normal steps to re-install grub.

However, if thats not working, you can switch to LILO temporarily and then re-install grub again.

Follow these steps to replace GRUB with LILO

1. locate a file lilo.anaconda.conf in /etc. Now copy this file and name it to lilo.conf

# cp /etc/lilo.anaconda.conf /etc/lilo.conf

2. Now edit the lilo.conf as per your requirement.

3. After that give the following commands:

lilo

lilo -v -v

4. This will replace grub with lilo.

Try these pointers...and hope that your problem gets resolved.

Regards,

amit
 
Old 12-04-2003, 12:01 PM   #5
Faecal
Member
 
Registered: Sep 2002
Location: York, UK
Distribution: Debian Sid
Posts: 215

Rep: Reputation: 30
Apologies, I had assumed that the additional step of chrooting to the mounted system would be unneccessary, since you appeared to have grub available in your rescue environment. The above poster's advice is correct.

As for why there is no "fdisk /mbr", this is because grub is an awful lot more sophisticated than the bootloader installed by microsoft's tools. In fact, the main criticism levelled at grub is that it is too complex. "fdisk /mbr" doesn't give you a menu, a console, etc, it just dumbly loads the first DOS partition it finds. The installation process of grub is more complex because it needs a configuration file, and it needs to know where its "stage" files are (only a small stub of grub gets loaded into the boot sector itself, the rest is loaded from filesystems).
 
Old 12-04-2003, 12:45 PM   #6
amatin
LQ Newbie
 
Registered: Nov 2003
Posts: 12

Original Poster
Rep: Reputation: 0
Thanks!!!!! That got lilo working! Whew.....now...i'll figure out grub.

Thanks for your input, it was greatly appreciated.

Regards,
Brian
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
installing grub:( Alexander.s Linux - Software 3 06-04-2005 09:39 PM
Installing my own GRUB - HELP PLEASE!!! stevesk Linux - Software 2 12-17-2004 12:20 PM
Why grub prompt after installing Grub inder Debian woody 3.0r2? velan Debian 1 04-20-2004 05:55 AM
Re-installing XP with grub Rizla Linux - General 1 04-14-2004 08:43 AM
Installing Grub dark_light Linux - General 2 10-09-2002 08:25 PM


All times are GMT -5. The time now is 12:18 PM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration