LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Grub behaving strangely (https://www.linuxquestions.org/questions/linux-general-1/grub-behaving-strangely-471080/)

live_dont_exist 08-05-2006 02:08 PM

Grub behaving strangely
 
Hi Guys,
I seem to have misunderstood something about how Grub works...hers what my problem is...

HD1: 2 Windows partitions
HD2: 1 WinXP and 1 FC5 installation both in extended partitions

Now the problem is if I install Grub on the MBR it works fine but gives me error 22 when I try and boot into XP or Win2K...

Now ppl at home need Windows so I pop in the Win Cd and get into recovery console and do a "fixmbr" and Windows comes up ..problem is Grub is gone...this makes sense though coz Windows overwrites the MBR each time....why?...I dont know...

============================
I now go into Linux Rescue...go into...

grub>find /boot/grub/stage1
(hd1,7)

grub> root (hd1,7)
ext2fs.....

grub> setup(hd1)
...........Grub installs but Windows is gone....

=======================

So now I read up a bit and find out that if Windows is on a non-first hard disk Grub wont boot it and I have to use "map" to trick it...

so now I go into /etc/grub.conf

Title WinXP
rootnoverify(hd1,7) #Thats my partition on which WinXp is
map (hd0) (hd1)
map (hd1) (hd0)
chainloader +1
makeactive
==============
I've removed the device.map and recreated it...no issues there either...
===============

I reboot...no luck...Linux boots like a charm...Evil Bill does not...Im sicking of popping CD's in and out....can any1 help me out here...???


Why does Grub not recognize Windows partitions...I mean..its always worked so beautifully for the last 4-5 years....and detects anything...

I've wasted a whole Saturday trying to get this thing fixed... :(
All help is appreciated....

Cheers
Arvind
p.s....Let me know if you want grub.conf or my fdisk -l output .. I'll paste it here...

debiant 08-06-2006 09:37 AM

Quote:

Originally Posted by live_dont_exist
Hi Guys,
I seem to have misunderstood something about how Grub works...hers what my problem is...

HD1: 2 Windows partitions
HD2: 1 WinXP and 1 FC5 installation both in extended partitions

Now the problem is if I install Grub on the MBR it works fine but gives me error 22 when I try and boot into XP or Win2K...

Now ppl at home need Windows so I pop in the Win Cd and get into recovery console and do a "fixmbr" and Windows comes up ..problem is Grub is gone...this makes sense though coz Windows overwrites the MBR each time....why?...I dont know...

============================
I now go into Linux Rescue...go into...

grub>find /boot/grub/stage1
(hd1,7)

grub> root (hd1,7)
ext2fs.....

grub> setup(hd1)
...........Grub installs but Windows is gone....

=======================

So now I read up a bit and find out that if Windows is on a non-first hard disk Grub wont boot it and I have to use "map" to trick it...

so now I go into /etc/grub.conf

Title WinXP
rootnoverify(hd1,7) #Thats my partition on which WinXp is
map (hd0) (hd1)
map (hd1) (hd0)
chainloader +1
makeactive
==============
I've removed the device.map and recreated it...no issues there either...
===============

I reboot...no luck...Linux boots like a charm...Evil Bill does not...Im sicking of popping CD's in and out....can any1 help me out here...???


Why does Grub not recognize Windows partitions...I mean..its always worked so beautifully for the last 4-5 years....and detects anything...

I've wasted a whole Saturday trying to get this thing fixed... :(
All help is appreciated....

Cheers
Arvind

p.s....Let me know if you want grub.conf or my fdisk -l output .. I'll paste it here...

This should be all you need if Windows is installed on the first partition. hda1

title Windows XP
rootnoverify (hd0,0)
chainloader +1

You don't have to worry about the other partitions as they will load through Windows, they are not Windows partitions (unless for some odd reason you have installed differently on all 3 of them), they are NTFS partitions.

live_dont_exist 08-06-2006 02:04 PM

Thnx 4 the response...think you misunderstood me a bit...I fixed the thing BTW .. chainloaded the Windows on my first disk and then boot.ini did take over...

The problem is .. why doesnt grub directly bootable Windows partitions on my second hard disk...Here take a look..maybe this will make it clearer...

================================

root@attack lib]# /sbin/fdisk -l

Disk /dev/hda: 10.2 GB, 10205282304 bytes
255 heads, 63 sectors/track, 1240 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 319 2562336 7 HPFS/NTFS
/dev/hda2 320 665 2779245 b W95 FAT32

Disk /dev/hdb: 40.0 GB, 40060403712 bytes
255 heads, 63 sectors/track, 4870 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hdb1 1 127 1020096 82 Linux swap / Solaris
/dev/hdb2 128 4869 38090115 f W95 Ext'd (LBA)
/dev/hdb5 128 764 5116671 7 HPFS/NTFS
/dev/hdb6 765 2039 10241406 c W95 FAT32 (LBA)
/dev/hdb7 2040 2778 5935986 7 HPFS/NTFS
/dev/hdb8 * 2779 3670 7164958+ 83 Linux
[root@attack lib]#
=================================

I want to directly boot /dev/hdb7 after installing Grub which isnt happening... Grub loads up...and if I boot into Windows ...it takes me to teh WIndows boot loader...where I can select...I need something like

1.Fedora core 5
2.WinXP
3.Win2K

Hope this helps...
Cheers
Arvind


All times are GMT -5. The time now is 06:22 AM.