Click to See Complete Forum and Search --> : How can i get the boot loader back


TMD
08-11-2001, 06:21 AM
I have winMe on one hdd and mandrake 8 on another. Yesterday i had to re-install ME and so it overwrote GRUB in the MBR...is there anyway to get the bootloader back without having to re-install again. If so does it involve a bootdisk and if so again which type and which image should i use to make it in mandrake. TIA

TMD

Disciple
08-11-2001, 09:31 AM
TMD, I imagine that if you go to www.tucows.com (http://www.tucows.com) and do a search for Grub under the linux section that it will give you an .rpm package that is to date and you can just reinstall it. Not sure if you know or not, but just do a

rpm -Fvh Grub-x.x.i386.rpm or
rpm -i Grub-x.x.i386.rpm

Hope this helped D|s

7
08-11-2001, 09:55 AM
I think he means is there anyway to get his MBR back without re-installing Disciple.

Yes there is. Theres never a need to completly re-install, just fix the bit that goofed. (Unless you've been hacked. Then you reinstall)

Your going to have to do some reading TMD.

Read (http://www.linuxdoc.org/HOWTO/mini/Multiboot-with-GRUB.html) this on how to use grub. Ive never used grub so I can't write a step by step, do everything for you post (sorry, im just getting tired of making millions of links to linuxdoc.org).

Use a pair of boot/root floppys (look at my posts (http://www.linuxnewbie.org/cgi-bin/ubbcgi/ultimatebb.cgi?ubb=get_topic&f=2&t=006042)) to boot into linux. mount your / filesystem. Use your new grub information to repair/install the MBR.

Post back if have any troubles.

[ 11 August 2001: Message edited by: 7 ]

bdg1983
08-11-2001, 11:17 AM
This is from Caldera though it should work for you.

What you will need to do is boot off of the cdrom or floppy to the cdrom like you are doing an install. When you get to the language screen hit <ctrl><F2> and login as "root". This will take you to a prompt.
If you know which partition on the drive you linux is on you can jump to Reinstalling Grub other wise follow the steps below to find out which partition your linux is on.

Find Linux Partition:
At the # type "fdisk". This will default to your first hard drive. If you have two and linux is on the second then type "fdisk /dev/hdb". A prompt will appear that say "Command (m for help):". At this prompt hit "p" and it will show you all the partitions on the drive. Look for the one that has an Id of 83. You will need to know what the device for that partition. Once you have this type "q" at the command prompt at the bottom and move to the next section.

Reinstalling Grub:
First we are going to mount the partition to the floppy mount point. This will allow us to access the drive. At the prompt you will need to type the following replacing the ** with the appropriate information.
mount /dev/hd** /mnt/floppy
This will mount that partition to the floppy mount point. now you will need to change the /usr/sbin directory on the drive. To do this type:
cd /mnt/floppy/usr/sbin/
This will put you in that directory. Now you will need to run the grub script again and reinstall grub. This gives an example of a simple reinstall for the purposes of recovering from this error. If you have more questions about what can be done here then check out the Zen the Art of Grub in our knowledge base. The link is at the bottom of this faq. To start grub type "./grub" at the prompt. This will bring you to a grub>. Now you are in the grub shell and can setup your boot loader again. The first thing that you will want to do it start by specifing the root partition:
grub> root (hd
If you hit the <Tab> here it will show you all parititions or just finish it for you if you only have one.
grub> root (hd0,
Hit the <Tab> now it will show you all the partitions on the drive again. You will need to put the number in here for your boot partition. If you do not have a boot partition then you put the number of your main linux partition(Id of 83).
grub> root (hd0,2)
Then hit enter and it should out put the following: Filesystem type is ext2fs, partition type 0x83. Now you will need to write grub to the mbr again. To do this type:
grub> setup (hd0)
This will write to the mbr adn output and install line in "". You will need to run the install command and add the location of your menu.lst file. To do this type the install line inside the "" and then put a space and /boot/grub/menu.lst. It should look like this:
grub> install..... /boot/grub/menu.lst
This will complete the grub install so type "quit" at the next prompt and it will return you to the # again. Now we need to umount and reboot. Run the following commands and on reboot removethe cdrom.
#cd
#umount /dev/floppy
#reboot

Now remove the cd and it will come to the normal grub boot screen again.

TMD
08-12-2001, 04:29 AM
Originally posted by mdwatts the 3rd:
<STRONG>This is from Caldera though it should work for you.

What you will need to do is boot off of the cdrom or floppy to the cdrom like you are doing an install. When you get to the language screen hit &lt;ctrl&gt;&lt;F2&gt; and login as "root". This will take you to a prompt.
If you know which partition on the drive you linux is on you can jump to Reinstalling Grub other wise follow the steps below to find out which partition your linux is on.

Find Linux Partition:
At the # type "fdisk". This will default to your first hard drive. If you have two and linux is on the second then type "fdisk /dev/hdb". A prompt will appear that say "Command (m for help):". At this prompt hit "p" and it will show you all the partitions on the drive. Look for the one that has an Id of 83. You will need to know what the device for that partition. Once you have this type "q" at the command prompt at the bottom and move to the next section.

Reinstalling Grub:
First we are going to mount the partition to the floppy mount point. This will allow us to access the drive. At the prompt you will need to type the following replacing the ** with the appropriate information.
mount /dev/hd** /mnt/floppy
This will mount that partition to the floppy mount point. now you will need to change the /usr/sbin directory on the drive. To do this type:
cd /mnt/floppy/usr/sbin/
This will put you in that directory. Now you will need to run the grub script again and reinstall grub. This gives an example of a simple reinstall for the purposes of recovering from this error. If you have more questions about what can be done here then check out the Zen the Art of Grub in our knowledge base. The link is at the bottom of this faq. To start grub type "./grub" at the prompt. This will bring you to a grub&gt;. Now you are in the grub shell and can setup your boot loader again. The first thing that you will want to do it start by specifing the root partition:
grub&gt; root (hd
If you hit the &lt;Tab&gt; here it will show you all parititions or just finish it for you if you only have one.
grub&gt; root (hd0,
Hit the &lt;Tab&gt; now it will show you all the partitions on the drive again. You will need to put the number in here for your boot partition. If you do not have a boot partition then you put the number of your main linux partition(Id of 83).
grub&gt; root (hd0,2)
Then hit enter and it should out put the following: Filesystem type is ext2fs, partition type 0x83. Now you will need to write grub to the mbr again. To do this type:
grub&gt; setup (hd0)
This will write to the mbr adn output and install line in "". You will need to run the install command and add the location of your menu.lst file. To do this type the install line inside the "" and then put a space and /boot/grub/menu.lst. It should look like this:
grub&gt; install..... /boot/grub/menu.lst
This will complete the grub install so type "quit" at the next prompt and it will return you to the # again. Now we need to umount and reboot. Run the following commands and on reboot removethe cdrom.
#cd
#umount /dev/floppy
#reboot

Now remove the cd and it will come to the normal grub boot screen again.
</STRONG>

I think that will work...but te first bit doesn't work for mandrake. How do i get to that prompt and login as root?? Thanks everyone for the help

bdg1983
08-12-2001, 05:06 AM
Though I'm not a Mandrake user, you should be able to boot from the install CD and when it gets to the first panel, enter ctrl-alt-F1 or F2 to get a console. Login as root and then mount your Linux root/boot partition as rw.

You could also create a bootdisk from files on the install CD. Look in the ?? dosutils directory or something similiar and you should find some .img files and the rawrite dos utility. The readme should tell you exactly how to create the disk.

I would imagine www.linux-mandrake.com (http://www.linux-mandrake.com) would have more on the subject of recovering from this type of problems.