LinuxQuestions.org
Help answer threads with 0 replies.
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 03-21-2009, 10:35 AM   #1
ahmed_as8
Member
 
Registered: Nov 2008
Location: Egypt
Distribution: Ubuntu, SuSE
Posts: 101

Rep: Reputation: 16
Installing Ubuntu boot loader


Hi all I was using Dual boot Ubuntu 8.10 & Windows Vista .. I recently upgraded the Vista to Windows 7 so the partition C was formatted so I can't see the Ubuntu partition.. Is their a way to install the boot loader again without installing the whole Linux system another time?? .. Thanks.
 
Old 03-21-2009, 10:46 AM   #2
serafean
Member
 
Registered: Mar 2006
Location: Czech Republic
Distribution: Gentoo, Chakra
Posts: 871
Blog Entries: 9

Rep: Reputation: 103Reputation: 103
Fire up any LiveCD, mount your ubuntu partition (if you have a separate boot, then it too). run "chroot /mount/point /bin/bash" , you should then be in your ubuntu installed system. from there its the simple matter of running grub-install.
It might be worthwhile to check if the ubuntu liveCD doesn't have an option such as 'repair'...

Serafean
 
Old 03-21-2009, 06:08 PM   #3
ahmed_as8
Member
 
Registered: Nov 2008
Location: Egypt
Distribution: Ubuntu, SuSE
Posts: 101

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by serafean View Post
Fire up any LiveCD, mount your ubuntu partition (if you have a separate boot, then it too). run "chroot /mount/point /bin/bash" , you should then be in your ubuntu installed system. from there its the simple matter of running grub-install.
It might be worthwhile to check if the ubuntu liveCD doesn't have an option such as 'repair'...

Serafean
1st of all thanks .. 2nd I did what u said .. I ran the Ubuntu 8.10 live CD then I mounted the partition of the Ubuntu file system then I copied the command u gave me in the run terminal .. the I pressed run but nothing happened .. even when I restarted the PC it loaded the Windows automatically .. is their is a misunderstanding from me? Thanks.
 
Old 03-21-2009, 10:17 PM   #4
yancek
Senior Member
 
Registered: Apr 2008
Distribution: PCLinux, Ubuntu, Slackware
Posts: 4,973

Rep: Reputation: 785Reputation: 785Reputation: 785Reputation: 785Reputation: 785Reputation: 785Reputation: 785
You should be able to boot up your Ubuntu Live CD (or installation disk), got to a terminal, login as root (sudo), go to a Grub prompt (grub>) and enter the following:

root (hd?,?)
setup (hd?)
quit

The questions marks would be replaced by the drive and partition number where you have Ubuntu boot files and the master boot record of the drive you want to boot from. If you want specific info, run command: sudo fdisk -l and post the output.
 
Old 03-22-2009, 02:37 AM   #5
ahmed_as8
Member
 
Registered: Nov 2008
Location: Egypt
Distribution: Ubuntu, SuSE
Posts: 101

Original Poster
Rep: Reputation: 16
Thanks all I didt it this way:

sudo grub


find /boot/grub/stage1


root (hd?,?)


setup (hd0)


quit
 
Old 03-28-2009, 08:20 AM   #6
change_my_way2010
LQ Newbie
 
Registered: Jan 2008
Posts: 10

Rep: Reputation: 0
Unhappy

I have the same problem,I used Live CD (Ubuntu 8.10) log on to the screen, and I type in the terminal:
sudo grub
grub>find /boot/grub/stage1
then the terminal return: hd0,2
but when I type: root(hd0,2)
the terminal return : Unrecoganized command.
Please help me!I can't solve this problem and I feel so bad.Thanks!
 
Old 03-28-2009, 09:14 AM   #7
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: /root
Distribution: Slackware & BSD
Posts: 1,218

Rep: Reputation: 231Reputation: 231Reputation: 231
ahmed_as8:

It appears that your Ubuntu system in its partition remains good as it was. Only the MBR was overwritten by your Windows 7 installation. Now you need to reinstall grub for dual booting? Grub can do it.

Do as Serafean hinted you above: boot by live cd, mount the ubuntu partition and chroot into it. Now you can issue commands to fix grub.

Try this, after chrooted into the ubuntu system:

sudo grub-install /dev/your_hardisk_drive

<don't specify # of partition so that grub writes a new image into the mbr>

Reboot into Ubuntu, then issue this on the terminal---

sudo gedit /boot/grub/menu.lst

and enter this into the debian automagic kernels list:

title Windows 7
root (hd0,0) <-edit this according to your drive)
makeactive
chainloader +1

Save menu.lst and quit.

Reboot. You should have choices now for your Windows and Linux system at the grub boot prompt.

Goodluck.

Hope this helps.
 
Old 03-28-2009, 09:27 AM   #8
malekmustaq
Senior Member
 
Registered: Dec 2008
Location: /root
Distribution: Slackware & BSD
Posts: 1,218

Rep: Reputation: 231Reputation: 231Reputation: 231
============
I have the same problem,I used Live CD (Ubuntu 8.10) log on to the screen, and I type in the terminal:
sudo grub
grub>find /boot/grub/stage1
then the terminal return: hd0,2
but when I type: root(hd0,2)
the terminal return : Unrecoganized command.
Please help me!I can't solve this problem and I feel so bad.Thanks!
=============

change_my_way2010:

Unrecognized command because you did not put a "space" between root and (hd0,2). The syntax should look like this:

root (hd0,2)

!not root(hd0,2)

However, what you should aim at the pointer "root" is not the stage 2 file but the "root partition" where your linux or windows kernel is waiting.

Yes you have similar problem with ahmed_as8 but your hdd and partition situation could differ. So if you have time, post here the following:

a) Specify which drive and partition has your Linux and the other has your Windows;
b) State clearly what is the problem and what have you tried done;
c) What you want to happen.

By those information our friends here shall be able to give you enlightened solutions.

We wait.

Hope this helps.
 
Old 03-29-2009, 03:29 AM   #9
ahmed_as8
Member
 
Registered: Nov 2008
Location: Egypt
Distribution: Ubuntu, SuSE
Posts: 101

Original Poster
Rep: Reputation: 16
Yeah I was going to tell you same answer space missing is it solved change_my_way2010??
 
Old 03-29-2009, 07:37 AM   #10
change_my_way2010
LQ Newbie
 
Registered: Jan 2008
Posts: 10

Rep: Reputation: 0
Quote:
malekmustaq wrote
Quote:
Unrecognized command because you did not put a "space" between root and (hd0,2). The syntax should look like this:

root (hd0,2)

!not root(hd0,2)
It's exactly my mistake,thank you very much for your help! Now my Ubuntu works perfectly!Thanks everybody again!
 
  


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
Ubuntu boot loader BACTRATE Ubuntu 9 04-27-2008 09:25 AM
Ubuntu GRUB boot loader SickNick Ubuntu 10 04-06-2007 02:42 PM
Ubuntu installed, but with no boot loader dotancohen Linux - Newbie 4 12-28-2006 07:07 PM
configure ubuntu boot loader japloy Linux - Newbie 5 07-07-2006 10:31 AM


All times are GMT -5. The time now is 12:51 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration