LinuxQuestions.org
Help answer threads with 0 replies.
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 07-18-2011, 06:14 AM   #1
Weapon S
Member
 
Registered: May 2011
Location: Netherlands
Distribution: Debian, Archlinux
Posts: 240
Blog Entries: 2

Rep: Reputation: 48
Grub"2": Windows 98 installation not auto-detected


Background:
I have installed Windows 98 and Debian together before. This time however I started to run into trouble from the start. There was a Win XP and Debian installation left-over, but I had made considerable changes to the hardware, so I decided to format and create new partitions (Parted). The Wind 98 installer didn't like that, and eventually, I cleared the disk with Parted and used Fdisk. When I installed Debian, it couldn't find my Win 98 installation, but I thought it would be easier to add it to Grub with a working Linux, than installing Grub via Win 98/DOS. Debian starts up fine. Windows partition visible, and I believe correct. I could use Win 98 before I installed Linux.

Information I've found so far:
I think I need to add this (somewhere?):
Code:
menuentry "Windows" {
	insmod chain
	insmod fat32
	set root=(hd0,1)
	chainloader +1
}
I've just mashed together this (mentioned in chain loading in the Grub manual):
Code:
menuentry "Windows" {
	insmod chain
	insmod ntfs
	set root=(hd0,1)
	chainloader +1
}
and this (which seems to be the way to go for the old Grub):
Code:
title		Microsoft Windows 98/SE
root		(hd0,1)
savedefault
makeactive
chainloader	+1
I can't make sense out of the "new" Grub manual. In there I've found a lot of information on setup preliminaries (which the Debian already took care of for me), but I can't find the page that says where I actually edit the menu. (And, I guess, after that run update-grub.)
Most tutorials seem to be on "legacy" Grub...
Some help, please.
Solution:
The reason it wasn't auto-detected seems to be that I installed Linux in another primary partition.

Add (something like) the following to /etc/grub.d/40_custom
Code:
menuentry "Windows 98" {
        insmod chain
        insmod fat32
        set root=(hd0,1)
        chainloader (hd0,1)+1
}
Or a more generic/fail-safe one:
Code:
menuentry "Windows 98" {
        insmod chain
        insmod part_msdos
        insmod fat
        set root='(hd0,msdos1)'
        search --no-floppy --label --set 'Your label'
        drivemap -s (hd0) $(root)
        chainloader +1
}
Read the fabulous manual of Grub... There are some links to reference material in this thread. I just reformatted and created a logical partition for Linux, and it worked. Align the logical partition to cylinder heads, if you want to share ut between Linux and Windows.

Last edited by Weapon S; 07-20-2011 at 08:58 AM. Reason: Solved
 
Old 07-18-2011, 06:17 AM   #2
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
update-grub
searches for os & adds the entry.
 
Old 07-18-2011, 06:49 AM   #3
Weapon S
Member
 
Registered: May 2011
Location: Netherlands
Distribution: Debian, Archlinux
Posts: 240
Blog Entries: 2

Original Poster
Rep: Reputation: 48
Unhappy Been there, done that.

... and that's what's not happening. It's very clear to me what should be done, but Grub doesn't agree. I'm willing to fix it manually, but I rather not go as far as manually editing grub.cfg.
BTW I also ran os-prober (and then update-grub).

Last edited by Weapon S; 07-18-2011 at 07:11 AM.
 
Old 07-18-2011, 07:10 AM   #4
alfredo10
Member
 
Registered: Sep 2010
Location: Algarve
Distribution: Linux Multiboot
Posts: 295

