LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   how to fix grub problem? (https://www.linuxquestions.org/questions/linux-newbie-8/how-to-fix-grub-problem-423049/)

an2ny_18 03-09-2006 12:57 AM

how to fix grub problem?
 
hi guys,

i just wanna ask how to fix my grub problem?

my problem is, when i start my computer and boot to grub i cant see the grub menu and only grub show me the grub command promt.

like this:

Quote:

GNU GRUB version 0.95 (639k lower / 1047488 upper memory)

[ Minimal BASH-like line editing is suported. For the First word, TAB
list the posible command completion. Anywhere else tab list the posible
completions of a device/filename,]

grub>

after that i read the thread from fedora that i can use the native installation using root (hd0,0) but doesnt work. and i also try to install in rescue mode.

i enter the following command:

Quote:

Insert The Fedora Core Disk 1

linux rescue

(loading)

chroot /mnt/sysimage
fdisk -l

/dev/hda1 * 1 13 104391 83 linux
/dev/hda2 14 9729 78843990 8e Linux LVM

grub-install /dev/hda
/dev/mapper/VolGroup00-LogVol00 does not have any corresponding BIOS drive

grub-install /dev/hda1
/dev/mapper/VolGroup00-LogVol00 does not have any corresponding BIOS drive
how can i fix this problem?

thank you all

AwesomeMachine 03-09-2006 01:23 AM

There is a file called "/boot/grub/menu.lst". This is the file grub reads to give you a boot menu. If the file exists, with entries in it:

root hd(0,0)
kernel <path to kernel i.e. /boot/kernel-2.6.8>
initrd <path to initrd i.e. /boot/initrd-2.6.8>

If grub can't read /boot/grub/menu.lst there is a problem. You can edit the boot parameters in the grub command prompt by typing them at the prompt. When you have typed them all in(hit enter in between boot parameters), hit "b" and it should boot. If you don't know exactly what to put in the boot parameters, type "root" and hit tab. All the grub partitions that are bootable will show up. You pick the one you want. Then type "kernel", tab and the list of kernels will show up. Pick the one you want to boot with. Then do initrd. When you are done, hit "b".

an2ny_18 03-09-2006 02:07 AM

thank for your help but when im using the root

root hd(0,0)
Error 11: Unrecognize device string.

and when im using the kernel and initrd

kernel + tab
Error 1: Filename must be either an absolute pathname or blocklist

kernel /boot/kernel-2.6.8 + tab
Error 12: invalid Device requested

initrd with the same error.

an2ny_18 03-09-2006 03:05 AM

i cant find also the /boot/grub/menu.lst

but when i try to find:

find /boot/grub/stage1
/boot/grub/stage1

please help me this is my 4 days trying to recover my files and run my computer.

thank you, a little help for me and a big thank for you.

jomen 03-09-2006 07:49 AM

Quote:

root hd(0,0)
Error 11: Unrecognize device string.

and when im using the kernel and initrd

kernel + tab
Error 1: Filename must be either an absolute pathname or blocklist
you must first set the root correctly - there was a typo...

it is:
root (hd0,0)

then the other commands can also work

and:
kernel (hd0,0)/TAB --> will list what is there (note the slash - you need to write path names...you can omit (hd0,0) but do not omit the slash.)

an2ny_18 03-09-2006 08:48 AM

sorry guys didnt work. i think a have a problem.

if im trying to use the command:

root (hd0,0)
Filesystem type is ext2fs, partition type 0x83

about the kernel

kernel (hd0,0)/tab will be automatic change to kernel (hd0,0)/lost+found

i think i deleted all the boot files. there is nothing on this partition.

can i remove and create again my first partition?

and install grub?

if i try to use the rescue command:

fdisk -l

/dev/hda1 * 1 13 104391 83 linux
/dev/hda2 14 9729 78843990 8e Linux LVM

look guys i think i have my boot partition.

and if i try to find my grub settings

find /boot/grub/stage1
/boot/grub/stage1

how come its ok but when i need to boot in my fedora core it loads only the grub command promt.

thank you guys for helping me here.

jomen 03-09-2006 09:17 AM

could you give the output of these commands, when you are in rescue mode?
Code:

mount
ls -l /boot
ls -l /boot/grub

just a guess:
I'm not familiar with LVM and how it works - but I think you had the /boot (dev/hda1 ?) partition not mounted, when you installed grub - thats why it is empty.

PTrenholme 03-09-2006 09:57 AM

Quote:

Insert The Fedora Core Disk 1

linux rescue

(loading)

chroot /mnt/sysimage
fdisk -l

/dev/hda1 * 1 13 104391 83 linux
/dev/hda2 14 9729 78843990 8e Linux LVM

grub-install /dev/hda
/dev/mapper/VolGroup00-LogVol00 does not have any corresponding BIOS drive

grub-install /dev/hda1
/dev/mapper/VolGroup00-LogVol00 does not have any corresponding BIOS drive
I'm not sure why /dev/mapper is involved here at all, unless it's trying to tell you that it can't find grub-install because /mnt/sysimage is empty. What happens if you do a ls /mnt/sysimage before you do the chroot? If the sysimage directory is empty, try a lvchange -a to activate your logical volumes.

The comment about BIOS drive makes me wonder if you have a BIOS setting problem. You might want to check that your IDE mode is set (in your BIOS) to "compatable" rather than "enhanced," since Fedora sometimes has problems with "enhanced" mode.

When you get the grub> prompt, you could try to do the install by hand:
Code:

   
# grub
grub> root (hd0)
grub> setup (hd0,0)
grub> exit


an2ny_18 03-09-2006 09:57 AM

chroot /mnt/sysimage
mount
/dev/VolGroup/LogVol00 in / type ext3 (rw,defaults)
/dev/proc on /proc type proc (rw,defaults)
/dev/sys in /sys type sysfs (rw,defaults)

ls - /boot
drwxr-xr-x 3 root root 4096 Mar 7 16:42 boot
drwxr-xr-x 3 root root 4096 Mar 10 02:16 grub

chroot /mnt/sysimage
mount
/dev/VolGroup/LogVol00 in / type ext3 (rw,defaults)
/dev/proc on /proc type proc (rw,defaults)
/dev/sys in /sys type sysfs (rw,defaults)

ls - /boot
drwxr-xr-x 3 root root 4096 Mar 7 16:42 boot
drwxr-xr-x 3 root root 4096 Mar 10 02:16 grub

ls -l /boot/grub
drwxr-xr-x 3 root root 4096 Mar 9 06:03 boot
drwxr-xr-x 1 root root 30 Mar 10 02:17 device.map
drwxr-xr-x 1 root root 7476 Mar 10 02:16 e2fs_stage1_5
drwxr-xr-x 1 root root 7300 Mar 10 02:16 fat_stage1_5
drwxr-xr-x 1 root root 6612 Mar 10 02:16 ffs_stage1_5
drwxr-xr-x 1 root root 6612 Mar 10 02:16 iso9660_stage1_5
drwxr-xr-x 1 root root 8096 Mar 10 02:16 jfs_stage1-5
drwxr-xr-x 1 root root 6772 Mar 10 02:16 minix_stage1_5
drwxr-xr-x 1 root root 8980 Mar 10 02:16 reiserfs_stage1_5
drwxr-xr-x 1 root root 512 Mar 10 02:16 stage1
drwxr-xr-x 1 root root 101704 Mar 10 02:16 stage2
drwxr-xr-x 1 root root 6952 Mar 10 02:16 ufs2_stage1_5
drwxr-xr-x 1 root root 6228 Mar 10 02:16 vstafs_stage1_5
drwxr-xr-x 1 root root 8764 Mar 10 02:16 xfs_stage1_5


Quote:

jomen
What happens if you do a ls /mnt/sysimage before you do the chroot?
ls /mnt/sysimage
sbin dev home lost+found misc net proc sbin srv tmp var
boot etc live media mnt opt root selinux sys usr

Quote:

# grub
grub> root (hd0)
grub> setup (hd0,0)
grub> exit
grub
root (hd0)
Filesystem type unknown, using whole disk
setup (hd0,0)
Error 17: Cannot mount selected partition.

thats it.

PTrenholme 03-09-2006 10:26 AM

Try to create a GRUB boot floppy, and see if you can boot your system from it:

1) Boot the rescue CD
2) Place a blank floppy in your floppy drive
3) If the floppy was mounted, unmount it. (e.g., umount /media/floppy.)
Code:

# mke2fs /dev/fd0
# mount /media/floppy
# mkdir /media/floppy/boot
# mkdir /media/floppy/boot/grub
# cp /boot/grub/stage1 /media/floppy/boot/grub/stage1
# cp /boot/grub/stage2 /media/floppy/boot/grub/stage2
# grub
# grub> root (fd0)
# grub> setup (fd0)
# grub> quit

Leave the floppy in the drive and reboot. (Making sure that your BIOS is set to boot from your floppy drive first.)

an2ny_18 03-09-2006 10:29 AM

ok w8 i will search for a floppy drive..

you have an other options?

PTrenholme 03-09-2006 10:50 AM

Hopefully, you ment a floppy disk, not drive! :)

The point is to see if the problem is in the HDs boot sector. If you can boot from a floppy, then I'd suggest looking at your BIOS "virus protection" settings, which may be interfering with GRUB changing the information in the boot sector. (Not, actually, too likely, since you do get the GRUB prompt, whic implies that GRUB was, in fact, installed on the HD.) But a sucessful floppy boot will validate the install.

Oh, you should do the chroot before you make the floppy, so you get the settings for your installiation, not the rescue disk's settings.

Edit: Have to go walk the dog now, back in a hour or so.

an2ny_18 03-09-2006 11:20 AM

EDIT: no!, because i never use the floppy, thats why i need to find my floppy drive.


mke2fs /dev/fd0

it is successfull but when im trying to do this next command. got error.

mount /media/floppy
mount cant find /media/floppy in etc/fstab or etc/mtab

jomen 03-09-2006 11:44 AM

mount -t ext2 /dev/fd0 /media/floppy
the directory /media/floppy needs to exist - and you need to be root for this.

PTrenholme 03-09-2006 12:01 PM

Quote:

Originally Posted by an2ny_18
[snip]
mount /media/floppy
mount cant find /media/floppy in etc/fstab or etc/mtab

Sorry, I've been assuming that you were installing a Fedora system, since you mentioned a Fedora thread in your first post. Fedora (by default) defines /media/floppy and adds an automount line to /etc/fstab, so I assumed all of that was set-up in my comments.

Edit: If jomen's comment wasn't clear, you need to do (as root)
Code:

# mkdir /media
# mkdir /media/floppy
# mount /dev/fd0 /media/floppy # The -t ext2 won't hurt, but isn't necessary

You can, of course, replace /media with any other directory (/mnt is often used), and /floppy by, again, anything you want to call it. Just be sure to use whatever you chose in all the commands.


All times are GMT -5. The time now is 01:58 AM.