LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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-17-2005, 03:05 PM   #1
grautu
Member
 
Registered: Jul 2005
Posts: 142

Rep: Reputation: 15
Running GRUB at its prompter


Hi to all!
PROBLEM: To load various installed OSs by a GRUB loader which is installed in MBR but does not know where to load from. So, just after booting attempt, the user will get the "grub> " prompt and should provide GRUB with needed information, at command line.
REFERENCE: Chapter 4 of GRUB manual at <http://www.gnu.org/software/grub/manual/grub.html>.
WHAT DOES WORK FINE: Loading unsupported OSs (such as Windows) according to manual's recipe at Section 4.1.2
Code:
grub> rootnoverify (hd0,0)
grub> makeactive
grub> chainloader +1
grub> boot
WHAT FAILS TO WORK: Loading Linux OSs according to manual's recipe at Section 4.1.1
Code:
grub> root (hd0,1)
grub> kernel /vmlinuz-2.4.27-2-386 root=/dev/hda5 ro
grub> boot
In my setting, (hd0,1) is the primary /boot partition while /dev/hda5 is an extended partition containing the root / , a swap, a /home etc).
WHAT THE ERROR MESSAGE IS: The "grub> boot" command does launch the boot process but that process stops after a while with the following message
Code:
VFS: Cannot open root device "hda5" or 03:05
Please append a correct "root=" boot option
Kernel panic: VFS: Unable to mount root fs on 03:05
OTHER USERS-THE SAME UNSOLVED PROBLEM: See <http://www.linuxquestions.org/questi...=&threadid=559>.

Any idea (on how to load Linux OSs at "grub> " prompt) would be gratefully appreciated.
 
Old 09-17-2005, 09:37 PM   #2
bigrigdriver
LQ Addict
 
Registered: Jul 2002
Location: East Centra Illinois, USA
Distribution: Debian stable
Posts: 5,908

Rep: Reputation: 354Reputation: 354Reputation: 354Reputation: 354
If your /dev/hda5 is an extended partition, with root /, swap, and /home partitions inside the extended partition, then root / is probably /dev/hda6, swap is probably /dev/hda7, and /home is probably /dev/hda8, if they are in the order you listed then in your post.

You should edit the kernel line, specifically root=/dev/hda5 to read root=/dev/hda6 (the root partition).

The example in the manual is just that, an example. It is not meant to be an absolute parameter for all Linux installations. Examples from manuals must be edited to show the actual setup of your own installation.
 
Old 09-18-2005, 05:41 AM   #3
grautu
Member
 
Registered: Jul 2005
Posts: 142

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by bigrigdriver
If your /dev/hda5 is an extended partition, with root /, swap, and /home partitions inside the extended partition, then root / is probably /dev/hda6, swap is probably /dev/hda7, and /home is probably /dev/hda8, if they are in the order you listed then in your post.

You should edit the kernel line, specifically root=/dev/hda5 to read root=/dev/hda6 (the root partition).

The example in the manual is just that, an example. It is not meant to be an absolute parameter for all Linux installations. Examples from manuals must be edited to show the actual setup of your own installation.
Hi, brigrigdriver
and thanks for your answer. However I did work absolutely correct (though posted differently, please do excuse me for that!) in that my real setting is the following: extended partition /dev/hda3 (not /dev/hda5) with root partition / named indeed as /dev/hda5 (once again, I bag apologise for reporting the extended partition as /hda5 instead of /hda3). Therefore my root partition is /dev/hda5 indeed and the command I used
Code:
grub> kernel /vmlinuz-2.4.27-2-386 root=/dev/hda5 ro
is right. Anyway, I was already adapted the commands to my setting at least in that the GRUB manual does not provide examples (as you was believing) but general frameworks such as
Code:
kernel file
where the filename file should be replaced according to the actual setting (as I did replace).
Therefore the problem I posted remains unanswered.
Thanks again!

Last edited by grautu; 09-18-2005 at 08:24 AM.
 
Old 09-18-2005, 02:41 PM   #4
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
For those booting Grub manually in Grub prompt I want to share a secret with you. You can boot any system with these 3 lines

root (hdi,j)
chainloader +1
boot

Any system=DOS, Win3x, Win9x, 2k, XP, any Linux, any BSD and Solaris.

The "ONLY" thing you need is to do is to have the boot loader at the root partition of every operation system. i=disk No. and j=partition No. remember Grub counts from 0

For DOS, Win3x, Win9x, 2k, XP, any BSD and Solaris this is automatically arranged when you intsall the software.

For Linux it normally gives you 3 choices for the boot loader

(1) MBR
(2) root partition
(3) a Floppy (not always offered )

The (2) can always be replicated later when you are in that Linux by typing

gub-install /dev/hdax for Grub and x=partition No. (use sdax for Sata)

lilo -b /dev/hdax for Lilo

The manual booting process can be automated by amending the /boot/grub/menu.lst but the above 3 lines have to changed slightly to

title this is my system in hda9 # using hda9 as example
root (hd0,8)
chainloader +1

-----------------------

Typing the kernel is another method to boot is one method but can't be applied to a system foriegn to Grub (without a kernel like M$ Windows).

The other method described by the above is "chain loading". It is generic and usable on all systems.
 
Old 09-18-2005, 07:40 PM   #5
grautu
Member
 
Registered: Jul 2005
Posts: 142

Original Poster
Rep: Reputation: 15
Quote:
Originally posted by saikee
For those booting Grub manually in Grub prompt I want to share a secret with you. You can boot any system with these 3 lines
Code:
root (hdi,j)
chainloader +1
boot
Any system=DOS, Win3x, Win9x, 2k, XP, any Linux, any BSD and Solaris.
The "ONLY" thing you need is to do is to have the boot loader at the root partition of every operation system.
Thanks a lot saikee! Though your great trick failed to work in my case, I intend to learn why. Maybe, because of my root partition, which is "hidden" (as /dev/hda5) inside an extended partition /dev/hda3? Anyway, installing grub in / was indeed producing a certain difference in GRUB's behaviour, but not enough to go through and load my Debian from the "grub> " prompt. I would appreciate very much if somebody else would post here testing results in various configurations.
Thanks again for the trick and thanks in advance for other tests or remarks!
 
Old 09-19-2005, 05:33 AM   #6
saikee
Senior Member
 
Registered: Sep 2005
Location: Newcastle upon Tyne UK
Distribution: Any free distro.
Posts: 3,398
Blog Entries: 1

Rep: Reputation: 112Reputation: 112
Hda5 is the 1st logical partition in the hdd. Your hda3 extended partition is a box containing all the logical partition. An extended partition has no usable space. It is just a border boundary! If you have only one logical partition then hda3 should be indentical in size and cylinder numbers to hda5.

If you are working in Grub prompt, type help to see the commands available. "unhide" is one of the commands available

You can use

unhide (hd0,4)

to unhide your hda5. It will be bootable if it has a boot loader inside hda5.

Grub can only pull any system up if that system is bootable originally. Grub can't repair it.

I am not telling tricks here. All the bits I described on Grub can be read in the Grub Manual.
 
Old 09-19-2005, 10:01 AM   #7
grautu
Member
 
Registered: Jul 2005
Posts: 142

Original Poster
Rep: Reputation: 15
I will insist to understand your trick, grateful thanks!
 
  


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
Running GRUB on Slackware 07mackenzie Slackware 7 08-11-2005 11:10 PM
colored prompter/shell spank Linux - Newbie 2 08-30-2003 07:02 PM
Colored prompter spank Linux - Newbie 1 08-25-2003 02:25 PM
running DOS...Grub problem... MrMuffles Linux - General 1 06-18-2003 11:56 PM
Running DOS...Grub problem... MrMuffles General 0 06-18-2003 10:51 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

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