Need to edit /boot/grub/menu.lst after install to boot

Asked by gary

Team,

I'm just beginning with Ubuntu and am trying to set up a dual boot WinXP and Ubuntu system. I installed Ubuntu 7.04, but the grub menu.lst file is wrong. Root line needs to be edited to "root (hd0,2)" and the kernal line needs to be changed to "... root=/dev/hda3..."

I ran this command to determine these values:
grub> find /boot/grub/stage1
 (hd0,2)
grub> find /boot/vmlinuz-2.6.20-15-generic
 (hd0,2)

I'm sure this is something simple, but I haven't figured out how to edit /boot/grub/menu.lst. I cannot boot the installed Ubuntu partition, and when I run the Live CD, it won't let me save the changes. There's no login prompt to give me any permissions.

How can I get in and edit this file? When I try editing the grub boot menu at boot up, I get the first pretty UBUNTU screen at which point my system locks up. The changes to the boot menu don't save either.

The Ubuntu install set up root as root (hd0,0) and for the kernal root=/dev/hda1.

I did install stage 1 to the MBR, since I want to use grub as my boot loader.
grub> setup (hd0)

This looks like it runs good with no errors, but then the menu.lst is not changed.

Any help will be greatly appreciated.

Gary

Question information

Language:
English Edit question
Status:
Answered
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Justin Payne (neolithium82) said :
#1

There's a way to use the existing grub when you boot, to change the otpions so that it will boot from hd0,2, etc with this guide. The changes are temporary, however once you're in, you can then go into /boot/grub/menu.lst and be able to change them permanently :)
http://grumpymole.blogspot.com/2007/05/ubuntu-how-to-edit-grub-boot-parameters.html

Hope this helps :)

Justin

Revision history for this message
gary (garylduncan) said :
#2

Thanks Justin. So I am trying to boot it correctly, but must have some parameter wrong.

Here is my grub menu edit item as it opens for edit:

root (hd0,0)
kernel /boot/vmlinuz-2.6.20-15-generic root=/dev/hda1 ro quiet splash
intrd /boot/intrd.img-2.6.20-15-generic
quit
savedefault

I edit the root line to "root (hd0,2)

and edit the kernal line to have "root=dev/hda3"

When I hit "b" to boot I get:

Starting up...
Loading, please wait ...

Then the graphic Ubuntu screen appears with the status bar, but it freezes right at the beginning of the status indicator.

Then I have to shut off the power to reboot and everything is the same.

Is there some parameter wrong here? It seems to find the kernal and start to boot. Why then the freeze?

Gary

Revision history for this message
Justin Payne (neolithium82) said :
#3

After you had made the changes to the line, did you hit enter before hitting b? That way you ensure that it would accept the changes. If it still doesnt, you can always try below to use the recovery mode kernel and see if that gets you in.

I would suggest hitting ESC when grub starts, hit e to start the editing and try the same edits that you did, though with the Recovery Mode kernel, which should be on that list. Hit E once again to start the editing, change the parameters you needed and make sure you hit enter so it accepts the changes and then hit b to boot into it.

Regards,
Justin

Revision history for this message
gary (garylduncan) said :
#4

Thanks Justin.

I tried with recovery mode and it began booting. As it identified and loaded drivers, it stopped after detecting my mouse USB drivers.

Then after a long pause, it said "Done." and gave the following error message:

          Check root= bootarg cat /proc/cmd/line
          or missing modules, devices: cat /proc/modules ls /dev
  ALERT! /dev/hda3 does not exist. Dropping to shell!

Why would it say that /dev/hda3 does not exist?

Gary

Revision history for this message
Justin Payne (neolithium82) said :
#5

I have a feeling that you'll have to go by UUID for your root= line. Are you able to get a look at your /etc/fstab file that is on your linux intallation? If you can copy and paste that, it would be perfect. I can show you with an example though quickly if that makes it easier:

# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/hda1
UUID=b7e34129-5824-4292-b56f-3afc8051e2da / xfs defaults 0 1
# /dev/hda3
UUID=176245fd-d6e8-4069-a3d7-11fd92751aa1 /home xfs defaults 0 2
# /dev/hda4
UUID=a4f7b16e-8a3f-4a6e-a0c1-0493707d537a /data xfs defaults 0 2
# /dev/hda2
UUID=c5a0c8ee-6cb2-4c79-9597-66c4f2467b54 none swap sw 0 0
/dev/hdc /media/cdrom0 udf,iso9660 user,noauto 0 0

My / partition is /dev/hda1 though it goes by the UUID number, so I would use

root=UUID=b7e34129-5824-4292-b56f-3afc8051e2da

It makes it a little more complicated, though it seemed to be what worked for another person who had a similar issue as I was scouring some notes on changing grub issues :)

Hopefully this can help out more than the last few posts.
Regards,
Justin

Revision history for this message
gary (garylduncan) said :
#6

Justin,

I tried to find the file you mention, but did not see it. I'm installing Ubuntu 7.04. I booted up into the Live CD and opened the text editor to view that file, but could not find fstab in the etc directory. It's not there, or its hidden from me.

Gary

Revision history for this message
gary (garylduncan) said :
#7

Justin,

Think I found the UUID by looking in device manager. I'll try it with the UUID now.

Gary

Revision history for this message
gary (garylduncan) said :
#8

Justin,

Nope. The UUID did not help either.

At this point, I think I will try installing UBUNTU to a clean drive and see how it gets set up. If I can get it working, then I'll try adding the WinXP partition from my cloned drive.

Thanks for your help Justin.

Gary

Revision history for this message
Justin Payne (neolithium82) said :
#9

Sorry I could do much Gary, it might actually work easier that way though, depending on things.

Regards,
Justin

Can you help with this problem?

Provide an answer of your own, or ask gary for more information if necessary.

To post a message you must log in.