LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 03-02-2010, 03:28 PM   #1
greenknight
Member
 
Registered: Dec 2009
Posts: 73

Rep: Reputation: 15
lost grub


Today I was forced to reformat windoze and of course lost grub so I can't boot ubuntu 9.10. I found two suggestions in previous posts which didn't work. One suggested using the install disk as a rescue disk and as root run grub. I entered sudo grub and the cmd was accepted but the cmnd grub was not found.
The second was to sudo grub -install and again grub was not found. Both these suggestions were for a win 98/mandrake installation.
Do I have to reinstall ubuntu? If so there is a problem in partitioning. Setup sees there is already an ubuntu os on the disk. In fact two of them. I forget why, but I reinstalled ubuntu and ended up with two in the grub menu. I was advised not to try to repair grub and didn't. Now I have two and it thinks I want to put the third one side by side, or erase and use the entire disk. There was a third choice but I forgot already exactly what it was and didn't like it anyway. If I erase and use the entire disk, won't I lose windoze? If I put them side by side I will then have three which which will waste disc space. The discs aren't that big being only about 10gb. I don't think I want to waste the space with a third ubuntu.


ps The prompt in terminal was ubuntu @ ubuntu.

Last edited by greenknight; 03-02-2010 at 03:32 PM.
 
Old 03-02-2010, 03:40 PM   #2
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 248Reputation: 248Reputation: 248
Use the rescue disk, you don't need sudo if you are already root.
 
Old 03-02-2010, 03:47 PM   #3
raju.mopidevi
Senior Member
 
Registered: Jan 2009
Location: vijayawada, India
Distribution: openSUSE 11.2, Ubuntu 9.0.4
Posts: 1,155
Blog Entries: 12

Rep: Reputation: 92
* You can try re-installing the grub using the Ubuntu Live CD, in two different ways.

GUI

1. Boot your computer up with Ubuntu CD
2. Go through all the process until you reach "[!!!] Disk Partition"
3. Select Manual Partition
4. Mount your appropriate linux partions / /boot swap .....
5. DO NOT FORMAT THEM.
6. Finish the manual partition
7. Say "Yes" when it asks you to save the changes
8. It will give you errors saying that "the system couldn't install ....." after that
9. Ignore them, keep select "continue" until you get back to the Ubuntu installation menu
10. Jump to "Install Grub ...."
11. Once it is finished, just restart your computer

Command line

1. Boot your computer up with Ubuntu CD
2. Open a terminal window or switch to a tty.
3. Go SuperUser (that is, type "sudo -s"). Enter root passwords as necessary.
4. Type "grub"
5. Type "find /boot/grub/stage1". You'll get a response like "(hd0,1)". Use whatever your computer spits out for the following lines.
6. Type "root (hd0,1)", or whatever your hard disk + boot partition numbers are for Ubuntu.
7. Type "setup (hd0)", to install GRUB to MBR, or "setup (hd0,1)" or whatever your hard disk + partition nr is, to install GRUB to a partition.
8. Quit grub by typing "quit".
9. Reboot and remove the bootable CD.

IconsPage/IconNote.png If you can't boot into any of your Linux OSs:
First, you need to get a grub prompt (grub>) somehow. So what you can do is:

* Use a rescue disk, like Super Grub Disk, from which you can boot into your OS, or press the “c” key to get a GRUB prompt.
* Use your Live *ubuntu CD. Boot into the LiveCD. Now get a terminal and proceed exactly as in Case 1, starting with sudo grub to get a GRUB prompt. Note: grub is not included with 9.10 Ubuntu LiveCD
 
Old 03-02-2010, 07:02 PM   #4
greenknight
Member
 
Registered: Dec 2009
Posts: 73

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by smoker View Post
Use the rescue disk, you don't need sudo if you are already root.
Will try in morning. I questioned wether I was root because the prompt didn't mention it. Maybe it is a thing with the rescue disk.
There is so much to learn with this linux, but I am enjoying it more each day. Glad qa is here.
 
Old 03-02-2010, 07:22 PM   #5
cmdln
Member
 
