LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Unable to install GRUB stage_1 to MBR (https://www.linuxquestions.org/questions/linux-newbie-8/unable-to-install-grub-stage_1-to-mbr-607309/)

andyuser 12-17-2007 06:04 AM

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

Davinder Singh 12-17-2007 07:09 AM

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?

andyuser 12-17-2007 07:22 AM

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.

andyuser 12-17-2007 07:40 AM

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.

ticthak 12-17-2007 12:55 PM

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

kwill 12-17-2007 09:27 PM

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.


All times are GMT -5. The time now is 07:28 PM.