[Webinar] Streamline your web hosting managementRegister Today

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 517
  • Last Modified:

boot problems


I hv win xp on a 10 Gb HDD (primary) and RH 7.1 on a 3Gb Hdd (secondary)..

When I installed Linux, it overwrote the xp bootloader and I was able to log in only to linux.. Using the XP Cd, I executed FIXMBR and now I can enter only into XP!

I do hv a Linux boot disk and am unable to boot into the linux.. Upon booting with the startup disk I get 5 options but they r all about reinstalling/upgrading or troubleshooting linux..

I tried the troubleshooting option and got a shell prompt but do not know how to proceed from here!

RH7.1 hangs midway when I tried to use the graphic install.

But in either the graphic install or the text install, it never asks me as to where to install Lilo..

My basic problem right now is booting into linux.. How do i get into the linux partition ??

I can reinstall linux for all its worth but i guess the same problem will repeat with linux overwriting windows bootloader..

Can anyone help me out??

  • 4
  • 2
  • 2
  • +2
2 Solutions
You need to boot linux, so that you can write the linux bootloader to a "partition bootrecord" instead of the master boot record (MBR). Then you need to copy that record to a file, put that file "near" boot.ini, make an entry for it in boot.ini... and enjoy:-).
To have XPs ntloader chainload LILO in this way is better than to have LILO chainload ntloader... You simply run less chance of "accidentally" overwriting the MBR... (CHKDSK, defragmenting "system partition" etc might do this).
The implied question "How do I make the installer write somewhere beside MBR"? IIRC you need to do an expert install for that option to be visible (either expert graphical or expert textmode).

Now, how to do it, without reinstalling?

Presuming you haven't destroyed your install with the "reinstall attempts", you should boot into rescue mode.
When you reach the shell prompt, you should mount your "on-disk" installation *somewhere*, or check if the rescue mode already did that for you.
Before we proceed with that, you have to make sure what device handle(s) to use: /dev/hda is the device handle for the primary IDE master, /dev/hdb is the Primary slave, /dev/hdc is secondary master, /dev/hdd is primary slave etc.
and look for your linux partition(s) device handle(s).
If they arent there, do (I'll assume you have it at secondary master == /dev/hdc in the following):
fdisk -l /dev/hdc<Enter>
to list your "linux drives" partitions.
If it is just one, it'll be a simple
mount -t ext2 -o rw /dev/hdc1 /mnt<Enter>
to mount it all, if you have more, you'll have to mount first the root partition "/", then "/boot", "/var" ... or whatever split you've chosen. You can mount a partition as in the above, and then use "ls /mnt<Enter>" to inspect it...

When you have mounted all partitions, do
chroot /mnt<Enter>
this will switch your "percieved" root to be your on-disk root.
After that you can do
vi /etc/lilo.conf<Enter>
Back at the prompt after changing the configuration file type
to write the first stage loader to the partition boot record indicated by "boot=/dev/hdc5"
In the above hdc5 is an example, you should use something appropriate to your setup.
to reboot to windows.
Download bootpart from http://www.winimage.com/bootpart.htm and use it to add an entry for your lilo to boot.ini
to list the partitions and
bootpart <partition number> bsect.lnx "Linux"<Enter>
Cd to the same place you have boot.ini before running bootpart.

-- Glenn
If you want to boot with Windoze's NTLDR, instead of LILO or GRUB...

Boot into Linux and copy the boot image from the first sector of your boot partition. You'll want to take 512 bytes of this partition once, and write it out to a file called bootsect.lnx. The entry should look like:

dd if=/dev/hdX of=/bootsect.lnx bs=512 count=1

Move that file onto your c:\ drive and edit boot.ini, adding the following line:


Why not just use LILO or GRUB to dual boot Linux/Windows?  I prefer either of those to Windows's NTLDR.

....I just realized that you said you can't boot into Linux.  Just boot off your Redhat CD and go into recovery mode.  This will bring you to a shell and it will mount your partitions in something like /mnt/sysimage, or something similar.  The dd command should be available to you here, probaly in </mnt/sysimage>/bin/dd.  

I don't know why you aren't prompted for where to install LILO or GRUB.  It should ask you whether or not you want to install one of them, and if you want to install it to the MBR or the first sector of the bootdisk.

Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

sgauchoAuthor Commented:

solved the problem finally... As fluid11 suggested, the partitions were mounted under mnt/sysimage... at the end, it was a simple matter of editing lilo.conf and adding a coupla lines..

well guys, since Glen first started me off, i wud like to divide the points between u two...:)