Rep: Reputation: 15
Hi!
Because I had a hw problem, I no longer have Debian, but please first try, if your Grub version is displayed:
Code:
dpkg --list | grep grub
(I don't know if "dpkg" is available in Debian.)
If you have Grub 1.96 or higher [Beta!] (so called "Grub 2"), hermanns grub page could help:
http://members.iinet.net/~herman546/...0Commands.html
alfredo

Edit: Or Terminal as root -
hexdump -v -s 0x80 -n 2 -e '2/1 "%x" "\n"' /dev/sdXY
for all partitions (to find out each OS)
e.g. sda, sda1, sda2, ... (first hd), ... and post the output.

Last edited by alfredo10; 07-18-2011 at 07:15 AM. Reason: Addition
 
Old 07-18-2011, 08:00 AM   #5
Weapon S
Member
 
Registered: May 2011
Location: Netherlands
Distribution: Debian, Archlinux
Posts: 240
Blog Entries: 2

Original Poster
Rep: Reputation: 48
I have no idea what this does...

Here you have it!
Code:
# hexdump -v -s 0x80 -n 2 -e '2/1 "%x" "\n"' /dev/sda
7c3c
# hexdump -v -s 0x80 -n 2 -e '2/1 "%x" "\n"' /dev/sda1
7cc6
# hexdump -v -s 0x80 -n 2 -e '2/1 "%x" "\n"' /dev/sda2
00
# hexdump -v -s 0x80 -n 2 -e '2/1 "%x" "\n"' /dev/sda3
00
# hexdump -v -s 0x80 -n 2 -e '2/1 "%x" "\n"' /dev/sda4
00
# hexdump -v -s 0x80 -n 2 -e '2/1 "%x" "\n"' /dev/sda5
6f74
# hexdump -v -s 0x80 -n 2 -e '2/1 "%x" "\n"' /dev/sda6
hexdump: /dev/sda6: No such file or directory


# hexdump -v -s 0x80 -n 2 -e '2/1 "%x" "\n"' /dev/sdb
bc81
# hexdump -v -s 0x80 -n 2 -e '2/1 "%x" "\n"' /dev/sdb1
b6d1
# hexdump -v -s 0x80 -n 2 -e '2/1 "%x" "\n"' /dev/sdb2
hexdump: /dev/sdb2: No such file or directory

# hexdump -v -s 0x80 -n 2 -e '2/1 "%x" "\n"' /dev/hda1
hexdump: /dev/hda1: No such file or directory
# hexdump -v -s 0x80 -n 2 -e '2/1 "%x" "\n"' /dev/hdb1
hexdump: /dev/hdb1: No such file or directory
I had no idea I had so many partitions... (WIN98, Extended, logical in the extended, Linux, Swap, USB-Stick, ?, ?, ?)
I have version 1.98. Apparently it works completely with a template system (*shiver*), but there is a template provided to hack something in, namely /etc/grub.d/40_custom. Going to try that now. I had to read that in grub.cfg D:
 
Old 07-18-2011, 08:12 AM   #6
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
Here is one of the best tutorials I have found on grub2.

I have a short term memory problem so keep this for reference.
 
Old 07-18-2011, 08:33 AM   #7
Weapon S
Member
 
Registered: May 2011
Location: Netherlands
Distribution: Debian, Archlinux
Posts: 240
Blog Entries: 2

Original Poster
Rep: Reputation: 48
Smile \O/

It seemed to work. Thanks for the replies. I wouldn't [sic] have done it without you! ;D
I added this to /etc/grub.d/40_custom:
Code:
menuentry "Windows 98" {
        insmod chain
        insmod fat32
        set root=(hd0,1)
        chainloader (hd0,1)+1
}
And then ran update-grub. (But I guess grub-mkconfig -o /boot/grub/grub.cfg would work too.)

And now my mouse seems to be quirky under Windows 98 (?? WTF ??). Going to wait to mark this as solved...
 
Old 07-18-2011, 08:49 AM   #8
alfredo10
Member
 
Registered: Sep 2010
Location: Algarve
Distribution: Linux Multiboot
Posts: 295

Rep: Reputation: 15
Hi Weapon S!
What I found out:
In the MBR of the first hd (dev/sda) is / was installed Grub 1.9x.
On your partitions is / was installed:
sda1: Windows
sda5: Fat32

sdb1: XP / Fat32

alfredo
 
Old 07-18-2011, 05:49 PM   #9
Weapon S
Member
 
Registered: May 2011
Location: Netherlands
Distribution: Debian, Archlinux
Posts: 240
Blog Entries: 2

Original Poster
Rep: Reputation: 48
Ha! That all looks like voodoo to me. :") I guess that sdb was my USB stick.
Grub to Grub2 differences: I've figured out that makeactive is replaced by parttool boot=true (and that this is only necessary for multiple Windows installations.) setdefault is replaced by some global flag somewhere in the config files.
(I'm really peeved I have to learn something obsolete, just to understand all the tutorials.)
This deals with Windows 9x for old Grub:
http://www.faqs.org/docs/Linux-HOWTO...rub-HOWTO.html
Now I just have to translate rootnoverify to grub2, and we're done. I hope that the quirks Win 98 has now will be gone after that. Thank you, and good night.
 
Old 07-19-2011, 04:44 AM   #10
EDDY1
LQ Addict
 
Registered: Mar 2010
Location: Oakland,Ca
Distribution: wins7, Debian wheezy
Posts: 6,838

Rep: Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649Reputation: 649
I have in the past gotten debian & ubuntu to see my wins installation by mounting the wins partitions and running "update-grub".
 
Old 07-19-2011, 06:21 AM   #11
Weapon S
Member
 
Registered: May 2011
Location: Netherlands
Distribution: Debian, Archlinux
Posts: 240
Blog Entries: 2

Original Poster
Rep: Reputation: 48
Yeah, it worked automatically last time for me too :-/
I see I have the working grub.cfg file ... from another hardware setup
Typing over...
Code:
menuentry "Windows 95/98/ME (on /dev/sda1)"{
  insmod part_msdos
  insmod fat
  set root='(hd0,msdos1)'
  search --no-floppy --fs-uuid --set 4995-b12b
  drivemap -s (hd0) ${root}
  chainloader+1
}
I'll have to figure out what all the magic commands and numbers are. (But I'd rather have somebody giving me the answer :P)
OK, figured most part out. search will look if a device with a certain criterion exists. (In the example file system UUID.) If the set option is given, it will replace $root with the finding.
drivemap maps/switches devices (ignoring paths, if they are in the arguments). -s tells it to switch the reverse too (hd0 becomes $root and $root becomes hd0). This seems unnecessary in this case...
Going to try this:
Code:
menuentry "Windows 98" {
        insmod chain
        insmod part_msdos
        insmod fat
        set root='(hd0,msdos1)'
        search --no-floppy --label --set 'CWIN'
        drivemap -s (hd0) $(root)
        chainloader +1
}
BTW I installed a KVM switch so that might be causing the mouse quirks :")
Screw this. I've blargagled my Win98 installation (with iffy drivers, not by Grub), so I'm going to nuke the whole thing and reinstall with Linux residing in a Logical partition instead of a primary... which seems what was my previous setup.

Last edited by Weapon S; 07-19-2011 at 10:13 AM.
 
  


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
Ubuntu 10.10 installation, "No common CD-ROM drive was detected" jyh9208 Linux - Newbie 1 12-19-2010 08:20 PM
CENTOS INSTALLATION "rpmdb PANIC fatal region error detected run recovery" struggled_newbie Linux - Newbie 1 06-21-2010 10:49 PM
" URGENT " Hard drive not detected while Installation pradeep_g5 Linux - Hardware 1 09-02-2007 10:50 AM
grub list "MZ" for my windows boot "Help on Change" davimint Linux - Newbie 2 01-26-2006 07:22 AM
RH Linux 9.0 installation step "Auto partitioning" not able to read partition table awahab Linux - Newbie 5 05-19-2005 08:53 AM


All times are GMT -5. The time now is 06:40 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