PDA

View Full Version : Reinstalling GRUB for multi-partition dead redhat 9



Ross Clement
10-24-2003, 11:13 AM
Hi. I'm trying to work my way through the FAQ so that I can fix my dead redhat 9 installation. At present, Grub has died (I edited grub.conf, and even replacing it with a known working file from another machine does not fix things. The computer boots, prints the word GRUB and freezes.

The problem I have is that I have my /boot directory in a partition by itself. Upon booting knoppix, I have two hd partitions, hda1 and hda2. hda1 is the contents of the boot directory.

Just trying to run "grub-install /dev/hda" under knoppix just gives me the error message "read only file system". This is even though I can edit files on the disks.

Would it be possible for me to mount both partitions back into their original structure. E.g.

mount -o dev /dev/hda2 /mnt/hda2
mount -o dev /dev/hda1 /mnt/hda2/boot
chroot /mnt/hda2

This should, I hope, give me a writeable version of my original system. I then (I hope) would then be able to

grub-install

(with no arguments) to rebuild my grub partition.

Should this work? As this is our only internet computer at home, I'm now remarkably unpopular. But, I'm also leaving the country for a week on saturday, and if I leave no working computer, I'm likely to be even less popular.

I've read the knoppix faq, but if anyone knows any other resources I should read, I'd like to know about them. And, I'd appreciate any advice that anyone has to offer. Note: this is not actually a multi-boot computer. It only runs redhat 9. So, any solution does not have to result in grub working, providing that the computer will boot.

Thanks in anticipation,

Ross Clement.

baldyeti
10-24-2003, 01:23 PM
Hi; I don't use grub myself, but I should be able to help you with lilo.
My understanding is that you have a small FS hda1 mounted as /boot,
and root (/) is hda2; is this correct? no swap?

Check whether you have a lilo.conf file under /etc. Probably not, since
you were using grub. If not, the following should get you started. You
should carefully check that all referenced files do exist on *your* system.
Please post the content of /boot (the output of 'ls -la'), then ask for
further guidance if you're not familiar with lilo.

lba32
boot=/dev/hda1
root=/dev/hda2
install=/boot/boot-menu.b
map=/boot/map

image=/boot/vmlinuz
[list:a2428bbd17] label=linux
initrd=/boot/initrd
read-only
[/list:u:a2428bbd17]

Ross Clement
10-24-2003, 04:08 PM
Thanks for the reply. I assume that once I've created the lilo.conf file, I just run lilo to set up the boot loader.

I do have a swap partition, which Knoppix finds and makes use of. I can't remember where it is, but my two partitions for / and /boot are hda1, and hda2, so swap must be there somewhere.

I've just printed out some lilo configuration pages. I note that, as with your example, they say where to install the boot record. This is something that confused me with grub, so perhaps lilo's the best option for now.

Cheers,

Ross-c

baldyeti
10-24-2003, 05:48 PM
Thanks for the reply. I assume that once I've created the lilo.conf file,
I just run lilo to set up the boot loader.

Before you blindly adopt my example, make sure all files it mentions
(under /boot) make sense in your case. Once you've booted with the
knoppix cd, mount /dev/hda2 onto eg /tmp/redhat, then /dev/hda1
onto /tmp/redhat/boot. Then do 'lilo -r /tmp/redhat' and pay attention
to possible errors. If this works, run cfdisk and make sure your boot
partition (hda1) is the one marked active. You should then be set!

nuke
10-24-2003, 08:18 PM
Ross, I have been struggling with Grub also and made some progress with a dual boot system after reading the following article. It may give you some hints.

http://www.linuxjournal.com/print.php?sid=4622

It is a somewhat dated artile called "Boot with GRUB", May 1, 2001 by Wayne Marshall.

I found a lot of value in learning how to create a Grub boot floppy.

Ross Clement
10-25-2003, 01:23 AM
Thanks for your replies on this thread. I decided to go the lilo route, and the result is
that I am posting this message from my previously unbootable machine.

I will read the grub article however, as I'd like to be able to reinstall both lilo and grub in the future. I didn't even know that it was possible to create a grub boot floppy, so clearly I still have lots to learn.

Cheers,

Ross-c

senorian
10-25-2003, 04:47 PM
from article called "boot with grub"

The floppy can then be unmounted, umount /floppy, but leave it in the drive. The GRUB floppy is prepared and ready for the final installation, which is to install the GRUB boot loader in the MBR of the floppy itself. For that, we will use the grub executable we have built with our Linux installation. Start the executable at the Linux command prompt: grub.

This brings up an emulator of GRUB's command shell environment, which looks like Figure 1. We will discuss the features of this shell in more detail a little further on. For now, enter the following series of commands at the grub prompt:


grub> root (fd0)
grub> setup (fd0)
grub> quit

And that's it! This sequence of commands completes the installation of GRUB on the floppy disk. It is now bootable and will allow us to boot any other OS on our system.

My question:
If we have umount the floppy how do the commands "root (fdo)", "setup (fdo)" get written to the floppy?

hendry
10-26-2003, 07:23 AM
A couple of days ago I had a VERY frustrating time with Knoppix.

I was trying to fix GRUB, but I kept on getting a "read only file system" error.
Something I was surprised to see as root.

From http://www.knoppix.net/docs/index.php/FaqRescue

I see maybe it needed to be remounted:


"mount -o dev /mnt/hda1", if its already mounted, you'll have to clear the "nodev" flag: "sudo mount -o remount,dev /mnt/hda1"


All the same. My internet connection was down with the unbootable machine. So how was I am going to get that info?

In the end I fixed the problem with a Debian Woody bootdisk. You see Debian bootdisk has a rescue option. And this is what I would love to see on Knoppix.

A cheatcode/option for a :

RESCUE MODE

http://www.knoppix.net/docs/index.php/CheatCodes

please and thank you for your time