LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
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-04-2011, 12:24 PM   #1
swapmax
LQ Newbie
 
Registered: Jan 2011
Posts: 22

Rep: Reputation: 0
Grub command line


Does anyone know how to login through command line in grub.
 
Old 01-04-2011, 12:48 PM   #2
Noway2
Senior Member
 
Registered: Jul 2007
Distribution: Ubuntu 10.10, Slackware 64-current
Posts: 2,124

Rep: Reputation: 776Reputation: 776Reputation: 776Reputation: 776Reputation: 776Reputation: 776Reputation: 776
I think this article contains more information than you are looking for, but may answer your question.

Basically, you will need to use the grub command prompt to mount your Linux partition and then tell it to boot.
 
Old 01-04-2011, 01:24 PM   #3
linuxunix
Member
 
Registered: Mar 2010
Location: California
Distribution: Slackware
Posts: 235

Rep: Reputation: 18
You can get some hint on Grub through this too.
 
Old 01-04-2011, 01:44 PM   #4
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
If would also help to know

which distro or grub version you are using?
 
Old 01-05-2011, 10:00 AM   #5
swapmax
LQ Newbie
 
Registered: Jan 2011
Posts: 22

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Larry Webb View Post
If would also help to know

which distro or grub version you are using?
I am using grub1.98 ubuntu10.04
 
Old 01-05-2011, 10:22 AM   #6
michaelk
Moderator
 
Registered: Aug 2002
Posts: 12,143

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
grub has a limited command shell for editing / changing boot options. I assume you are not using a grub password. It is not possible to login since the OS is still not loaded at this point. Normally, you should not see the grub command prompt unless you press the e key when the boot menu is displayed or for some reason it can not find the menu.lst (grub not grub2) file. Also I believe that on new installs 10.04 installs grub2 by default.

So there seems to be some missing information between your 1st and 2nd threads to get to this point that would help us troubleshoot your problems.
 
Old 01-05-2011, 10:59 AM   #7
swapmax
LQ Newbie
 
Registered: Jan 2011
Posts: 22

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by michaelk View Post
grub has a limited command shell for editing / changing boot options. I assume you are not using a grub password. It is not possible to login since the OS is still not loaded at this point. Normally, you should not see the grub command prompt unless you press the e key when the boot menu is displayed or for some reason it can not find the menu.lst (grub not grub2) file. Also I believe that on new installs 10.04 installs grub2 by default.

So there seems to be some missing information between your 1st and 2nd threads to get to this point that would help us troubleshoot your problems.
At the boot menu i entered cmd line by pressing c and entered grub prompt and this is what i did grub>set root=(hd0,8)
grub> linux /vmlinuz root=/dev/(sda,8) ro
error;no such disk
 
Old 01-05-2011, 11:42 AM   #8
michaelk
Moderator
 
Registered: Aug 2002
Posts: 12,143

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
There is a difference between how grub and the OS identifies drives/partitions.
Grub references the 1st bootable drive /partition as 0,0 (i.e. zeros) So hd0,8 is the 1st drive 9th partition. The OS uses the device ID. The correct syntax
Quote:
linux /vmlinuz root=/dev/(sda,8) ro
with assumptions on which is your root partition should be
root (hd0,7)
linux /vmlinuz root=/dev/sda9 ro

Last edited by michaelk; 01-05-2011 at 11:44 AM.
 
Old 01-05-2011, 02:57 PM   #9
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 michaelk View Post
There is a difference between how grub and the OS identifies drives/partitions.
Grub references the 1st bootable drive /partition as 0,0 (i.e. zeros) So hd0,8 is the 1st drive 9th partition. The OS uses the device ID. The correct syntax

with assumptions on which is your root partition should be
root (hd0,7)
linux /vmlinuz root=/dev/sda9 ro
He said in post 5 he was using grub2 so the partition count should be the same

(sda1 = hd0,1)
 
Old 01-05-2011, 03:01 PM   #10
michaelk
Moderator
 
Registered: Aug 2002
Posts: 12,143

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
Yes it is... my bad.
 
Old 01-05-2011, 03:04 PM   #11
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
Let me have more information, how many distros are you trying to boot?

Do you get a screen with choices to boot when computer is booted?
 
Old 01-05-2011, 06:48 PM   #12
michaelk
Moderator
 
Registered: Aug 2002
Posts: 12,143

Rep: Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783Reputation: 783
The following link might provide some insight.

https://help.ubuntu.com/community/Grub2
 
Old 01-11-2011, 10:24 AM   #13
swapmax
LQ Newbie
 
Registered: Jan 2011
Posts: 22

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Larry Webb View Post
Let me have more information, how many distros are you trying to boot?

Do you get a screen with choices to boot when computer is booted?
I actually have windows7 installed.I do get graphical grub menu when computer boots giving me option which os to boot i.e win7 or ubuntu10.04
 
Old 01-11-2011, 10:32 AM   #14
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
Use your ubuntu live cd and from terminal enter

sudo fdisk -l (small L)

and post the results
 
Old 01-11-2011, 11:37 AM   #15
swapmax
LQ Newbie
 
Registered: Jan 2011
Posts: 22

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Larry Webb View Post
Use your ubuntu live cd and from terminal enter

sudo fdisk -l (small L)

and post the results
This is the output of fdisk -l of my os.
 
  


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
GRUB - How do I do I set it up from the command line Jongi Suse/Novell 6 01-26-2006 03:04 PM
help with grub command line syxxzonz Linux - General 3 06-16-2004 02:18 PM
booting to command line in grub nmistry Linux - Newbie 1 05-12-2004 09:48 PM
GRUB command line mimsmall Linux - General 1 02-05-2004 03:29 PM
Grub Command Line Help! Yoncopin Linux - General 5 02-02-2004 11:31 PM


All times are GMT -5. The time now is 12:10 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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration