Link to home
Start Free TrialLog in
Avatar of dong081698
dong081698

asked on

Linux dual boot with Win98

Previously my computer had Win2K and Redhat7 installed and the dual-boot work fine between them. The Win2K boot menu will prompt me to select between Win2K and Linux. A few days ago my Win2K crashed and completed screwed up. Then, I decided to put Win98 on my computer instead of Win2k. Since the Win2K partition is NTFS which is not compatible with Win98, I removed the NTFS partition using fdisk. What I notice is, the LINUX partition is set as an extended DOS drives (but doesn't show a logic drive letter). After removed the NTFS partition, my computer system couldn't boot anymore. Therefore, I use a startup disk to recreate the FAT32 partition for the disk area released from the NTFS and installed the Win98. Now my computer can boot from Win98, but I like to know how to make the dual boot work between Win98 and Linux. Pls note that the Linux partition is kept intact during my Win98 installation and I don't want to re-install the Linux. Thanks.
Avatar of swapsthegreat
swapsthegreat

hi

   u have to use the linux bootloader lilo to do this. u can boot into linux through DOS. While booting 98 go to command prompt only. Ifu dont have ur cdrom driver in dos, then boot through 98 floppy and start with cdrom support. On ur redhat cd there will be following files :

loadlin.exe (in dosutils dir)
vmlinuz (in autoboot dir)


now type

loadlin vmlinuz root=/dev/hd?? at the dos prompt. give ur proper / partition id.

u shud be able to boot.


Now edit the file /etc/lilo.conf

Make following changes
There will be some lines
image=/boot/vmlinuz
 label=linux and so on

Now u add
other=/dev/hd??  (ur win partition id)
label=dos

At the top add a line (if not present)
boot=/dev/hda
prompt
default=linux   (whichever label u want default)


save the file and run /sbin/lilo -v

Now reboot and u shud get a lilo prompt which will allow u to choose between win and linux

   
ASKER CERTIFIED SOLUTION
Avatar of swapsthegreat
swapsthegreat

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
If "swapsthegreat" had paid closer attention to your question he would have noticed you've already given tbe required information to complete the lines above for LILO to work.

Your initial difficulty will be starting Linux again after erasing the boot entry that Windows 2000 was using to kick start it.  An alternative way to boot Linux from any Linux boot disk / CD is to simply press tab at the LILO: prompt and enter

linux single initrd= root=/dev/hda5

to start Linux using single mode (a non-secure mode).  If you still know you're root password, you can use

linux 3 initrd= root=/dev/hda5

This should run the normal Linux startup procedure and result in you reaching a command line.  If you have used the second option above (linux 3...) you will then need to login using your root account and its passsword.

At the command line type vim /etc/lilo.conf to edit the lilo.conf file (the file used to present the LILO boot menu) and examine it carefully for the following line:

lba32

If that is missing, insert it towards the top of the file - it should only be present once.

There are then two entries defining what appears in the boot menu: each is identified with the label= line.  You should have a section which probably looks like:

image=/boot/vmlinuz
root=/dev/hda5
label=linux

If so, this is fine.  Look further down for the following, and add it if necessary:

other=/dev/hda1
label=win


Finally to ensure LILO is installed in the correct place you use this near the top of the file:

boot=/dev/hda
prompt
default=linux
timeout=300

This will install LILO to the first Master Boot Record of the first hard disk (/dev/hda) and prompt for which operating system to load on bootup.  The default line can of course be changed to win if you'd prefer Win 98 to startup instead of linux.

Hope this helps...
well mr mhomoky it seems u r the one not payin attention. When dong doesnt have lilo, how do u expect him to boot by pressing tab ?

the lba32 line is required only for large hard disks when the linux partition is in above 8gb

Also mr mhomoky u completely neglected the fact that after putting the boot= entries and saving the file u need to run lilo at the prompt to actually write the mbr.




If you don't mind booting into DOS first, loadlin might be a much simpler way to boot into Linux.
swaps,

I accept I forgot to ask dong to run /sbin/lilo when he had completed the steps to edit the /etc/lilo.conf file, but I *did* specify how to start the system using LILO:

"An alternative way to boot Linux from any Linux boot disk / CD is to simply press tab at the LILO: prompt and enter..."

Now I assume dong still has his installation CD / Rescue floppy created during loading, so this shouldn't be a problem for him.

The problem with loadlin in my opinion is that it has to run under DOS in the first place so that boot process is more lengthy and cumbersome.  Start PC; press Esc at the moment where the Win 98 boot loader pauses to allow this (but with no indication - this can be easily missed); select DOS Safe Mode (Command prompt only) from the menu - otherwise other drivers are loaded; finally from the DOS prompt enter the full path to loadlin to start Linux.

My alternative (and that of most Linux users) is to use the one of the excellently written LInux LOaders (in my case my preference is LILO - but Grub is equally good).  Here you can choose between Linux in several kernel versions and Windows.  Lest us forget that Microsoft aren't accumstomed to allowing us to boot alternative operating systems - until Windows NT this was not possible without third party support such as loadlin.

dong - apologies for forgetting to ask you to run /sbin/lilo at the end of the procedure I outline above.  The line LBA32 is not required but is highly recommended (it does not harm if not required, but you won't be able to boot if it's missed off a large hard disk installation).  You made no mention as to the size of your partitions - only that you managed to remove the NTFS one using fdisk from the (Win 98?) boot disk.  I would tread very carefully herer as fdisk has been known to write invalid partition boundaries that sometimes overlap, but this depends very much on your circumstances.
I disagree with the comment about Loadlin being lengthy/difficult. When I had Windows 98 on my computer, I found it to be the simplest way to get to Linux. With a quick edit to config.sys you can have a graphical menu (just like the one you get when you hit F8 while starting Windows) with options to load Linux, Windows, etc. I set mine up to load Linux after 2 seconds, unless I hit a key and selected a Windows boot instead. Total configuration time was about five minutes, and by setting the default DOS shell to loadlin.exe for the Linux settings, I bypassed having to load command.com and type stuff in. The only difference between Loadlin and any "pure" Linux loader is that Loadlin is run from DOS (and, can be run at any time when DOS is loaded) while others run at startup. LILO may offer more flexibility, but Loadlin is simpler to configure.
Fair comment trenchdigger.  Your point about config.sys is correct and to be fair there is about the same amount of config needed whichever way you choose to do it.

Some people prefer tinkering with the DOS / Windows settings, others prefer to leave that well alone and tinker only with the Linux side.  I have no preference either way.

Avatar of dong081698

ASKER

Thanks a lot.
I think the reason I was drawn to Loadin initially is that it required no knowledge of the complicated stuff that LILO seemed to need. In retrospect I was wrong (my system is, in fact, exactly like one of the sample setups in the readme) but I was still much more comfortable within the confines of an OS I already knew. Now that I've gotten into Linux and have become more knowledgable about such things I'm doing all sorts of stuff I wouldn't have done, like LILO.
I've also recently tuned my hard drive with hdparm, and I was scared that I'd kill my computer for a long while because of the warnings in the man page... the point is, even though they're dealing with about the same amount of setup, Loadlin is an easier approach to grasp at first.