LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 10-04-2006, 07:24 AM   #1
cmur8594
LQ Newbie
 
Registered: Sep 2006
Posts: 3

Rep: Reputation: 0
lost the bootloader program when i reinstalled windows


hi

i had linux mepis installed on a partition on my hard drive and i had a bootloader program to select which os to use. however when i reinstalled windows onto the windows partition i can no longer access linuxbecause windows automatically loads without showing the bootloader program. does anyone know how to fix this? do i need to install a new loader program on my windows partition?

thanks
 
Old 10-04-2006, 12:14 PM   #2
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 332Reputation: 332Reputation: 332Reputation: 332
You can get back your grub or lilo boot loader as follows. I'll use grub as the example. First boot a linux live CD. Any distribution will do. Then log on as root. If your live CD does not allow you to log on as root but does allow you to do sudo then enter this command as a normal user.
Code:
sudo su -
If that doesn't work then try this.
Code:
sudo /bin/bash
If that doesn't work then you can't do the rest of what I'm going to write. Once you are logged on as root then do this. I'm going to say that Windows is installed on /dev/hda1 and that Linux is installed on /dev/hdb1. That really only affects the mount command in the following instructions. Substitute your own configuration.
Code:
mkdir /mnt/tmp
mount /dev/hdb1 /mnt/tmp
mount --bind /dev /mnt/tmp/dev
mount --bind /proc /mnt/tmp/proc
chroot /mnt/tmp /bin/bash
grub-install /dev/hda
exit
Then reboot the computer and remove the CD from the drive before the computer uses it to restart. I find it helpful to press the <Del> key while the computer is doing its BIOS configuration. That wil get you into the BIOS setup and allow you the time to remove the CD. Then just exit out of the BIOS setup.
 
Old 10-07-2006, 02:10 PM   #3
sadiqdm
Member
 
Registered: Nov 2003
Location: London, UK
Distribution: openSUSE, Ubuntu
Posts: 358

Rep: Reputation: 35
I've got the same problem. Dual boot Win 98SE & Suse 10.1. The Win 98 has a startup problem, and while trying to fix it I've overwritten the MBR and now can't get to GRUB.

I tried your instructions, but can't make the /mnt/tmp as the partition is mounted RO. I can't find my notes on how to remount the partition as RW.
 
Old 10-07-2006, 02:25 PM   #4
sadiqdm
Member
 
Registered: Nov 2003
Location: London, UK
Distribution: openSUSE, Ubuntu
Posts: 358

Rep: Reputation: 35
Found a work around.

I used Disk 1 of my 5 disk install set for Suse 10.1, and selected Rescue from the boot menu.

My Linux root partition is /dev/hda3, so I replaced /mnt/tmp with /tmp/hda3 thus:

Code:
mkdir /tmp/hda3
mount /dev/hda3 /tmp/hda3
mount --bind /dev /tmp/hda3/dev
mount --bind /proc /tmp/hda3/proc
chroot /tmp/hda3 /bin/bash
grub-install /dev/hda
exit
Rebooted and it all came good. The Windows problem is that a crash has broken explorer.exe which is the GUI as well as the core of IE and the File Manager. This means that you can't get to anything. Not even a command line! Hopeless. It's my Mums computer, and I am trying to migrate her e-mail from Outlook Express to Thunderbird. May have to just back up the data in Linux and reformat the Win98 partition to do a clean install.
 
Old 10-07-2006, 02:47 PM   #5
nexuiz
LQ Newbie
 
Registered: Aug 2006
Posts: 9

Rep: Reputation: 0
i installed 2 times windows today.any ideas for slackware?i use a floppy to boot.
 
Old 10-09-2006, 05:47 AM   #6
sadiqdm
Member
 
Registered: Nov 2003
Location: London, UK
Distribution: openSUSE, Ubuntu
Posts: 358

Rep: Reputation: 35
recovering linux boot loader

nexuiz wrote:
Quote:
Originally Posted by nexuiz
i installed 2 times windows today.any ideas for slackware?i use a floppy to boot.
I haven't had to do this with Slackware for some time, but I think the same process will work, if you can boot from a floppy or a CD. I have a utility cd made with RIP (Recovery Is Possible) that has done the trick in the past. Have a look here for a complete set of tools - http://www.tux.org/pub/people/kent-r...looplinux/rip/

Boot your system from the floppy or cd. Then do
Quote:
ls -l /dev/hd*
to identify all your mountable partitions. I found I couldn't make a new directory in /mnt so I put it in /tmp, but otherwise the instructions in the post from stress_junkie should work in any distro. Booting from a rescue disk should make you root so you won't need to use sudo or su

If your using LILO, then I think you just find the correct partition to mount, find the directory with LILO, usually /sbin though I think some distros are now putting GRUB and LILO in /boot. Then cd to it and type lilo at the prompt. You should get a short list of bootable OS's. Reboot and it should all come back.

I've had to do something like this everytime I did any repairs to Windows, but this was the first time for over a year, and I had forgotten how to do it!

Good luck.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
**Reinstalled, need to recover lost files aspinnler Ubuntu 6 02-08-2006 06:48 PM
dual boot info lost after reinstalled win2k chrislee8 Linux - Software 4 10-22-2004 10:55 PM
I've reinstalled windows and lost mdk 9.2 on my PC lumikko Linux - General 6 03-12-2004 04:50 PM
reinstalled windows 98 lost debian boot option llefty Linux - Newbie 5 08-01-2003 10:03 AM
Reinstalled Windows 98 lost linux dual boot llefty Linux - Newbie 0 08-01-2003 01:23 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration