Welcome to Linux Forums!

With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.

Linux Forum ArticlesLinux ForumsLinux Forum DownloadsLinux HostsFree MagazinesJobs
Home|Register|FAQ|Member List|Calendar|Unanswered Posts|Forum Rules|Today's Posts|Advanced Search|
SEARCH FOR IN
Go Back   Linux Forums > Your Distro > Debian Linux Help
Reload this Page How can I boot Debian Linux after have installed Windows? Or: how to restore GRUB?
Linux Forums
Linux Forums
Welcome To The Linux Forums!
Welcome to Linux Forums. We pride ourselves in being one of the largest Linux communities on the web, we encourage you to REGISTER on our forums and participate in the community. There are over 150,000 members ready to answer your questions. JOINING US today will allow you to make new posts, get support, send messages to other members and submit downloads to our downloads directory and many other great features!

Debian Linux Help Discussions related to Debian GNU/Linux.

Reply
 
Thread Tools Display Modes
Old 02-10-2006   #1 (permalink)
Linux Newbie
 
Daan's Avatar
 
Join Date: Aug 2005
Location: Amsterdam, The Netherlands
Posts: 184
Question How can I boot Debian Linux after have installed Windows? Or: how to restore GRUB?

Hi. I have a Debian installation on my desktop PC, but after installing Windows XP Pro on an other partition, there's no option at boot up anymore to boot the Debian Linux OS: the GRUB menu is gone and my system goes strait into Windows.

How can I restore the GRUB menu? Or just reinstall it?

When I boot up from the Debian installation CD there's an option to install the GRUB boot loader, but when I try to do that, I go to the partitioning section first. My guess is that I have to set a bootable flag or something first before I can install GRUB. Am I right? Would setting the bootable flag on what was my / (root) partition anable me to install a nice GRUB that lets me choose between Debian and Windows?

Thanks,

Daan
Daan is offline   Reply With Quote
Old 02-10-2006   #2 (permalink)
Just Joined!
 
tb10alj's Avatar
 
Join Date: Feb 2006
Location: Germany
Posts: 31
Hi,

the windoze installation has overwritten your MBR.
An easy way to restore GRUB is to boot from a LiveCD (for example KNOPPIX).

Boot from a LiveCD and mount the partition which contains the boot directory
of your Debian system (i.e. to /mnt/target)

Edit /mnt/target/boot/grub/menu.lst and add an entry for your Windows
installation.

Code:
title Windows XP
  # Adjust the root entry for your system!!!!!
  # (hd0,1) is the second partition of the primary master
  root            (hd0,1)
  makeactive
  chainloader     +1
  boot
Type grub to get a GRUB shell. In the GRUB shell, you should first run
the root command, to tell GRUB where to find the necessary files:
Code:
root (hd0,0)
(hd0,0) stands for hda1. If your are not sure, which partition you should
enter here, you can figure it out with:
Code:
find /boot/grub/stage1
To install GRUB in the MBR of the first drive enter:
Code:
setup (hd0)
Now type quit, reboot your system and cross your fingers

Cheers
JAN
__________________
"Linux is like a wigwam. No windows, no gates and an apache inside."
tb10alj is offline   Reply With Quote
Old 02-10-2006   #3 (permalink)
Linux Newbie
 
Daan's Avatar
 
Join Date: Aug 2005
Location: Amsterdam, The Netherlands
Posts: 184
Thanks Jan!

I did as you told me and as soon as found out that I had to run the grub command as root, it was really easy. (You can run grub as a normal user, but than it will nor respond as you said it would).

Thanks again,

Daan
Daan is offline   Reply With Quote
Old 01-13-2007   #4 (permalink)
Just Joined!
 
Join Date: Dec 2006
Posts: 8
GRUB Loading stage.1.5

I did what Jan said, but when I boot I get the following message:
Code:
GRUB Loading stage.1.5
(with a bunch of strange signs after it)

Can anyone please tell me what to do. This is really working on my nervs now.

