Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

boot problems

Posted on 2003-03-27
10
Medium Priority
?
514 Views
Last Modified: 2010-04-20
Hi,

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??

thnx,
sg
0
Comment
Question by:sgaucho
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 2
  • 2
  • +2
10 Comments
 
LVL 20

Assisted Solution

by:Gns
Gns earned 150 total points
ID: 8219234
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.
Issue
mount<Enter>
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>
/boot=<Enter>
0Cboot=/dev/hdc5<Esc>ZZ
Back at the prompt after changing the configuration file type
lilo<Enter>
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.
<Ctrl>-<Alt>-<Del>
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
bootpart<Enter>
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
0
 

Accepted Solution

by:
fluid11 earned 150 total points
ID: 8220963
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:

c:\bootsect.lnx="Linux"


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


ChrisP
0
 

Expert Comment

by:fluid11
ID: 8221041
....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.


ChrisP
0
Command Line Tips and Tricks

The command line is a powerful tool at the disposal of every Linux user. Although Linux distros come with beautiful user interfaces, it's worthwhile to learn the command line because it allows you to do a number of things that you otherwise cannot do from the GUI.  

 

Author Comment

by:sgaucho
ID: 8223636
Hi,

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,

thnx,
sg
0
 
LVL 20

Expert Comment

by:Gns
ID: 8223697
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
0
 
LVL 1

Expert Comment

by:arn0ld
ID: 8228854
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.

0
 
LVL 20

Expert Comment

by:Gns
ID: 8235082
.... 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
0
 
LVL 1

Expert Comment

by:arn0ld
ID: 8235792
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.

0
 
LVL 20

Expert Comment

by:Gns
ID: 8237018
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
0
 

Expert Comment

by:CleanupPing
ID: 9087601
sgaucho:
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 
EXPERTS:
Post your closing recommendations!  No comment means you don't care.
0

Featured Post

Simplifying Server Workload Migrations

This use case outlines the migration challenges that organizations face and how the Acronis AnyData Engine supports physical-to-physical (P2P), physical-to-virtual (P2V), virtual to physical (V2P), and cross-virtual (V2V) migration scenarios to address these challenges.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article will explain how to establish a SSH connection to Ubuntu through the firewall and using a different port other then 22. I have set up a Ubuntu virtual machine in Virtualbox and I am running a Windows 7 workstation. From the Ubuntu vi…
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
Suggested Courses

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question