Registered: Apr 2009
Location: Lawrence, KS
Distribution: Debian, Centos
Posts: 102
Blog Entries: 1

Rep: Reputation: 24
When You use sudo it was using your PATH. Without looking I suspect grub is in /use/sbin or /sbin. You could use sudo and specify the full path to grub.
 
Old 03-02-2010, 08:29 PM   #6
smoker
Senior Member
 
Registered: Oct 2004
Distribution: Fedora Core 4, 12, 13, 14, 15, 17
Posts: 2,279

Rep: Reputation: 248Reputation: 248Reputation: 248
AFAIK the rescue mode when booting off the disk gives you a single user environment - i.e. root.
You don't need sudo.
 
Old 03-03-2010, 10:58 AM   #7
jallan6977
LQ Newbie
 
Registered: Nov 2006
Location: whitnet point ny.
Distribution: ubuntu 6.06 lts
Posts: 10

Rep: Reputation: 0
I was following the first procedure to go to the partition manager and found this after selecting the manual partitioning. It looks a hell of a lot like my current setup. Is there a way select to use it and not check any formatting options. Even if I need to copy it it would be easier than me trying to mount partitions because I am definitely not at all familiar with Linux partitioning. I barely know how to do it in windows.

type format
/dev/sda
/dev/sda1 ntfs y/n
/dev/sda5 ext4 "
/dev/sda6 ext4 "
/dev/sda7 swap "
/dev/sda8 swap "
/dev/sdb
/dev/sdb1 ext4 "
/dev/sdb5 swap "


Quote:
Originally Posted by raju.mopidevi View Post
* You can try re-installing the grub using the Ubuntu Live CD, in two different ways.

GUI

1. Boot your computer up with Ubuntu CD
2. Go through all the process until you reach "[!!!] Disk Partition"
3. Select Manual Partition
4. Mount your appropriate linux partions / /boot swap .....
5. DO NOT FORMAT THEM.
6. Finish the manual partition
7. Say "Yes" when it asks you to save the changes
8. It will give you errors saying that "the system couldn't install ....." after that
9. Ignore them, keep select "continue" until you get back to the Ubuntu installation menu
10. Jump to "Install Grub ...."
11. Once it is finished, just restart your computer

Command line

1. Boot your computer up with Ubuntu CD
2. Open a terminal window or switch to a tty.
3. Go SuperUser (that is, type "sudo -s"). Enter root passwords as necessary.
4. Type "grub"
5. Type "find /boot/grub/stage1". You'll get a response like "(hd0,1)". Use whatever your computer spits out for the following lines.
6. Type "root (hd0,1)", or whatever your hard disk + boot partition numbers are for Ubuntu.
7. Type "setup (hd0)", to install GRUB to MBR, or "setup (hd0,1)" or whatever your hard disk + partition nr is, to install GRUB to a partition.
8. Quit grub by typing "quit".
9. Reboot and remove the bootable CD.

IconsPage/IconNote.png If you can't boot into any of your Linux OSs:
First, you need to get a grub prompt (grub>) somehow. So what you can do is:

* Use a rescue disk, like Super Grub Disk, from which you can boot into your OS, or press the c key to get a GRUB prompt.
* Use your Live *ubuntu CD. Boot into the LiveCD. Now get a terminal and proceed exactly as in Case 1, starting with sudo grub to get a GRUB prompt. Note: grub is not included with 9.10 Ubuntu LiveCD
 
  


Reply

Tags
grub, lost


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
lost grub menu rf_ccr Ubuntu 1 06-19-2007 02:50 PM
Lost XP in Grub gdeshazo Linux - Newbie 4 04-23-2006 01:57 PM
Grub lost - FC3 / XP ssrini Fedora - Installation 2 06-21-2005 11:41 PM
Lost Grub Linux_Moose Linux - Newbie 2 08-10-2002 05:12 PM
Lost GRUB lhoff Linux - Newbie 2 08-03-2001 09:21 AM


All times are GMT -5. The time now is 05:32 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