LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Boot loader problem (https://www.linuxquestions.org/questions/linux-newbie-8/boot-loader-problem-113924/)

euaruksakul 11-08-2003 07:45 PM

Boot loader problem
 
Hello,

I used to have 2OS in my computer, Redhat LINUX and WindowsXP. Last week I reinstall WinXP then my boot loader was gone. I tried to install boot loader back from the Redhat CD but I got message

'No kernel packages were installed on your system. Your boot loader config will not be changed'.

Then I tried using rescue mode. type

chroot /mnt/sysimage
grub -install /dev/hda

looked like the result is ok. Now I have grub boot loader. However, when I rebooted my coputer, I got the message

root hd0,1
filesystem type unknown, partition type 0xF
kernel /boot/vmlinuz-2.4.20-8 ro root=LABEL=/hdc=ide-scsi
Error 17: cannot mount selected partition

the message appear in broken letters. Then there are options to choose between DOS and LINUX. I can boot DOS (Windows) but not LINUX. Same error message (filesystem type unknow, partition type 0xF, cannot mount selected partition) appear again.

my linux partition is on /dev/hda3, windows on /dev/hda1 (I can see from fdisk -l). The * is on /dev/hda1. Is that correct?

Thank you very much.
Chanan Euaruksakul

Eqwatz 11-08-2003 08:22 PM

You haven't defined all of the partitions on your hard drive. I personally call that a partition map.

homey 11-08-2003 08:29 PM

The fact that you can get in using rescue mode is good and means that linux is not hosed.
After you boot into rescue mode and chroot to /mnt/sysimage....
Type: rdev so you can verify that the root partition is indeed on /dev/hda3
If you know where the root partition is you can proceed to repair the GRUB as follows...
Type:grub to get into the grub utility.
Type: root (hd0,2) which is grub speak for the first hard drive and the third partition of that drive. If you got it right, you will see a message like this..... Filesystem type is Ext2fs, partition type is 0x83.
Next type: setup (hd0)
Then type: quit to exit the grub utility.
Then reboot to try it.

euaruksakul 11-08-2003 09:03 PM

I just tried your advice. I got '/dev/hda3 /' from rdev. And after grub, root (hd0,2) give exactly what you said. setup (hd0) told no error message. However, I still cannot solve the problem. Do you have any suggestion? If I have to reinstall linux, do I have to remove the boot loader before?

Thank you very much
Chanan

homey 11-08-2003 09:16 PM

Ok maybe you do have a problem with the file system. Try the e2fsck routine with your system unmounted. If you plan to reinstall, I would try an upgrade first to see if that fixes it.
You don't have to mess with the old boot loader if you do reinstall.

Eqwatz 11-09-2003 09:53 PM

Ibid.

euaruksakul 11-09-2003 11:10 PM

I've check my linux partition type with

grub

>root (hd0,2)

and it showed that the partition type is 0x83. Shoud be the correct type?

Thanks a lot
Chanan

Eqwatz 11-10-2003 01:20 PM



If you were reading this before, I was confused, I double checked.

(hd0,0) is the first partition. Did you keep a partition map of your drive?

If so, what is it?
(hd0,0)= what?
(hd0,1)= what?
(hd0,2)= what?
and so on. I never have been able to keep everything straight, Sorry.

grub stage 1 resides in the MBR; stage 2 resides in the MBR; stage 1_5 is /boot/grub/grub.conf; Hey, wait a minute. If your machine will boot linux, or you can go on the internet with another machine why don't you info grub LIKE I JUST DID? Or http://www.google.com/linux info grub.

Another thing, XP wants to be the first operating system on the hard drive. If you moved stuff around with partition magic or anything, put it back. If you are doing a triple boot, things get pretty hinky.

I should not have made any resposes to your post until you gave a partition map. I have been confused and assumed things. Sorry.


pxumsgdxpcvjm 01-12-2007 08:03 PM

You need to edit grub.conf
 
I just reinstalled Windows XP to find that it had overwritten the MBR and my Grub bootloader with it. Which I think is the same problem you had. The info on this thread helped me, but it is incomplete.

Boot from the FC disk, go into rescue mode. Now fdisk -l to see what partition you need to boot from (in my case it was /dev/sda3, the third partition on my one and only hard drive. Then you need to edit /mnt/sysroot/boot/grub/grub.conf. In this file you will need to set any erroneous references to (hd0,0) to the correct (hd0,2), which I know from fdisk listing I just mentioned (note the 2 represents the third partition indexed from 0). And that is it. I rebooted and got into Fedora no problem.

If this doesn't work for you could try copying your important files to you windows partition with explore2fs and then try reinstalling or upgrading you linux installation.

Eqwatz 01-13-2007 09:31 AM

XP ate Grub installation
 
Actually, if the partition layout is identical to the original; the only thing necessary to do is run grub. This will replace the MBR with the grub boot loader.

**You have to be careful about running Grub from a rescue disk. Print out the portion of the guide which relates to specifically the parameters that you use to inform the program as to the location of the root of the Linux installation; the location of the /boot directory and the location of the program on the hard disk. If it is too late at night; get some rest, as you can end up making the same mistake over and over again--driving you right up the wall.

If the partitions have changed in any way, then the grub "menu.lst" (in Debian and Debian related distros,) or grub.conf (in the others) has to be edited to reflect the layout. The thing is that the grub installation has to be in the MBR of the first Disk (that is if you want to boot into Grub every time.)

I had many problems recreating a set-up on a machine with six discs after changing out the motherboard. It would appear that SIS chips can still cause "little problems" from time to time--even now. Either that or it had been so long that I had forgotten a whole bunch about Grub. I was forced to put a /boot partition as one of the primary partitions in the beginning of the first hard disk on the system; else it just wouldn't boot. The original layout--which worked on a VIA (and Intel) chipset--simply refused to work on a SiS chipset (unless it was because I was holding my lips wrong.)

I have had as many as 7 different installations of different OS-es booting on this machine--but it takes some tinkering, and a lot of reading to get it all to work. When doing multiple boots with different Microsoft products, one has to "hide" all of the other MS-related partitions while doing the installation and boots. This is taken care of by backing up the MBR before re-installation/installation of any MS product (and restoring it afterwards;) hiding all of the partitions using fdisk/cfdisk (or one of the others) and adding the commands to the entries in the grub/grub.conf or grub/menu.lst.) These things are covered in the different Guides (http://www.google.com/linux is your friend.)

saikee 01-13-2007 11:31 AM

I believe there has been an extended partition introduced since Red Hat was installed.

Your /boot/grub/grub.conf should read like this


Code:

title Windows
root (hd0,0)
chainloader +1
boot

Title Red Hat in hda3
root (hd0,2)
kernel /boot/vmlinuz-2.4.20-8 ro root=LABEL=/
initrd /boot/initrd.img-2.4.20-8.img
boot

It is the digit in red that you need to correct.


All times are GMT -5. The time now is 06:35 AM.