LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Fedora (http://www.linuxquestions.org/questions/fedora-35/)
-   -   Emergency.. Lost Grub's controls of Fedora 7! (http://www.linuxquestions.org/questions/fedora-35/emergency-lost-grubs-controls-of-fedora-7-a-569402/)

gabeyg 07-14-2007 10:30 PM

Emergency.. Lost Grub's controls of Fedora 7!
 
I recently re-installed Fedora 7 because of GRUB issues. Since then, (please do not recommend me bootpart..., since I tested it and it didn't work.) I installed using Linux expert, check the cd condition, and installed the Fedora 7 in Graphic install mode. My hard disk currently is /dev/sda1 (Primary, XP)
/dev/sdb1 (Linux boot file) (root=/boot)
/dev/sdb2 (Linux main, LVM)(root=/)
And, /dev/sdb is 1TB USB drive. When the option came to me about installing GRUB, I made it to "Boot installation from /dev/sdb" and when the option came to me about installing GRUB to MBR, there was only one option, installing to /dev/sda, but although I clicked that, I also clicked "Configure the boot option", which allowed me to install GRUB to /dev/sdb's MBR by switching HDD order. Then, I installed normally. (I also changed BIOS boot settings, by the way, too...) When I rebooted, "Operating System Not Found" was shown. When I booted from Fedora Live CD, it seems ok about grub.conf.
File of menu.lst and grub.conf

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
# initrd /initrd-version.img
#boot=/dev/sdb
default=2
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Fedora (2.6.20-2925.9.fc7xen)
root (hd0,0)
kernel /xen.gz-2.6.20-2925.9.fc7
module /vmlinuz-2.6.20-2925.9.fc7xen ro root=/dev/VolGroup00/LogVol00 rhgb quiet
module /initrd-2.6.20-2925.9.fc7xen.img
title Fedora-base (2.6.21-1.3194.fc7)
root (hd0,0)
kernel /vmlinuz-2.6.21-1.3194.fc7 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.21-1.3194.fc7.img
title Other
rootnoverify (hd1,0)
chainloader +1


This is fdisk -l

Disk /dev/sda: 52.1 GB, 52108145664 bytes
255 heads, 63 sectors/track, 6335 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 5702 45801283+ 7 HPFS/NTFS
/dev/sda2 5703 6335 5084572+ 77 Unknown

Disk /dev/sdb: 1000.2 GB, 1000207286272 bytes
255 heads, 63 sectors/track, 121601 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 13 104391 83 Linux
/dev/sdb2 14 121601 976655610 8e Linux LVM

And...
More is that...
when I clicked to /dev/sdb2's /etc/grub.conf, it showed me in Live CD error of
"This file can not be opened because of broken link of /dev/sdb2's /boot/grub/grub.conf." Also, I found that although the /dev/sdb1 (root=/boot) exists, sdb2 (root=/)'s boot folder (/boot of /dev/sdb2, not /dev/sdb1) is empty.

/dev/sdb1 (root=/boot)'s /grub/device.map

# this device map was generated by anaconda
(hd1) /dev/sda
(hd0) /dev/sdb

file of /etc/fstab

/dev/VolGroup00/LogVol00 / ext3 defaults 1 1
LABEL=/boot /boot ext3 defaults 1 2
tmpfs /dev/shm tmpfs defaults 0 0
devpts /dev/pts devpts gid=5,mode=620 0 0
sysfs /sys sysfs defaults 0 0
proc /proc proc defaults 0 0
/dev/VolGroup00/LogVol01 swap swap defaults 0 0


This is really questionable: I mounted Fedora 7's files (/dev/sdb1 was automatically mounted to 'computer', but /dev/sdb2 wasn't mounted since it is LVM, so I mounted manually to Live Cd's filesystem /fedora7.) when try to open (/fedora7)/etc/grub.conf, it shows me error of "The file can not be opened because it is broken link to (/fedora7)/boot/grub.conf." Also, /dev/sdb2's boot folder is empty, which should been synchronized with /dev/sdb1 (root=/boot) .
Thanks.
Please help me...
Thanks.

dinolinux 07-15-2007 04:24 AM

Hi

It looks like you've got a few syntax errors:
  • SCSI drives are called sd(0,0), sd(0,1) and so on in GRUB, not hd(0,0)
  • Menu.lst or grub.conf should be in /boot/grub, not /etc

Also, where is your bootloader now? MBR on /dev/sda?

decrepit 07-15-2007 05:17 AM

Quote:

Originally Posted by gabeyg

And...
More is that...
when I clicked to /dev/sdb2's /etc/grub.conf, it showed me in Live CD error of
"This file can not be opened because of broken link of /dev/sdb2's /boot/grub/grub.conf." Also, I found that although the /dev/sdb1 (root=/boot) exists, sdb2 (root=/)'s boot folder (/boot of /dev/sdb2, not /dev/sdb1) is empty.


This situation is normal with any Fedora system, as /boot is a separate partition to /root /root/boot is empty when the system isn't booted, it's only when the system is booted that /boot gets "mounted" in /root. Some other distros don't have boot on a separate partition, and of course /root/boot is accessible whether system is booted or not.

Not sure what your problem is, but could it be something to do with booting from a USB drive. Does grub really see that as hd0?? It's a long shot, but I'd try changing it to hd1 and see what happens,

Also looks like you'll have trouble booting windows from there,

Quote:

title Other
rootnoverify (hd1,0)
chainloader +1
think that will need another couple of lines mapping the drives over so that windows thinks it's on the main drive, think it should look something like this.

title XP
rootnoverify (hd1,0)
map (hd1) (hd0)
map (hd0) (hd1)
makeactive
chainloader +1

gabeyg 07-15-2007 05:33 AM

Quote:

Originally Posted by dinolinux
Hi

It looks like you've got a few syntax errors:
  • SCSI drives are called sd(0,0), sd(0,1) and so on in GRUB, not hd(0,0)
  • Menu.lst or grub.conf should be in /boot/grub, not /etc

Also, where is your bootloader now? MBR on /dev/sda?

No, no the grub files are located in (/boot)/grub, but just I'm trying to open /etc/grub.conf. Also, GRUB is located in /dev/sdb's MBR and it passes to /dev/sdb1's file (stage2) then loads fedora installation processes. (to /dev/sdb2 -LVM, /dev/VolGroup00/LogVol00)

gabeyg 07-15-2007 05:44 AM

Quote:

Originally Posted by decrepit
This situation is normal with any Fedora system, as /boot is a separate partition to /root /root/boot is empty when the system isn't booted, it's only when the system is booted that /boot gets "mounted" in /root. Some other distros don't have boot on a separate partition, and of course /root/boot is accessible whether system is booted or not.

Not sure what your problem is, but could it be something to do with booting from a USB drive. Does grub really see that as hd0?? It's a long shot, but I'd try changing it to hd1 and see what happens,

Also looks like you'll have trouble booting windows from there,



think that will need another couple of lines mapping the drives over so that windows thinks it's on the main drive, think it should look something like this.

title XP
rootnoverify (hd1,0)
map (hd1) (hd0)
map (hd0) (hd1)
makeactive
chainloader +1

Since I changed BIOS settings before installation, yes, it is right that it is hd0. Also thanks for XP infos.

IBall 07-15-2007 07:29 AM

Quote:

Originally Posted by dinolinux
Hi

It looks like you've got a few syntax errors:
  • SCSI drives are called sd(0,0), sd(0,1) and so on in GRUB, not hd(0,0)
  • Menu.lst or grub.conf should be in /boot/grub, not /etc

Sorry dino, but:
1) GRUB does not distinuish between SATA, PATA and SCSI.
2) Fedora puts the GRUB config in /etc

