LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 03-30-2006, 04:33 PM   #1
furiousn00b
LQ Newbie
 
Registered: Mar 2006
Distribution: CentOS 4.4
Posts: 29

Rep: Reputation: 15
AHH!! CANNOT BOOT! Grub command line


BTW I hate LILO it SUX!! I will not work on my server and I'm so hacked at it. In fact we've broken up for the last time, and called off the wedding. So ya Grub. I just installed Slackware last night, full install, and NO LILO cuz it only screwed things up. Forget it, dont suggest trying again - done. So now with no bootloader I end up at a Grub command line prompt. I understand the reasons why but have two questions: 1.) Can I boot from this screen without having to reboot with install cd/install any software etc? and 2.) How do I install the full Grub and get it working? I tried these instructions humanreadable.nfshost.com/sdeg/grub and they dont exactly work. Upon typing installpkg grub*.tgz the thing does it but doesnt tell me where, so I cant figure out where to type grub-install /dev/hda, and no it doesnt work in the same directory. I'd absolutely love it if someone could give me step-by-steps on getting grub up and running and therefore my server up and running. HELP!!

oh and btw i dont have a floppy available at the moment, so we'll have to work around that

Last edited by furiousn00b; 03-30-2006 at 04:41 PM.
 
Old 03-30-2006, 05:18 PM   #2
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546
Quote:
I tried these instructions humanreadable.nfshost.com/sdeg/grub and they dont exactly work.
Thank you for the feedback!

Based upon your comments I added some additional info to the How-To. If those additions still don't help you, please use this forum or email me to help me improve the piece.

BTW, what does your partition scheme look like on this box? Often the problem is not GRUB, but not properly editing menu.lst to find the location of the /boot/grub files. You might also want to look at GRUB and Error 17.
 
Old 03-30-2006, 05:49 PM   #3
furiousn00b
LQ Newbie
 
Registered: Mar 2006
Distribution: CentOS 4.4
Posts: 29

Original Poster
Rep: Reputation: 15
Ok heres what i did specifically:
Full install of Slackware 10.2, paritions: Main 12GB Linux File System, bootable/ Swap Partition 1GB
Decline the LILO install
Reboot
grub> (console command line thing)
Dont know what to do from there, so I reinsert CD 1 and boot off of CD
Get to root and mount HDC (CDrom)
cd to cdrom/extra/grub dir
Type installpkg grub*.tgz and it works
in same dir cdrom/extra/grub typed grub-install /dev/hda and get msg: file doesnt exist or something along those lines
So I try to Cd to the boot dir and it denies me

Now that I am trying to reproduce what happened it doesnt want to mount the CD3 for whatever reason
The cds are fine, they installed no prob and verified on burn.
I just need to know how to specifically get grub to finish, no error msgs just no specifics as to where to type 'grub-install' and why cant i cd to boot?
 
Old 03-30-2006, 05:54 PM   #4
furiousn00b
LQ Newbie
 
Registered: Mar 2006
Distribution: CentOS 4.4
Posts: 29

Original Poster
Rep: Reputation: 15
BTW Genius right here:

"From the command line you can use GRUB like this:

grub> root (hd0,0)
grub> kernel (hd0,0)/boot/vmlinuz root=/dev/hda1
grub> boot"

So glad you added that, however i do have a few questions...can I substitute /vmlinuz for the actual kernel i have installed? /boot/bare.i ?

Also like in the same article you explain how hd0 = hda and ,0 would equal the first partition, would you need to adjust those numbers to match your boot partition? i.e. "root (hd0,1) kernel (hd0,1)/boot/vmlinuz root-/dev/hda1" ?

Last edited by furiousn00b; 03-30-2006 at 05:59 PM.
 
Old 03-30-2006, 06:11 PM   #5
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546
Do I understand you correctly that you have only two partitions, one for Slackware and one for swap? If so then does your partition scheme looks like this:

hda1: slackware
hda2: swap

Is this correct?

Additionally, please post your GRUB menu.lst config file. As mentioned in the above How-Tos, that file is located in /boot/grub.

I just saw your additional post. Do I understand correctly that the command line options worked? If so, then you need to edit your menu.lst to reflect the same parameters and instructions.

Did you try running grubconfig to see if GRUB can auto-guess at configuring menu.lst?

Quote:
can I substitute /vmlinuz for the actual kernel i have installed? /boot/bare.i ?
Yes. vmlinuz typically is the kernel file for many people. But some people are a bit different. If you look at my sample menu.lst in the How-To, you'll see that I point GRUB to vmlinuz-ide-2.4.28. On my second box that file would be vmlinuz-ide-2.4.31.

You probably want to edit /boot/grub/menu.lst to something like this:

timeout 3
color light-gray/blue black/light-gray
altconfigfile (hd0,0)/boot/grub/menu.once

title Slackware 10.2
kernel (hd0,0)/boot/bare.i root=/dev/hda1 ro vga=3
 
Old 03-30-2006, 06:20 PM   #6
furiousn00b
LQ Newbie
 
