LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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 01-10-2012, 08:43 PM   #1
xstorae
LQ Newbie
 
Registered: Jan 2012
Posts: 9

Rep: Reputation: Disabled
grub prompt at boot - commands don't work


I got a new laptop today, with Windows 7 pre-installed. I've been working for most of the day to dual boot it with Ubuntu, and had a bit of trouble installing GRUB. Eventually, I *think* I got it to install on the partition Ubuntu is on - at least that is what I wanted. But now when when I boot up the computer, it gives me a Grub prompt (after a short intro saying something about how the tab can complete your commands), and I'm at a loss for what to do with it.

To make matters worse, none of the normal grub commands seem to work; it cannot find root or kernel commands, help returns a list of things, help root doesn't return anything, help kernel likewise, and only 'exit' actually seems to work, which just restarts the boot..going back to grub again.

Have I not installed grub correctly? Should I go back to Ubuntu livecd desktop and try something else? Or is it a problem with my recently made partitions?
Thanks for any advice you can offer!
 
Old 01-10-2012, 09:01 PM   #2
TroN-0074
Senior Member
 
Registered: Dec 2011
Location: Michigan USA
Distribution: OpenSUSE 13.2 64bit-Gnome on ASUS U52F
Posts: 1,444

Rep: Reputation: 340Reputation: 340Reputation: 340Reputation: 340
Put the CD back in the computer and boot from it, make sure internet connection is working, open up a terminal and type the following commands (This fix is not going to work if you installed Ubuntu using the WUBI installer pre pack in the disk)

paste this code in terminal
Code:
sudo mkdir /media/root
press enter then paste this other code
Code:
sudo mount /dev/sda1 /media/root
press enter and paste this other code
Code:
sudo grub-install --root-directory=/media/root dev/sda
press enter and that should do

reboot, remove the disk from the tray a post back here how you did with the new OS.
 
Old 01-10-2012, 09:43 PM   #3
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
Quote:
Originally Posted by TroN-0074 View Post
press enter then paste this other code
Code:
sudo mount /dev/sda1 /media/root
reboot, remove the disk from the tray a post back here how you did with the new OS.
Why would he want to mount sda1 when he is dual booting windows?

Here is a good tutorial on grub2

Pay attention to Section 12
 
Old 01-10-2012, 10:33 PM   #4
TroN-0074
Senior Member
 
Registered: Dec 2011
Location: Michigan USA
Distribution: OpenSUSE 13.2 64bit-Gnome on ASUS U52F
Posts: 1,444

Rep: Reputation: 340Reputation: 340Reputation: 340Reputation: 340
To see what partition your ubuntu linux is intalled copy this code in terminal
Code:
sudo fdisk -l
press enter. you will see something like
Code:
Disk /dev/hda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes


Device    Boot               Start                 End                Blocks      Id          System
/dev/sda1                      1                  1224                 64228+     83          Linux
/dev/sda2  *                 1225                 2440                9767520     a5          Windows
/dev/sda3                    2441                14593               97618972+     5          Extended
/dev/sda4                   14532                14593                498015      82        Linuxswap
See in this example you can see the linux partition is actually called sda1 which will be fine with the suggestion in post#2

in your case it might be calle different. Issue the sudo fdisk -l command and check the name of your partition

then you can proceed with the steps in post #2 mounting the right partition.

Good luck

Last edited by TroN-0074; 01-10-2012 at 10:37 PM.
 
Old 01-10-2012, 11:19 PM   #5
xstorae
LQ Newbie
 
Registered: Jan 2012
Posts: 9

Original Poster
Rep: Reputation: Disabled
Thank you, mkdir and mount went fine, but when I entered:

sudo grub-install --root-directory=/media/root dev/sda

it returned:

/usr/sbin/grub-probe: error: cannot stat `dev/sda'.

When making the partitions, every guide I found said to make multiple partitions for ubuntu - for /boot, root, and home. I chose the one I'm pretty sure was for boot for mounting. Was that not the right choice?
Thanks for the help
 
Old 01-11-2012, 12:05 AM   #6
deep27ak
Senior Member
 
Registered: Aug 2011
Location: Bangalore, India
Distribution: RHEL 7.x, SLES 11 SP2/3/4
Posts: 1,195
Blog Entries: 4

Rep: Reputation: 221Reputation: 221Reputation: 221
Quote:
Originally Posted by xstorae View Post
I got a new laptop today, with Windows 7 pre-installed. I've been working for most of the day to dual boot it with Ubuntu, and had a bit of trouble installing GRUB. Eventually, I *think* I got it to install on the partition Ubuntu is on - at least that is what I wanted. But now when when I boot up the computer, it gives me a Grub prompt (after a short intro saying something about how the tab can complete your commands), and I'm at a loss for what to do with it.

To make matters worse, none of the normal grub commands seem to work; it cannot find root or kernel commands, help returns a list of things, help root doesn't return anything, help kernel likewise, and only 'exit' actually seems to work, which just restarts the boot..going back to grub again.

Have I not installed grub correctly? Should I go back to Ubuntu livecd desktop and try something else? Or is it a problem with my recently made partitions?
Thanks for any advice you can offer!
can you attach a snapshot of the place where your grub gets stucked?
are you able to go to single user mode?
can you post your grub.conf file?

and as the last command you tried as per me it should be
Code:
grub-install --boot-directory=/media/root dev/sda1
through this command you are trying to create a boot directoy and installing grub in /dev/sda1
 
Old 01-11-2012, 12:58 AM   #7
xstorae
LQ Newbie
 
Registered: Jan 2012
Posts: 9

Original Poster
Rep: Reputation: Disabled
@Larry Webb I followed the guide you pointed to on reinstalling Grub2, and it seemed to work. I rebooted, and got the grub prompt again (this is normal? it seems weird, but maybe it's just until things are configured correctly?) Now it seems that root is semi-working; when i type

grub> root (hd0,

and then press tab instead of enter, i get a list of partitions to choose from (which was definitely NOT happening before re-installation). But whichever number I choose, after pressing enter grub returns:

error: unknown command 'root'.

So I'm at a loss with what to do now Thanks for all the responses.
 
Old 01-11-2012, 05:28 AM   #8
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
Sounds like the mbr can not find the / partition.

Download and run Boot Info Script program using your ubuntu disk as a live cd and post the results. This will give us all the information we should need and not be guessing.

Boot Info Script

Last edited by Larry Webb; 01-11-2012 at 05:29 AM.
 
1 members found this post helpful.
Old 01-11-2012, 10:20 AM   #9
xstorae
LQ Newbie
 
Registered: Jan 2012
Posts: 9

Original Poster
Rep: Reputation: Disabled
Thanks Larry, I didn't know this existed. Here it is...

http://paste.ubuntu.com/800713/
 
Old 01-11-2012, 11:08 AM   #10
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
Using your live cd go to terminal and enter following commands

sudo mkdir /mnt/sda7 (enter)

sudo mount /dev/sda7 /mnt/sda7 (enter)

sudo grub-install --root-directory=/mnt/sda7 /dev/sda
(enter)


reboot h/d

Last edited by Larry Webb; 01-11-2012 at 11:11 AM.
 
Old 01-11-2012, 11:23 AM   #11
xstorae
LQ Newbie
 
Registered: Jan 2012
Posts: 9

Original Poster
Rep: Reputation: Disabled
Thanks Larry, I did that and grub loaded when I rebooted without the livecd, and did the same thing I was describing earlier when I entered root(hd0,x). Am I even supposed to be seeing grub show up when I reboot like this?
 
Old 01-11-2012, 11:29 AM   #12
xstorae
LQ Newbie
 
Registered: Jan 2012
Posts: 9

Original Poster
Rep: Reputation: Disabled
And the info script after doing that is here:

http://paste.ubuntu.com/800806/
 
Old 01-11-2012, 12:13 PM   #13
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
Sorry I missed the boot info, substitute 5 for the 7 in post #10 commands
 
Old 01-11-2012, 12:22 PM   #14
xstorae
LQ Newbie
 
Registered: Jan 2012
Posts: 9

Original Poster
Rep: Reputation: Disabled
Yeah, that's what I did originally actually. I just did it again and the same thing occurs.

grub> root(hd0,x)
error: unknown command 'root'.
 
Old 01-11-2012, 12:47 PM   #15
JimBrewster
Member
 
Registered: Feb 2010
Location: usa:/dev/random
Distribution: Slackware-15.0; -current
Posts: 245

Rep: Reputation: 60
If you're trying to use legacy grub commands, they are almost completely different in grub2.
 
  


Reply



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
what to install since these commands don't work.. turf Red Hat 4 09-12-2010 06:02 AM
grub drops to grub prompt on boot, but can use commands to find menu... fix? greenmuzz Linux - Software 7 06-07-2009 03:07 AM
Why don't certain commands work outside of dir? wyntre5150 Linux - General 2 08-17-2007 06:00 PM
Some Commands Don't Work dudeman41465 Linux - Software 5 01-29-2006 08:17 AM
root commands don't work Fetch Linux - Newbie 3 01-24-2005 10:22 AM

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

All times are GMT -5. The time now is 01:54 PM.

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
Open Source Consulting | Domain Registration