Ubuntu has disabled root logins. You can run commands as root using sudo. The first regular user is a member of the wheel group and is allowed to use sudo.
You could run a command such as "sudo vim /boot/grub/menu.lst".
You could also use "gnomesu" to start a graphical editor as root.
You could have two instances open at once and cut and paste the part you need.
Use the part that looks like this from your Ubuntu's menu.lst. (This example is from my SuSE laptop)
Code:
# Modified by YaST2. Last modification on Fri May 25 19:47:59 CDT 2007
default 0
timeout 8
gfxmenu (hd0,4)/boot/message
title openSUSE 10.2 - 2.6.18.8-0.3
root (hd0,4)
kernel /boot/vmlinuz-2.6.18.8-0.3-default root=/dev/hda5 vga=791 nolapic resume=/dev/hda2 splash=silent showopts
initrd /boot/initrd-2.6.18.8-0.3-default
title Failsafe -- openSUSE 10.2 - 2.6.18.8-0.3
root (hd0,4)
kernel /boot/vmlinuz-2.6.18.8-0.3-default root=/dev/hda5 vga=normal showopts ide=nodma apm=off acpi=off noresume edd=off
initrd /boot/initrd-2.6.18.8-0.3-default
###Don't change this comment - YaST2 identifier: Original name: windows###
title Windows
rootnoverify (hd0,0)
chainloader (hd0,0)+1
Then insert the section into the other distros menu.lst file:
Fedora Core's menu.lst file before:
Code:
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
# initrd /initrd-version.img
#boot=/dev/hda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
vga=794
title Fedora Core (2.6.20-1.2948.fc6)
root (hd0,0)
kernel /vmlinuz-2.6.20-1.2948.fc6 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.20-1.2948.fc6.img
title Fedora Core (2.6.18-1.2798.fc6)
root (hd0,0)
kernel /vmlinuz-2.6.18-1.2798.fc6 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.18-1.2798.fc6.img
Fedora Core's menu.lst file after:
Code:
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
# initrd /initrd-version.img
#boot=/dev/hda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
vga=794
title Fedora Core (2.6.20-1.2948.fc6)
root (hd0,0)
kernel /vmlinuz-2.6.20-1.2948.fc6 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.20-1.2948.fc6.img
title openSUSE 10.2 - 2.6.18.8-0.3
root (hd0,4)
kernel /boot/vmlinuz-2.6.18.8-0.3-default root=/dev/hda5 vga=791 nolapic resume=/dev/hda2 splash=silent showopts
initrd /boot/initrd-2.6.18.8-0.3-default
title Fedora Core (2.6.18-1.2798.fc6)
root (hd0,0)
kernel /vmlinuz-2.6.18-1.2798.fc6 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.18-1.2798.fc6.img
Please note that with my example, I used the menu.lst from two different computers instead of two different distros on the same computer. Make sure that the drives indicated in both menu.lst files are still correct after you repartitioned the drive during the fedora core installation.
If I had booted up into Fedora core, I would then run "grub-install /dev/hda". Now when I boot, there will be a a menu option for Fedora, SuSE and Windows XP. In the future, I will only update the boot loader for Fedora. Also, make a backup of menu.lst on a floppy or usb drive so that you can restore it if Ubuntu or Windows overwrites the MBR on you.
If I had booted up into Ubuntu, I would chroot to the directory where the fedora core's root directory is mounted and then run
grub install.
Code:
sudo /usr/sbin/chroot /mnt/
/bin/bash -l
grub-install /dev/hda