LinuxQuestions.org
Register a domain and help support LQ
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 09-03-2004, 11:46 PM   #1
darkranger
LQ Newbie
 
Registered: May 2004
Location: Taiwan
Distribution: Fedora
Posts: 28

Rep: Reputation: 15
Unhappy GRUB show me command line after rebooted


only commad line
How can I boot linux and fix it???
Fedora Core 2
 
Old 09-04-2004, 12:14 AM   #2
ppuru
Senior Member
 
Registered: Mar 2003
Location: Beautiful BC
Distribution: RedHat & clones, Slackware, SuSE, OpenBSD
Posts: 1,791

Rep: Reputation: 47
root (hd0,x) where x is the partition that contains the boot files
kernel /boot/vmlinuz<hit tab> root=/dev/hdax (where x is the partition that has the / partition)
initrd /boot/initrd<tab>
boot

<tab> gives you the options available so you can pick up the most appropriate file.
 
Old 09-04-2004, 04:42 AM   #3
motub
Senior Member
 
Registered: Sep 2003
Location: The Netherlands
Distribution: Gentoo (main); SuSE 9.3 (fallback)
Posts: 1,607

Rep: Reputation: 46
Which command line? The GRUB command line, or the regular system command line (after a successful boot)?
 
Old 09-04-2004, 03:21 PM   #4
JoeDuncan
Member
 
Registered: Aug 2003
Location: Ottawa
Distribution: Redhat 5.2, 6.0, 6.1, Mandrake 7.2, 8.0, 9.1, 9.2, 10.0, Gentoo, Debian 3.1r0
Posts: 224

Rep: Reputation: 30
The GRUB command line.
 
Old 09-04-2004, 04:50 PM   #5
motub
Senior Member
 
Registered: Sep 2003
Location: The Netherlands
Distribution: Gentoo (main); SuSE 9.3 (fallback)
Posts: 1,607

Rep: Reputation: 46
In that case, as far as I know, you don't have to boot Linux to fix it (although you can, by manually entering the lines of the GRUB boot menu entry at the GRUB command line, or so I have heard).

But IMO, since the GRUB command line is mostly used for installing GRUB, the fact that you are being forcibly directed to it strongly implies that GRUB needs to be reinstalled (it can find itself on the MBR apparently, but can't find any of the later stage files that are normally kept in /boot/grub).

So what I would do is to type root (hd#, (with # being the number of the hard drive that should contain the /boot folder or partiton) and then hit the TAB key to see where GRUB feels are the appropriate partitions to install itself.

Better yet, I would (before I even did the above) type find /boot/grub/stage1 to see if GRUB could find where it's supposed to be installed.

Then I would type root (hd#,#), based upon the results of the find command, to reinstall GRUB to the boot partition or folder, and then type setup (hd0) to reinstall the now-self-aware GRUB to the MBR (or setup (hd0,#) to install it to the root partition of the distribution, if you prefer to do that for some reason).

See the GRUB manual for further details.

Now that I think about it, though, when you reinstall GRUB to the /boot partition or folder, keep an eye on the output. GRUB has this weird recursive thing (especially if you install it with grub-install to a separate /boot partition), where it will wind up installed to /boot/boot/grub, instead of /boot/grub. At which point it won't be able to find itself (it's supposed to be able to, but that sure didn't work for me during my last reinstall). There's a whole explanation in the FAQ about how this is a feature and not a bug, but I'm not really buying it, as I found this "feature" nothing but trouble. However, it does mean that if you know GRUB to have been installed, but find /boot/grub/stage1 didn't find anything, you could try find /boot/boot/grub/stage1 and see if that works out better in terms of finding the stage files.

Fortunately, the solution is in the GRUB FAQ as well; you must create a recursive symlink in the /boot directory, called boot, that links back to the higher level /boot directory, so that when GRUB tries to install in /boot/boot, it winds up back in /boot and creates /boot/grub instead of /boot/boot/grub.

You would create a symbolic link before (re)installing GRUB, with the command cd /boot && ln -s . boot, but iirc, you have to boot from a LiveCD of some sort in order to mount /boot in the first place to actually do this (since you're unlikely to be able to mount anything from an unbooted system, though you could try parsing the GRUB menu line by line to boot, or just type quit and see where you wind up).

I know this doesn't sound like much help (I find GRUB fairly confusing to set up), but I hope it's useful anyway.
 
Old 09-05-2004, 06:48 AM   #6
darkranger
LQ Newbie
 
Registered: May 2004
Location: Taiwan
Distribution: Fedora
Posts: 28

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by ppuru
root (hd0,x) where x is the partition that contains the boot files
kernel /boot/vmlinuz<hit tab> root=/dev/hdax (where x is the partition that has the / partition)
initrd /boot/initrd<tab>
boot

<tab> gives you the options available so you can pick up the most appropriate file.
ERROR: CAN NOT MOUNT SELECTED PARTITION.....
oh no....
 
Old 09-05-2004, 12:04 PM   #7
ppuru
Senior Member
 
Registered: Mar 2003
Location: Beautiful BC
Distribution: RedHat & clones, Slackware, SuSE, OpenBSD
Posts: 1,791

Rep: Reputation: 47
when you

root (hd<tab>,<tab>)

what choices do you have? Can you please post the output here.
 
Old 09-06-2004, 05:37 AM   #8
darkranger
LQ Newbie
 
Registered: May 2004
Location: Taiwan
Distribution: Fedora
Posts: 28

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by ppuru
when you

root (hd<tab>,<tab>)

what choices do you have? Can you please post the output here.
thanks guys
I fixed it by knoppix
 
Old 09-06-2004, 07:53 AM   #9
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,675

Rep: Reputation: Disabled
Quote:
Originally posted by darkranger
thanks guys
I fixed it by knoppix
Fine . How ?

It's always nice when you post a solution, in case another unlucky soul chances on the same problem...
 
Old 09-07-2004, 11:02 AM   #10
darkranger
LQ Newbie
 
Registered: May 2004
Location: Taiwan
Distribution: Fedora
Posts: 28

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by JZL240I-U
Fine . How ?

It's always nice when you post a solution, in case another unlucky soul chances on the same problem...
linux partition was damaged by shutdown not clean
put knooppix in and use"fsck" to fix partition
$ fsck /dev/hda2
 
Old 09-08-2004, 04:13 AM   #11
JZL240I-U
Senior Member
 
Registered: Apr 2003
Location: Germany
Distribution: openSuSE 13.1 / 12.3_64-KDE, Ubuntu 14.04, Fedora 20, Mint 17, Chakra
Posts: 3,675

Rep: Reputation: Disabled
Thank you .
 
  


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


Similar Threads
Thread Thread Starter Forum Replies Last Post
help with grub command line syxxzonz Linux - General 3 06-16-2004 01:18 PM
when booting, just show GRUB word not command ratana LinuxQuestions.org Member Intro 2 05-06-2004 04:05 PM
when booting, just show GRUB word not command ratana Red Hat 1 05-06-2004 03:40 AM
GRUB command line mimsmall Linux - General 1 02-05-2004 02:29 PM
Grub Command Line Help! Yoncopin Linux - General 5 02-02-2004 10:31 PM


All times are GMT -5. The time now is 07:51 AM.

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