LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 04-24-2002, 12:43 AM   #1
feaz
LQ Newbie
 
Registered: Apr 2002
Location: Jacksonville, FL
Posts: 11

Rep: Reputation: 0
LILO ate my NT loader - Help, please


Being the optimist, I continue to plug away with RedHat, hoping that the learning curve will pick up soon, and that I have not hosed my Win2K installation, although I (fortunately) did ghost the partitions before starting ANY of this....

I have Windows 2000, and RedHat 7.1 I have 2 hard disks. Disk 0 has two NTFS partitions; disk 1 is (well, was) blank.

I installed Linux as a workstation and accepted the defaults, letting it partition my drive for me. It put the partitions (as expected) on drive 1, and left my NTFS partitions on drive 0. LILO runs, and Linux boots, but I now lock up if I try to boot to DOS (Win 2K). I am assuming that somehow the NT loader (or something) has disappeared from my partition table or something. Is it possible to restore this, or have I lost the C: drive? How do I make these two c-exist in the future?

On a related note, I have in the past used Partition Magic to shuffle around and re-size partitions to fit Linux onto a hard drive. While PM recognizes Linux partitions, it seems that once LILO (presumably) is installed, PM considers the whole physical drive (ALL partitions on that piece of hardware) to be invalid, and it therefore seems to be impossible to remove Linux at some point in the future. Is there a procedure for removing LILO and Linux, or it truely the "herpe" of my hard disk? Up to this point, it seems the only alternative is just to re-image the hard drive when I want to remove it. Thanks in advance for any help. -- Jim
 
Old 04-24-2002, 02:42 AM   #2
Psycho
Member
 
Registered: Feb 2002
Location: Carson City, Nevada
Distribution: Gentoo / SuSE 9.1 Pro (both A64)
Posts: 159

Rep: Reputation: 30
I thought Lilo could boot NT just fine, there may be something self inflicted here. But anyway ...

Don't do this until you understand every bit of what you have to do, or you may have to restore an image. I am also assuming that lilo has been run only the one time.

From the lilo man page...
Code:
       -u [device-name]
              Uninstall  lilo  by  copying  the saved boot sector
              back.  The '-s' and '-C' switches may be used  with
              this option.  The device-name is optional.  A time-
              stamp is checked.
DON'T leave Linux after removing lilo from the mbr or Linux will be hosed, unless you're going to just remove it. If you're going to remove fdisk it out from under it's self

As su /sbin/lilo -u should restore your mbr, can't say I've ever tried it on an NT machine. NT can be a bear if it won't boot, hopefully you have a Win9x boot disk or something similar laying around. If not you may have to download one if you can't bum one from a friend if the mbr isn't restored properly. I'd have one on hand before trying this.

Verify that you have a /boot partition or directory, it don't really matter which.

You will need to modify /etc/lilo.conf before re-running lilo.
Mine's not going to be the same as yours, but it'll serve...

WARNING if your boot and root lines don't match up with the below I've made a mistake or bad assumption. Post /etc/lilo.conf and /etc/fstab and get it straightened out before attempting this.

Code:
#prompt              ## comment this line out with  #
timeout="200"
default=linux
boot=/dev/hda     ## change this to /dev/hdb1
compact
install=/boot/boot.b
map=/boot/map
vga=normal

image=/boot/vmlinuz
	root=/dev/hdb1    ## verify this line  
	label=linux
	append="hdc=ide-scsi hdd=ide-scsi"
	read-only

Dos stuff here, remove it.
As su run /sbin/lilo -v and watch for errors.

Make a boot disk for Linux. mkbootdisk your_kernel_version I believe for RH7.2 if not there is a gui tool, or browse the administration section of the man pages with xman looking for mkboot...

As su do dd if=/dev/hdb1 of=linux.bin bs=512 count=1
Put linux.bin on a dos floppy.

Restart the box, with luck it will boot NT. Add Linux="C:\linux.bin" in boot.ini and copy linux.bin to C:\. The next time you restart you should be able to boot linux from the nt bootloader. If not there's the floppy

If NT still won't start, boot a dos floppy and run fdisk /mbr and try again. If it still don't boot NT restore the image of C: and repeat the boot.ini tweak and linux.bin to C:\

If something don't seem kosher as you look around to verify this, get it resolved before actually doing it. Also follow the sequence when you actually do it. lilo before the boot disk or the boot disk is worthless.

Jeez, this was a lot longer than I anticipated.
good luck
 
Old 04-26-2002, 11:51 PM   #3
feaz
LQ Newbie
 
Registered: Apr 2002
Location: Jacksonville, FL
Posts: 11

Original Poster
Rep: Reputation: 0
Thanks a million!!!

Sorry it took me a couple of days to get back to you... But I really wanted to say THANK-YOU so very much for the post the other day, and the help getting this issue resolved. I particularly appreciated the fact that you took the time to post an explanation of the details, so that I was empowered to figure out the rest of it for myself.

I learned a great deal about LILO and how it all works, thanks to your post. Basically, I discovered that the problem was not that LILO had eaten my NT loader as I had suspected, but rather, it had been configured to boot DOS from hda5 instead of hda1. Why it did this, I have no idea, but once I resolved that issue in the configuration file and re-ran LILO, the problem was solved! Thanks again, muy mucho!

-- Jim
 
Old 04-27-2002, 01:22 AM   #4
DMR
Member
 
Registered: Jun 2001
Location: Fairfax, California
Distribution: RH 9.0, RH 7.3, Mandrake 8.0
Posts: 986

Rep: Reputation: 30
Re: Thanks a million!!!

Quote:
Originally posted by feaz
Basically, I discovered that the problem was not that LILO had eaten my NT loader as I had suspected, but rather, it had been configured to boot DOS from hda5 instead of hda1.
Here's what happened, and why (follow the bouncing ball...):

1.You said that you had 2 Win partitions on the first hard drive.

2. DOS/Win only allows you to create one primary partition per drive, which in DOS/Win is C:, and in Linux is hda1. However, Linux and other OSes can create up to 4 primary partitions (which is the limit for IDE disks on a PC, regardless of OS).

3. Therefore, any other Win partitions you create have to be extended partitions, which are a special kind of primary partition invented to get around this limit. Extended partitions are "special" in the sense that they can be subdivided into many logical partitions to overcome the overall 4 partiton limit. In fact, you must create at least one logical partition within an extened partition, because "raw" extended partitions can't be used or formatted directly.

4. Because DOS/Win can only create 1 primary partition (which is always C:), the first logical partition in the first extended partition is always D: (unless you have another primary partition on another hard drive- primary partitions take precedence over extended partitions in the DOS/Win drive-naming scheme). You would think that Linux would see this first logical DOS/Win partition as hda2, right?

5. Nope. Linux, because it is capable of creating 4 primary partitions, reserves hda1-hda4 for primary partitions, even if you don't really have 4 primaries. So in Linux land, the first logical drive in an extended partition is always hda5.

You see where we're going here: Linux sensed 2 Win partitions, but chose the wrong one to use as the bootable partition.

When I installed Redhat 7.2 on a 2-drive system already running Windows, it made the same mistake (and this was with grub, not lilo). I had my entire primary drive formatted as FAT32, with Win98 installed there. The second drive, which was the one I was installing Redhat on, had an existing FAT32 partition on it which I was using as a backup drive. During the Redhat installation, grub saw that I had 2 FAT32 partitions, but made the mistake of thinking that the one one the second drive contained the Win98 OS. To fix the problem, all I had to do was change the drive/partition pointer in /boot/grub/menu.lst to look at the right Win partition.

Last edited by DMR; 04-27-2002 at 01:24 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
replace lilo loader with windows loader Mickaletto Linux - Newbie 9 11-25-2005 07:26 PM
LILO Boot Loader drumstick Linux - Software 1 05-20-2005 04:18 AM
lilo boot loader shadowsurfer Linux - Newbie 4 09-26-2004 02:41 PM
LILO Loader disappeared !!~~ AoiSora Linux - Newbie 4 01-21-2004 01:28 AM
NEED your help! cannot startup LILO loader vwhk Linux - General 13 10-11-2002 08:24 PM


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