so how do i do it!!?

p.s: this may be a diff topic but wud appreciate if u can answer it..I hv been trying to configure my x-server for quite sometime now.. I have tried every possible combination including the ones specified on the monitor.. When trying to install the graphic version, it tested the x server config and i even wrote it down and used it in the text version install , all to no avail...

any suggestions,

If you want to "split points", it is usually done by adjusting the points on the question and accepting one comment as answer, then posting a second question on the form "Points for XXX" (where XXX is the recipients callsign) in the same TA, with the amount of points you feel is due;).

Just a quick comment to you both: The reason to not use LILO (or GRUB) as primary bootloader in dual-boot situations (especially with M$ OSes) is the risk of having it overwritten. If you feel that is a small risk to run, sure it's no big deal rewriting it...:-). But that is the "philosofy" behind using ntloader. Why use bootpart instead of trusty ol' dd? Because many (most?) systems using ntloader uses NTFS, which isn't directly writeable fromlinux (well, not reliably;-).... so it's convenient to use a windoze tool to read out the partition boot record.
But there is nothing wrong with using LILO or GRUB, on the contrary... One day perhaps all OSes will support the Multiboot specification (even Linux;), and then most certainly GRUB should be everybodys choice.

-- Glenn
my 2 cents - after encountering personal mbr/multiboot grief numerous times, I do all my LILO'ing to diskette (4 versions of Linux+Win ME) - always boot from diskette, never touch the hard drive mbr.

The big plus about diskette's is write protection and easy backup.

.... And the bad thing is .... that it's diskettes...:-).
Dust, (cheap diskette) material "fatigue" etc.

Since cd-rw is cheap (:-), one fun variation on arn0lds suggestion is to make an El Torrito "bootfloppy ISO"... should help up some of the abovementioned disadvantages of diskettes.

-- Glenn
so Glenn thinks it is "fun" (or is it points?). It is business - hard lessons learned after 8/9 years of using Linux. I have a scsi tape, cartridge disk and cd writer (and a 2nd computer with which I occasionally exechange files)

I have created a bootable CD, a bootable self-contained Linux diskette (tom's) and a bootable cartridge disk. I have crons that do backups onto "spare" hard disks and I create  regular backups onto CD.

None of this offers the flexibility and simplicity of booting from diskettes- which will surely last 2/3 years and, as I said, diskette copying  is fast and simple.

As a long time forum watcher, Glen surely knows that the "what happened to my mbr" lament occurs like clockwork - diskettes do the job - if you understand and learn how to properly utilize them.

No irony intended. And I don't really disagree, just point to diskettes being fickle at best.

If your diskettes last 2-3 years(!) you surely have a more neat environment than mine... Usually when I find a need to use that ol' bootdisk, it is a) chokeful of dust, b) slightly altered by heat/sunlight, or c) just is not that orderly magnetic any more.
The good thing with a cd-rw is that it is cleanable and rewritable(sp?).

Keeping the diskette(s) in the drive more or less continually, or storing them more properly (than I do:-), would of course drastically improve things.
I've not said making a bootfloppy is a bad thing, just that you need to consider all risks. Again, with a little knowledge, making a new one isn't a big deal... in fact no more onerous than rewriting the MBR.

And yes, the "where did the bootloader go?" question is very common. It usually goes away (in each case) with a little education (in my opinion).

Obviously we have similar experiences, and draw slightly different conclusions... probably because you have a neater work environment;).

-- Glenn
This old question needs to be finalized -- accept an answer, split points, or get a refund.  For information on your options, please click here-> http:/help/closing.jsp#1 
Post your closing recommendations!  No comment means you don't care.

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

  • 4
  • 2
  • 2
  • +2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now