LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Grub command line (https://www.linuxquestions.org/questions/linux-newbie-8/grub-command-line-854168/)

swapmax 01-04-2011 11:24 AM

Grub command line
 
Does anyone know how to login through command line in grub.

Noway2 01-04-2011 11:48 AM

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.

linuxunix 01-04-2011 12:24 PM

You can get some hint on Grub through this too.

Larry Webb 01-04-2011 12:44 PM

If would also help to know

which distro or grub version you are using?

swapmax 01-05-2011 09:00 AM

Quote:

Originally Posted by Larry Webb (Post 4212950)
If would also help to know

which distro or grub version you are using?

I am using grub1.98 ubuntu10.04

michaelk 01-05-2011 09:22 AM

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.

swapmax 01-05-2011 09:59 AM

Quote:

Originally Posted by michaelk (Post 4214038)
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

michaelk 01-05-2011 10:42 AM

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

Larry Webb 01-05-2011 01:57 PM

Quote:

Originally Posted by michaelk (Post 4214124)
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)

michaelk 01-05-2011 02:01 PM

Yes it is... my bad.

Larry Webb 01-05-2011 02:04 PM

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?

michaelk 01-05-2011 05:48 PM

The following link might provide some insight.

https://help.ubuntu.com/community/Grub2

swapmax 01-11-2011 09:24 AM

Quote:

Originally Posted by Larry Webb (Post 4214325)
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

Larry Webb 01-11-2011 09:32 AM

Use your ubuntu live cd and from terminal enter

sudo fdisk -l (small L)

and post the results

swapmax 01-11-2011 10:37 AM

Quote:

Originally Posted by Larry Webb (Post 4220587)
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.


All times are GMT -5. The time now is 01:12 AM.