:)
--Ian

gabeyg 07-15-2007 07:56 AM

Let's go to main problem here
 
Let's solve this first: why grub or the thing is showing Operating System Not Found?

decrepit 07-16-2007 05:49 AM

Quote:

Originally Posted by gabeyg
Let's solve this first: why grub or the thing is showing Operating System Not Found?

So that looks like grub has found the kernel, (otherwise it would say something like "file not found") but the kernel can't find the operating system?
Does that sound right???

You could go into grub command mode during boot, hit "edit" at the grub menu, then you can play around with each line and see what happens.

Quote:

kernel /vmlinuz-2.6.21-1.3194.fc7 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
You could try changing this line to
kernel /vmlinuz-2.6.21-1.3194.fc7 ro root=/dev/sdb2 rhgb quiet

It looks like sdb1 is either /boot or swap and sdb2 is /
I know nothing about logical volumes, be interesting to see what this does.

It could be that sdb1 is boot and sdb2 being under LVM is both / and swap, in that case my suggestion could confuse things.

PTrenholme 07-16-2007 09:41 AM

Quote:

Originally Posted by IBall
<snip>
Sorry dino, but:
1) GRUB does not distinuish between SATA, PATA and SCSI.
2) Fedora puts the GRUB config in /etc
</snip>

What's in /etc ia a link to /boot/grub/grub.conf
Code:

$ ls -l /etc/grub.conf
lrwxrwxrwx 1 root root 22 2006-07-02 20:31 /etc/grub.conf -> ../boot/grub/grub.conf

so, if /boot is not mounted, the link will fail.

gabeyg: Rather than using the LiveCd, try a linux rescue from an installation dice, and use the setroot command to access your F7. Then use the grub-install script (or just the grub commands) to reinstall grub in the MBR.

Also, check that the labels on your boot partitions match the LABEL= settings in your /etc/fstab, and that you have no label conflicts.

gabeyg 07-17-2007 08:16 PM

No..
 
Quote:

Originally Posted by decrepit
So that looks like grub has found the kernel, (otherwise it would say something like "file not found") but the kernel can't find the operating system?
Does that sound right???

You could go into grub command mode during boot, hit "edit" at the grub menu, then you can play around with each line and see what happens.


You could try changing this line to
kernel /vmlinuz-2.6.21-1.3194.fc7 ro root=/dev/sdb2 rhgb quiet

It looks like sdb1 is either /boot or swap and sdb2 is /
I know nothing about logical volumes, be interesting to see what this does.

It could be that sdb1 is boot and sdb2 being under LVM is both / and swap, in that case my suggestion could confuse things.

I didn't see grub menu.....

gabeyg 07-17-2007 08:22 PM

I'm trying..
 
Quote:

Originally Posted by gabeyg
I didn't see grub menu.....

I'm currently trying many suggestions. If all fails, I will post again at this thread on this sunday.
By the way, I found my device.map should be like this:
(hd0) /dev/sda
(hd1) /dev/sdb

so..
i'm fixing problems slowly.., not completely still, but...

decrepit 07-18-2007 04:47 AM

Quote:

# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
# initrd /initrd-version.img
#boot=/dev/sdb
default=2
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Fedora (2.6.20-2925.9.fc7xen)
root (hd0,0)
In core 6, there's a screen that comes up, saying something like, "press any key to see grub menu within 5 sec".
To alter that so menu comes up each time, in the above code, add an # in front of "hiddenmenu" like so.
# hiddenmenu

And change "timeout=5" to timeout=10

That way the menu will show up during boot, and give you 10sec to press a key instead of 5sec.

So, let us know what you do, and what the results are.

kojot 07-23-2007 04:10 PM

Quote:

Originally Posted by gabeyg
I'm currently trying many suggestions. If all fails, I will post again at this thread on this sunday.
By the way, I found my device.map should be like this:
(hd0) /dev/sda
(hd1) /dev/sdb

so..
i'm fixing problems slowly.., not completely still, but...


Did you fix the problem? I have the same troubles. If you know how, please help me.

gabeyg 07-24-2007 09:03 AM

Fixed..
 
Quote:

Originally Posted by kojot
Did you fix the problem? I have the same troubles. If you know how, please help me.

The problem is pixed. If anyone needs solution, contact me.

decrepit 07-25-2007 05:41 AM

would be better if you can post it here, that way anybody searching can just see what you've done.

Plus I'd like to see if I've actually been any help. Or if the solution lies elsewhere.


All times are GMT -5. The time now is 11:52 AM.