Thank you.
LonelyTraveler is offline   Reply With Quote
Old 01-13-2007   #5 (permalink)
Super Moderator
 
devils casper's Avatar
 
Join Date: Jun 2006
Location: Chandigarh, INDIA
Posts: 18,411
please provide a little more details. which distro? is there any other OS installed in Harddisk? how many harddisks do you have? is it a fresh install?







Casper
__________________
New Users: Read This First


devils casper is offline   Reply With Quote
Old 01-13-2007   #6 (permalink)
Just Joined!
 
craigevil's Avatar
 
Join Date: Jun 2005
Location: Terra in the Milky Way
Posts: 88
Send a message via MSN to craigevil Send a message via Yahoo to craigevil
Here are a couple ways of doing it and hopefully one of them will work for you:

Boot with a Knoppix CD (or some other live-cd), or use a rescue/boot floppy like Tomsrtbt ( http://www.toms.net/rb/ ); determine your root partition and mount it to a temporary mount point; then chroot into it; then reinstall GRUB:

sudo mkdir /mnt/temp

sudo mount /dev/hda1 /mnt/temp
(change /dev/hda1 to match your own root partition)

sudo chroot /mnt/temp

sudo grub-install /dev/hda

or...

determine your root partition, then mount it "dev" option enabled with write permissions. If the filesystem isn't mounted you'll need to mount it like this (be sure to change "hda1" and "hda" to match the location/device in your own system):

sudo mount -o dev,rw /mnt/hda1

if it's already mounted, remount it like this:

sudo mount -o remount,dev,rw /mnt/hda1

now restore grub like this:

sudo chroot /mnt/hda1 grub-install /dev/hda

if it doesn't work using chroot, try remounting as outlined above and do:

sudo grub-install -root-directory=/mnt/hda1 /dev/hda

Kanotix has an option to "Restore Grub", simply boot with the livecd and choose restore grub.
craigevil is offline   Reply With Quote
Old 01-13-2007   #7 (permalink)
Just Joined!
 
Join Date: Dec 2006
Posts: 8
Quote:
Originally Posted by devils_casper
please provide a little more details. which distro? is there any other OS installed in Harddisk? how many harddisks do you have? is it a fresh install?
Thanks for the reply. I'm running Debian Sarge and a installation is a few weeks old. I installed Windozs last night witch ate my GRUB!!! I have one hard disk with two partitions. Linux is on the first partition.
LonelyTraveler is offline   Reply With Quote
Old 01-13-2007   #8 (permalink)
Super Moderator
 
devils casper's Avatar
 
Join Date: Jun 2006
Location: Chandigarh, INDIA
Posts: 18,411
boot up from Debian installation CD and type 'boot=/dev/hda1' at prompt. Debian will boot up. execute 'grub-install /dev/hda' in konsole to reinstall GRUB.






Casper
__________________
New Users: Read This First


devils casper is offline   Reply With Quote
Old 01-13-2007   #9 (permalink)
Just Joined!
 
Join Date: Dec 2006
Posts: 8
Thank you both so much for your help! Its working now! I did what Craigevil said (the first way) and it worked. I used some other tutorials before posting here, but it didn't want to work. So... Great job Craig!
LonelyTraveler is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Free Magazines
Cisco News
Receive a free quarterly e-newsletter with exclusive articles on how Cisco IT uses its own products and solutions to enable the business.
subscribe
Systems Management News, the newspaper for IT systems administration and data center managers!
Each issue of Systems Management News is chock-full of news and analysis to help you understand what's happening in your field.
subscribe
The Enterprise Newsweekly
eWeek is the essential technology information source for builders of e-business.
subscribe
Oracle Magazine
Oracle Magazine contains technology strategy articles, sample code, tips, Oracle and partner news, how to articles for developers and DBAs, and more. Oracle (NASDAQ: ORCL) is the world's largest enterprise software company.
subscribe
Total Telecom
Total Telecom is "The Economist of the communications industry".
subscribe
More free magazines »



All times are GMT. The time now is 09:01 AM.




© 2000 - 2008 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.2.0