Registered: Mar 2006
Distribution: CentOS 4.4
Posts: 29

Original Poster
Rep: Reputation: 15
This is how its setup

hda1 swap
hda2 slackware

I made slackware first but when all was said and done it moved it to 2

I cannot get so far as to edit anything including the menu.lst, it would not let me cd into boot and when i tried to to vi /boot/grub/menu.lst it said it did not exist. And this is after running 'installpkg grub*.tgz'

Alright heres the big question that Im still confused about, if Im in /cdrom/extra/grub/ and i have just run 'installpkg grub*.tgz', where do I go to run grub-install /dev/hda? and where do I go to run grubconfig? what directory do I need to be in in order for linux to see and understand my command?
 
Old 03-30-2006, 06:44 PM   #7
furiousn00b
LQ Newbie
 
Registered: Mar 2006
Distribution: CentOS 4.4
Posts: 29

Original Poster
Rep: Reputation: 15
OK update... used the commands you gave on dealing with the no-boot grub> console. They worked like a charm! thank you so much. From there mounted cdrom disc3 and ran the installpkg command again, immediately after in the same directory I ran grub-install /dev/dha then grubconfig and everything went smooth until hitting enter is said "/usr/sbin/grubconfig: line 1007: /tmp/grubconfi/null: No such file or directory" in the command line. Is this a prob? And also is it mandatory to put:

title Slackware 10.2
kernel (hd0,0)/boot/bare.i root=/dev/hda1 ro vga=3

into the grub .lst file? Or will it work with vmlinuz ? Is it loading my default 'bare.i' kernel when it says vmlinuz or is it loading another kernel?
 
Old 03-30-2006, 07:03 PM   #8
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546
Quote:
They worked like a charm! thank you so much.
Good! Now you need to edit /boot/grub/menu.lst to reflect the same parameters.

Quote:
And also is it mandatory to put:

title Slackware 10.2
kernel (hd0,0)/boot/bare.i root=/dev/hda1 ro vga=3

into the grub .lst file?
You need something very similar to that entry, yes.

The file installed at the disk MBR (master boot record) is only a 512 byte (yes, byte) pointer to find the GRUB boot loader files. When the GRUB boot loader files run, they look for the menu.lst config file. That file instructs the GRUB boot loader files how to finish booting.

When you manually typed instructions at the GRUB command line, you were performing manually what GRUB is designed to perform automatically. By properly editing menu.lst you no longer would need to manually boot from the command line.

Quote:
Is it loading my default 'bare.i' kernel when it says vmlinuz or is it loading another kernel?
If vmlinuz is a soft link to bare.i, you can use either file name.

If you do not know how to check this, open a command line console, and type ls /boot. If the file vmlinuz exists then more than likely the file is a soft link to your kernel file and the listing will reveal to you where vmlinuz is linked.

Quote:
everything went smooth until hitting enter is said "/usr/sbin/grubconfig: line 1007: /tmp/grubconfi/null: No such file or directory" in the command line. Is this a prob?
I am guessing that you have a permissions problem with your /temp directory. Are you trying to install and config GRUB as a normal user or as root? You need to be root to install most packages and edit most system config files.
 
Old 03-30-2006, 07:06 PM   #9
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,140

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
Try re-booting (again) - what do you get ???.
 
Old 03-30-2006, 07:16 PM   #10
furiousn00b
LQ Newbie
 
Registered: Mar 2006
Distribution: CentOS 4.4
Posts: 29

Original Poster
Rep: Reputation: 15
Well I rebooted without editing the .lst file becuz everything in it looked fine, i did change the name to slackware 10.2 though and grub came up, i clicked enter (it by default was highlighting my kernel like it was supposed to) and poof it came up like a dream. Though Im wondering, is there somewhere I can change it to where Grub will count down from 3 seconds and select the default kernel if i do nothing? that way I dont have to stand there and wait for it to boot before selecting?


Also i installed Grub in root, so how would I fix the tmp file permissions?

Last edited by furiousn00b; 03-30-2006 at 07:34 PM.
 
Old 03-30-2006, 10:51 PM   #11
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,140

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
This got a lot more complex than it should have - here's what I was going to post earlier, but by then you had "fixed" it.

Sounds like you are booting the CD rather than chroot'ing into your disk install. grub-intall is a wrapper, and isn't aware of the sublties. It'll (probably) be installing the stage and config files into the memory image that the CD uses - not your hard disk.
You can pass it parms to get around this of course.

From the grub prompt you get at the boot;
- hopefully the actual install worked ok; try
Code:
find /boot/grub/stage1    (this should return the device).
root(hd0,1)    (use the device here)
setup(hd0)     (re-write the MBR pointing to correct partition)
This is all that is needed to get grub functional.
Re-boot, and see how you go.
+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
As mentioned, after the "setup", you can also enter the kernel line, followed by "boot" to get the system up. Then you can cleanup any remaining issues from there.

As for the delay, add "timeout 3" as per the link (which 404's for me) above.

Last edited by syg00; 03-30-2006 at 10:52 PM.
 
Old 03-31-2006, 01:45 AM   #12
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 4,928

Rep: Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612Reputation: 612
"Dont know what to do from there, so I reinsert CD 1 and boot off of CD
Get to root and mount HDC (CDrom)
cd to cdrom/extra/grub dir
Type installpkg grub*.tgz and it works
in same dir cdrom/extra/grub typed grub-install /dev/hda and get msg: file doesnt exist or something along those lines"

You have to mount your target directory before installing.
mount /dev/hda2 /mnt

Then mount your CD as you did above. Use ROOT=/mnt installpkg, or run pkgtool, so that the package gets installed to /mnt, not to /, because / is your initrd ramdisk from the install CD.

Of course you can change the names of the kernel or labels that get displayed, just make sure they match what's on your system.

Best way to get ideas of what options you can use is to study menu.lst files from various installations -try a kanotix CD or any of most multi-distro liveCD's like you get in magazines.

Here's an example from my AmigoXP, which shows various setups, including booting with an intrd and booting a loop device:

##
# Amigo-Xp Linux GRUB Boot Menu Configuration File!
#

color cyan/blue white/blue

# To boot straight into Amigo-XP with no GRUB menu,
# set timeout to 0 (zero) and uncomment the 'default' line.
#
# Boot automatically after 20 secs.
timeout 20

# By default, boot the first entry.
default 0

# Fallback to the second entry.
fallback 1

# Amigo-Home Linux
title Amigo Linux -Testing kernel-test
kernel (hd0,0)/boot/kernel-test root=/dev/hda2 ro lang=en vga=normal screen=1024x768 depth=24 idebus=66
#
# Amigo-XP Linux Test
title Amigo-XP Linux -Testing Amigo-XP/FX with kernel in /boot
kernel (hd0,0)/boot/kernel-test root=/dev/loop7 ro lang=en vga=normal screen=1024x768 depth=24 idebus=66
initrd (hd0,0)/amigoxp/boot/initrdxp
#

# Amigo ToolKit Test
title Amigo ToolKit -Testing
kernel (hd0,0)/boot/kernel-test root=/dev/ram init=/sbin/init vga=normal rw idebus=66
initrd (hd0,0)/boot/toolkit
#
# Amigo-XP Linux
title Amigo-XP Linux -Standard Amigo-XP Startup
kernel (hd0,0)/amigoxp/boot/kernel root=/dev/loop7 ro lang=en vga=792 screen=1024x768 depth=24
initrd (hd0,0)/amigoxp/boot/initrdxp
#

# Amigo-XP Linux Safe-Mode
title Amigo-XP Linux Safe-Mode -For Older Hardware
kernel (hd0,0)/amigoxp/boot/kernel root=/dev/loop7 ro lang=en vga=788 noapm noddc noagpgart xmodule=fbdev depth=16 screen=800x600
initrd (hd0,0)/amigoxp/boot/initrdxp
#

# Amigo Rescue ToolKit
title Amigo ToolKit -System Rescue and Maintenance
kernel (hd0,0)/amigoxp/boot/kernel root=/dev/ram init=/sbin/init vga=normal rw
initrd (hd0,0)/amigoxp/boot/toolkit.gz
#
 
Old 03-31-2006, 07:16 PM   #13
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546
Quote:
i did change the name to slackware 10.2
The title directive within menu.lst is mostly for informational purposes to help users select a list item. GRUB does not directly use the information in the boot loading process.

Quote:
Though Im wondering, is there somewhere I can change it to where Grub will count down from 3 seconds and select the default kernel if i do nothing?
Yes. Return to my Installing GRUB How-To and notice the timeout parameter.

Quote:
This got a lot more complex than it should have
The quality of an answer is always related to the quality of the question!
 
Old 03-31-2006, 07:25 PM   #14
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,140

Rep: Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123Reputation: 4123
Quote:
Originally Posted by Woodsman
The quality of an answer is always related to the quality of the question!
My statement was an observation, not a criticism.
 
Old 03-31-2006, 07:47 PM   #15
Woodsman
Senior Member
 
Registered: Oct 2005
Distribution: Slackware 14.1
Posts: 3,482

Rep: Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546Reputation: 546
Quote:
My statement was an observation, not a criticism.
Fair enough!
 
  


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
Doesn't boot. Comes up with GRUB command line. jjbuchan Linux - Newbie 4 10-24-2005 01:00 PM
GRUB trashed Win2K Boot Sector. AHH! penguinlnx Linux - Software 3 04-22-2005 06:21 AM
Blank Screen after Suse Boot - HowTo boot from grub to command line benco420 Linux - Newbie 3 02-13-2005 05:50 AM
Ahh help! (Grub Boot Loader Issue). RoaCh Of DisCor Linux - Software 9 09-09-2004 04:39 AM
Uninstalled... how do I use grub (command line) to boot winXP? once here Linux - Software 3 02-28-2004 07:49 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

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

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