LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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 12-17-2007, 07:04 AM   #1
andyuser
LQ Newbie
 
Registered: Dec 2007
Posts: 3

Rep: Reputation: 0
Unable to install GRUB stage_1 to MBR


Please help!

My hardware: single athlon processor, single 120GB SATA hard drive (with drive jumpers set to master), MSI KT8 NEO motherboard.

AMIBIOS 3.31a is set with SMART disabled, and boot sector virus protection disabled. LBA mode to auto. plug n play aware O/S set to NO, and no BIOS passwords activated.

Some blogs have mentioned an improved success rate if the ACPI function is switched off in the BIOS, unfortunately the BIOS of this machine (under the ACPI option) only has 3 modes, “S1/POS”, “S3/STR” AND auto, so I cannot switch it off.

I have attempted to install many versions of linux (from magazine coverdiscs), namely 2 versions of ubuntu, a version of slackware, 2 versions of mandriva, & fedora core v6 & v7. All to take over the whole hard drive, some of the install DVDs have been used on other machines, so I know that the DVDs are complete ISOs.

All of the distros install cleanly, but when I restart the machine, I get “Missing Operating System”.
I can then install windows on the same drive, which installs without a problem, which I interpret as that I cannot write to the MBR which was previously set for windows.

When I replace the install DVD and boot from it, I can select a menu option to reinstall the bootloader. This option generates the following text:

grub> setup –stage2= /boot/grub/stage2 (hd0)
checking if “/boot/grub/stage1” exists... no
checking if “/grub/stage1” exists... yes
checking if “/grub/stage2” exists... yes
checking if “/grub/e2fs_stage1_5” exists... yes
/boot/grub/install.sh:line 5: 1423 segmentation fault
grub –device.map=/boot/grub/device.map –batch
<<EOF
root (hd0,5)
setup –stage2=/boot/grub/stage2(hd0)
quit
grub failed: at /usr/lib/libDrakX/bootloader.pm line 1657, <STDIN> line1.
program exited abnormally (return code 2).

With windows on ½ the drive & Linux on the other ½ the machine boots to windows only without displaying a menu or splash screen, I.E. not even recognising grub stage 1.

The system is currently setup as:
/hda1 is windows c:
/hda5 is /boot
/hda6 is /
/hda7 to /hda10 are /home, /usr & /var

Following the instructions found after a web search. Using a live distro (Knoppix) in Konqueror, I can see that on /hda5 (installed as a /boot partition) there are the following files:
grub (directory)
config-2.6.17-13mdv
gfxmenu
initrd-2.6.17-13mdv
initrd.img
system.map-2.6.17-13mdv
vmlinuz
vmlinuz-2.6.17-13mdv

Inside the grub directory there is:
device.map
e2fs_stage1_5
fat_stage1_5
ffs_stage1_5
install.sh
iso9660_stage1_5
menu.1st
menu.1st.example
minix._stage1_5
reiserfs_stage1_5
stage1
stage2
ufs2_stage1_5
vstafs_stage1_5
xfs_stage1_5

the contents of file menu.1st. are:

timeout 10
color black/cyan yellow/cyan
gfxmenu (hd0,4)/gfxmenu
default 0

title linux
kernel (hd0,4)/vmlinuz BOOT_IMAGE=linux root=/dev/hda6 resume=/dev/hda7 splash=silent vga=788
initrd (hd0,4)/initrd.img

title linux-nonfb
kernel (hd0,4)/vmlinuz BOOT_IMAGE=linux-nonfb root=/dev/hda6 resume=/dev/hda7
initrd (hd0,4)/initrd.img

title windows
root (hd0,0)
makeactive
chainloader +1

title failsafe
kerne (hd0,4)/vmlinuz BOOT_IMAGE=lfailsafe root=/dev/hda6 failsafe
initrd (hd0,4)/initrd.img

title windows
root (hd0,0)
makeactive
chainloader +1

The contents of device.map are:
(fd0) /dev/fd0
(hd0) /dev/hda

But directory /hda6/boot is empty, (should this be a link to the /boot partition?)

Then in a Knoppix shell, I got:

#sudo fdisk -l

Device boot start end blocks Id System
/dev/hda1 * 1 783 7 HPFS/NTFS
/dev/hda2 784 6903 5 Extended
/dev/hda5 784 893 83 Linux
/dev/hda6 894 1597 83 Linux
/dev/hda7 1548 1859 82 Linux swap/Solaris
/dev/hda8 1860 2878 83 Linux
/dev/hda9 83 Linux
/dev/hda10 83 Linux

#find /boot/grub/menu.1st
find: /boot/grub: No such file or directory

Then into GRUB mode in the shell:
#grub
GNU GRUB Version 0.95

grub> find /boot/grub/stage1
Error 15: file not found

grub> find /grub/stage1
Error 15: file not found

grub> root (hd0,4)
filesystem type is ext2fs, partition type 0x83

grub> setup (hd0)
setup (hd0) segmentation fault (core dumped)
“then GRUB kicks me out, but after re-entering GRUB mode I try:”

grub> grub-install /dev/hda
Error 27: Unrecognised command

grub> grub --install /dev/hda
Error 27: Unrecognised command

grub> mkdir /mnt/root
Error 27: Unrecognised command

grub> root (hd0,14)
Segmentation fault

Can anyone please give me some guidance on how I can install GRUB stage_1 so that it is recognised by the BIOS?

Thanking you in advance
 
Old 12-17-2007, 08:09 AM   #2
Davinder Singh
LQ Newbie
 
Registered: Sep 2006
Posts: 11

Rep: Reputation: 0
Dear
Firstly tell me when u installed the linux on ur box then it gives you any error during installtion......if no then if will ask you for an option during the installation about MBS or First boot loader pls confirm what you choose there?
 
Old 12-17-2007, 08:22 AM   #3
andyuser
LQ Newbie
 
Registered: Dec 2007
Posts: 3

Original Poster
Rep: Reputation: 0
Unable to install GRUB stage_1 to MBR

Thank you for responding.
The installation (on my preferred distro mandriva) does not give me any opportunity to select a location to install GRUB.
I am assuming that the distro forces a link onto the MBR and the majority of GRUB is saved into a /boot partition.
 
Old 12-17-2007, 08:40 AM   #4
andyuser
LQ Newbie
 
Registered: Dec 2007
Posts: 3

Original Poster
Rep: Reputation: 0
Unable to install GRUB stage_1 to MBR

Also, all of the distros that I have tried appeared to install completely without giving any error messages.

Sometimes when installing previous versions of mandriva I have previously recieved the error message: unable to install bootloader, the following error occured:.

Previously when trying to install a version of fedora on the same machine, there was an option to chose the location to install GRUB, which I chose as /boot, the installation completed without displaying any errors, but then did not find any bootloader when trying to use the machine.
 
Old 12-17-2007, 01:55 PM   #5
ticthak
LQ Newbie
 
Registered: Feb 2006
Posts: 2

Rep: Reputation: 0
Boot loader install problems

I'm having a similar problem with trying to get PCLinuxOS on a 40-GB IDE drive with a multiboot install, everything installs, but no bootloader (so the partitioning is being written to the MBR, but not any version of GRUB or LILO)

basicly stock Compaq Presario SR1309RS with downgraded RAM (to 256MB, hey it's what I had laying around) and Sempron 3100+

everything seems to work pretty much fine from the LiveCD, but will only boot Windows from HDD

trying to write bootloader results in similar error messages
 
Old 12-17-2007, 10:27 PM   #6
kwill
Member
 
Registered: Jul 2007
Location: Horowhenua New Zealand
Distribution: (X)(K)ubuntu PCLinuxOS Mepis Puppy
Posts: 67

Rep: Reputation: 18
andyuser, if you install grub to /boot it will still need some bootloader on master boot record (mbr). As the windoze mbr won't boot any thing else.

I have found that it is easiest on a multi boot machine to install grub to mbr for one distribution (don't bother about a separate /boot partition) and then to install in the / partion for any other distributions on the machine. Then put a simple chainloader command into the original /boot/grub/grub.conf This is not the best way but seems to be easier. This way each distibution can have its own selection of boot commands without interfering with any other.
 
  


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
re-install grub to mbr nomb Fedora 1 11-19-2007 11:09 AM
Grub won't install in MBR PB0711 Linux - Software 4 05-02-2007 02:12 AM
How to install Grub other than MBR? terryxela Ubuntu 1 04-08-2007 05:31 PM
how do i install grub in the mbr? spyghost Linux - Newbie 2 11-07-2003 10:52 AM
GRUB Install on MBR JakeFarley Linux - Newbie 3 10-22-2002 08:16 AM


All times are GMT -5. The time now is 10:21 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration