LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 09-27-2008, 03:25 AM   #1
algogeek
Member
 
Registered: Apr 2008
Distribution: Fedora 9, Ubuntu 8.04, Ubuntu 8.04 Server
Posts: 103

Rep: Reputation: 15
Ubuntu Server - Grub Issues


Hello friends,

I'm trying to set up a machine using Ubuntu server, and I installed it on it. And now, GRUB does not come with a menu, but a command line. I have no idea what to do, and why this is happening. Installation was successful, but now I don't know how to boot into the system because I have no idea about the kernel version and how to boot the kernel using the command line in GRUB.

Will re installing help? Why is this happening?
 
Old 09-27-2008, 04:38 AM   #2
algogeek
Member
 
Registered: Apr 2008
Distribution: Fedora 9, Ubuntu 8.04, Ubuntu 8.04 Server
Posts: 103

Original Poster
Rep: Reputation: 15
Anyone? .
 
Old 09-27-2008, 05:58 AM   #3
pinniped
Senior Member
 
Registered: May 2008
Location: planet earth
Distribution: Debian
Posts: 1,732

Rep: Reputation: 50
Is Grub offering any clues on what to boot?

When you installed, did you swap around any HDs? If they are listed by the BIOS in a different order, Grub will get confused.

There is a "find" command which you can use to get started:

find /boot/grub/menu.lst

or

find /boot/grub/device.map

If you're lucky you'll get a response like:

(hd1,0) /boot/grub/device.map

That would indicate that a file named device.map was found on the first partition of HD#2; when Grub was originally installed it might have thought that the HD was #1 rather than #2 so it might be looking for files on (hd0,0) and then giving up.

This is fairly easy to fix up if you boot from a LiveCD - since it's Ubuntu, just boot from your installer disc, but tell it to run the live system rather than asking it to install.

Then things go like this:

1. Enter the "interactive" sudo mode: sudo -i (this essentially makes you root user until you 'exit')

2. Identify your HD with the installation - Ubuntu usually automounts it so:
mount (displays all current mounts)

3. Check out the boot/grub directory of your installation to see what's there - so it would be something like:
ls -l /mnt/hda1/boot/grub/*
You should see the various Grub bootloader files: stage1 stage2 whatever_stage1_5, plus the config files "device.map" and "menu.lst"
Check "menu.lst" with a text editor and confirm that it has valid entries for your kernel and initrd image (actually it's initramfs, but lately everyone has been referring to initramfs as initrd and denying the continued existence of the original initrd)

4. Keep in mind that the Live CD may call the HD something like "sdb" or "hda" - whatever. Our aim here would be to get further along in the boot process; possibly failing when it comes to reading 'fstab', but hopefully 'busybox' will pop up and allow you to fix the remaining problems.

Anyway, you must ensure that the 'device.map' file on your installed system has the correct device mapping - whatever that may be - when the system starts. For example, let's say that under the LiveCD your HD is called "hda" but when you boot the system without a CD it's essentially named "hdb". The 'device.map' file on the INSTALLED system should then have an entry like this:
(hd0) /dev/hdb (or 'sdb' if the device is sd...)

So check device.map

5. Now you have to unmount that partition so that Grub can do its job without bringing on the end of the world.

6. Now you have to create another map file for the CURRENT setup - let's call it 'disk.map' so you don't get it confused with 'device.map'. It really only needs an entry for the HD you want to install to; it's only needed to initially trick grub into installing in the right place:
echo "(hd0) /dev/hda" > disk.map

7. Now to (re) install grub [assuming you originally installed it to MBR]:
grub --batch --device-map=disk.map <<EOF
root (hd0)
setup (hd0) (hd0,0)
quit
EOF

The 'setup' part is telling GRUB to install stage1 to MBR (hd0), and to look for other files on the first partition on hd0 (that is, hd0 as defined in disk.map, which in this example is currently hda). Since grub on Linux defaults to searching in /boot/grub, it will look for a copy of ALL bootloader stages in (hd0) /boot/grub/. You should get a message that grub installed correctly.

What to expect next? Well, now when you restart, GRUB will read "device.map" and see that "hd0" (which is where GRUB knows it was installed) is really now known as 0x81 (long story - but normally 0x80 becomes 'hda' and 0x81 becomes 'hdb' and the original grub install may have confused them) and hopefully it will find the menu.lst, your kernel and the initrd files and begin to boot. Now the system *might* get stuck on reading /etc/fstab because entries have names like '/dev/hda' when they need to be changed to '/dev/hdb' (or sdb - however the installed kernel calls it).

Have fun.
 
Old 09-27-2008, 07:47 AM   #4
AuroraCA
Member
 
Registered: Jul 2008
Location: Northern CA USA
Distribution: Ubuntu, Slackware, Gentoo, Fedora, Red Hat, Puppy Linux
Posts: 370

Rep: Reputation: 35
Are you trying to dual boot your system with Ubuntu-Server or is it the only OS on the computer? I don't understand the logic of dual booting a server. If you only have Ubuntu-Server installed on the system then GRUB will list all of the kernel images on the system with the most current on top. If you do not select an image it should automatically boot the latest kernel.

If you are not trying to dual boot the machine I would just reinstall Ubuntu-Server reformatting the drives. GRUB should not be displayed unless there is more than one OS or kernel on the drives.

Last edited by AuroraCA; 09-27-2008 at 07:51 AM.
 
Old 09-28-2008, 10:51 AM   #5
algogeek
Member
 
Registered: Apr 2008
Distribution: Fedora 9, Ubuntu 8.04, Ubuntu 8.04 Server
Posts: 103

Original Poster
Rep: Reputation: 15
Thanks for your responses guys. I managed to locate the problem: two hard drives. I unplugged one of the hard drives, did an install and then booted successfully into the OS.

I plugged in the second hard drive after that, and things are working like a dream now. Ubuntu/Debian sure has class.

The server now has just Ubuntu Server installed on it and performance has gone up significantly. I used to run Fedora on the same machine earlier, and was not at all happy with SELinux and the sloppy performance. The current setup is amazing.
 
  


Reply

Tags
kernel, boot, ubuntu, grub, server, menu



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
[SOLVED] How do I install GRUB on both MBRs of a two disk RAID1 array (Ubuntu server)? Woozle Linux - Newbie 8 08-09-2008 04:34 PM
Ubuntu - GRUB install issues xavierkress Linux - Newbie 4 12-24-2007 11:52 AM
Issues Setting Up a Wireless Access Point on Ubuntu Server 7.4 with BCM4306 card sneakyjoe Linux - Wireless Networking 0 08-12-2007 04:21 PM
Booting my new ubuntu install = "GRUB GRUB GRUB GRUB GRUB" etc. dissolved soul Ubuntu 2 01-13-2007 12:55 PM
Grub 0.97 issues on slackware - grub-install is very slow, & updating menu.lst fails dieyouspammer Linux - Software 1 02-27-2006 01:06 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 01:59 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