View Full Version : Editing the boot menu thing.

20th May 2008, 07:11 PM
I just installed Ubuntu on another partition. I didn't finish with the installation, I got to the part where it needed to restart and I assume it still needs to finish the installation from the hard drive. My problem is Ubuntu is not showing up in the boot loader thing ( I assume it's called grub from reading other threads). During the installation I chose not to install a boot loader. I read on another thread not to install it or it will overwrite my existing one. I like the one I have now and just want to add Ubuntu to it. I want it to auto load to Fedora if I don't chose to boot to another OS, like it is now. Right now mine currently has 3 options: Fedora, Fedora, Other. Other is XP and I don't care enough to change what it to XP. I'm not sure why there is 2 Fedoras, I assume one is some type of safe mode, but they are both labeled the same; if someone could explain that part it would be appreciated. Basically what I want is everything to stay the way it is now, with Ubuntu added, and keeping the auto boot to Fedora unless I choose another in the 3 seconds it gives me to choose. I don't know how to edit the grub.conf, which I guess is the real problem. Thanks for any help.

Here is my fdisk -l output so you know what partition Ubuntu is on, I assume you're going to ask that:

[root@localhost andrew]# /sbin/fdisk -l

Disk /dev/sda: 40.0 GB, 40007761920 bytes
255 heads, 63 sectors/track, 4864 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xe592e592

Device Boot Start End Blocks Id System
/dev/sda1 * 1 1912 15358108+ 7 HPFS/NTFS
/dev/sda2 3126 3150 200812+ 83 Linux
/dev/sda3 3151 4864 13767705 8e Linux LVM
/dev/sda4 1913 3125 9743422+ 5 Extended
/dev/sda5 1913 3067 9277506 83 Linux
/dev/sda6 3068 3125 465853+ 82 Linux swap / Solaris

Partition table entries are not in disk order

Disk /dev/dm-0: 12.9 GB, 12985565184 bytes
255 heads, 63 sectors/track, 1578 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00000000

Disk /dev/dm-0 doesn't contain a valid partition table

Disk /dev/dm-1: 1073 MB, 1073741824 bytes
255 heads, 63 sectors/track, 130 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x30307800

Disk /dev/dm-1 doesn't contain a valid partition table
[root@localhost andrew]#

I don't really know what is what, I'm hoping you can tell. I think the last ones are the Ubuntu install. Also, I'm using Fedora 8, if that makes a difference.


20th May 2008, 07:13 PM
Also, here is my grub.conf:

[root@localhost andrew]# cat /boot/grub/grub.conf
# 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,1)
# kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
# initrd /initrd-version.img
title Fedora (
root (hd0,1)
kernel /vmlinuz- ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-
title Fedora (
root (hd0,1)
kernel /vmlinuz- ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-
title Other
rootnoverify (hd0,0)
chainloader +1
[root@localhost andrew]#

20th May 2008, 07:19 PM
Basically what I want is everything to stay the way it is now, with Ubuntu added, and keeping the auto boot to Fedora unless I choose another in the 3 seconds it gives me to choose.Hello eman_resu,

Try adding this to the end of the Fedora grub.conf to boot Ubuntu...
title Ubuntu
configfile (hd0,4)/boot/grub/menu.lstP.S.: The extra Fedora menu entry is your old kernel. The default setting is to retain the last kernel after a kernel update. It's a good idea to leave it that way. It comes in handy sometimes.

P.P.S.: I forgot about this part...

I don't know how to edit the grub.conf, which I guess is the real problem.
Open a terminal in Fedora
gedit /etc/grub.conf
Make the edit, save, try it.

20th May 2008, 09:03 PM
I get this:

Booting 'Ubuntu'

configfile (hd0,4)/boot/grub/menu.lst

Error 15: File not found

Press any key to continue...

Also, I have 2 grub.conf files. One is /etc/grub.conf, the other is /boot/grub/grub.conf.
Also, the gedit command is not found, but I edited it in Kwrite as root.

21st May 2008, 01:00 AM
I get this:

Booting 'Ubuntu'

configfile (hd0,4)/boot/grub/menu.lst

Error 15: File not foundHello eman_resu,

I re-read your first post...

During the installation I chose not to install a boot loader.Installing Ubuntu without installing its boot loader will likely result in no menu.lst file being created (look and see). Fedora's anaconda does that exact thing. I forgot about that. Very sorry for the wasted time. You can try this in your Fedora grub.conf...

title Ubuntu
root (hd0,4)
kernel /boot/vmlinuz-[version stuff here] [kernel parameters here]
initrd /boot/initrd.img-[version stuff here]The difficulty is that without a menu.lst file in Ubuntu from which to copy that information, you are going to have to write it in the Fedora grub.conf by hand. You can get the kernel and ramdisk version numbers from the actual files in the Ubuntu /boot directory. For kernel parameters you can look at other examples of Ubuntu menu.lst files on the Internet (I did). A possible example...
kernel /boot/vmlinuz-[version stuff here] root=/dev/sda5 ro quietBut no promises.

Here is another (and better) thing to consider. Re-install Ubuntu just like you did before only this time choose the boot loader option to install GRUB in the first sector of the Ubuntu boot partition. That will not harm your current booting arrangement, but it will result in a menu.lst file being created in the /boot directory. Then the configfile menu command will work in Fedora's grub.conf.

P.S.: About this...

Also, I have 2 grub.conf files. One is /etc/grub.conf, the other is /boot/grub/grub.conf.That's normal. The /etc/grub.conf one is not really a file. It's a link to the /boot/grub/grub.conf file. The same applies to the menu.lst file in Fedora's /boot/grub directory. Both just links to the real file: /boot/grub/grub.conf

21st May 2008, 11:54 PM
A reinstall sounds like the right thing do, however, I'm having trouble. In case it isn't already clear I'm new to this whole Linux thing, it's only been about a month.

I went to reinstall and the Ubuntu install only shows partitions SDA 1, SDA 3, SDA 5, and SDA 6, which confuses me because I tried to delete 5 and it then showed 6 as 5, so I assume it changes it's numbers as I change them, so where's 4? I'm in the Ubuntu Live CD right now and looking at GParted and it shows all of them and SDA 3 as unknown, which I'm pretty sure is Fedora. I attached an image of it. There's probably no actual problem here and I just don't know what I'm looking at.

My problem right now is I have no idea where to reinstall anything. I'd just do the manual and format random partitions but I don't know how to set up Linux partitions. I'm not too worried about destroying any of the partitions other than the Windows. The Fedora partition I can just reinstall, I've only had it a month and haven't added much and backed up my xorg.conf file that took forever to get working. My Windows partition I'd rather not destroy, it's the only legal copy of Windows I've ever owned and I can actually do the Windows updates.

So, I guess what I need is a quick explanation of what's what in my partitions. And I know only one of the partitions around 9 gigs is Ubuntu, because that's about what I gave it for the Ubuntu install. The way I had it set up was 23 gigs being Windows and the rest Fedora. Then I cut Windows Down to 15 and gave that free space to Ubuntu. And now I just have no idea what's going on.

Sorry the image is the whole desktop, I didn't feel like figuring out Gimp.

22nd May 2008, 12:26 AM
I tried to delete 5 and it then showed 6 as 5, so I assume it changes it's numbers as I change them, so where's 4?

...it shows all of them and SDA 3 as unknown, which I'm pretty sure is Fedora.

There's probably no actual problem here and I just don't know what I'm looking at.Hello again eman_resu,

You're right. Nothing is wrong. First your questions...

Yes, the partitions "behind" a deleted partition will renumber. That's a good thing to find out about now because it can wreak havoc on boot loaders and things like that. Boot loaders work by counting partitions "on their fingers". If you change the count, the boot loaders cannot find anything. But you're okay at the moment.

Yes, /dev/sda3 is Fedora. It is shown as "Unknown" in GParted because it is an LVM PV (Logical Volume Management physical volume), and GParted cannot perform any actions on LVM physical volumes (yet). The best way to get rid of an LVM physical volume is either with Linux fdisk or Windows XP Disk Manager. But don't delete yours because nothing is wrong with it and there is no need to do that (yet).

Here is your GParted situation summarized...

You hard drive is 37.26 GiB (gibibytes or binary gigabytes) in size. It is partitioned as follows...

/dev/sda1 is the NTFS Windows partition and is 14.65 GiB in size. It it the active (boot) partition.
/dev/sda2 is the ext3 Fedora boot partition and is 196.11 MiB in size. It contains the Fedora kernels and some GRUB components.
/dev/sda3 is the LVM PV and is 13.13 GiB in size. It contains the Fedora root and swap partitions. In other words, the entire Fedora system is in there.
/dev/sda4 is the extended partition and is 9.29 GiB in size. The extended partition contains the logical partitions. In Linux, the logical partitions always begin numbering at 5. That's because the first four partition numbers are reserved for the four possible primary partitions. The extended partition has no other function than to contain the logical partitions. The extended partition is not always sda4. It could be any of the four primary numbered partitions (sda1, sda2, sda3, sda4). Yours happens to be sda4
/dev/sda5 is a logical partition and is the ext3 Ubuntu partition (I guess). It is 8.85 GiB in size.
/dev/sda6 is a logical partition and is a swap partition. It is 454.94 MiB in size, and I assume it was created with the Ubuntu installation because Fedora's is in the LVM.
/dev/sda5 and /dev/sda6, the two logical partitions, add up to approximately the size of the extended partition. So those two logical partitions completely fill the extended partition. If you had the space available, you could create many more logical partitions in this extended partition. But you can never have more than four primary partitions (the extended partition is counted as one of the primary partitions). See? That is actually why extended partitions were invented by Microsoft and IBM many years ago when it became clear that four partitions were not going to be enough anymore.
The above partitions completely fill this hard drive.

22nd May 2008, 12:44 AM
Thanks. A lot. That helped a lot.

SDA 1 is Windows, SDA 2 and 3 are Fedora. SDA 4 is Ubuntu. I'm just making sure I gathered all this right.

So, if I delete SDA 4 it would delete the two logical partitions which are Ubuntu. I could just delete SDA 4 and reinstall Ubuntu telling it to install in unallocated space, this time installing the boot loader?

22nd May 2008, 12:52 AM
No, /dev/sda4 is the extended partition. Think of it as merely the "container" for the two logical partitions /dev/sda5 and /dev/sda6. Don't try to delete the extended partition /dev/sda4.

I believe /dev/sda5 is Ubuntu. I cannot account for it in any other way. I believe /dev/sda6 is Ubuntu's swap because Fedora's is in that LVM PV. Agreed?

If it helps your thinking about it, you can delete the two logical partitions /dev/sda5 and /dev/sda6 if you agree with me that they are Ubuntu and Ubuntu's swap. But leave the extended partition itself alone because Ubuntu would just have to recreate it. Then re-install Ubuntu back into logical partitions in the extended partition.

You could also not delete anything and just re-install Ubuntu right back into its same partitions. Continued below...

22nd May 2008, 12:53 AM

If re-installing Ubuntu is what you have elected to do, then you should be able to boot the Ubuntu disk and choose the option to re-install it in the same partition. Now I don't use Ubuntu, but I do use Debian from whence Ubuntu came. So just be careful and look through the partition options in the Ubuntu installer for a way to re-install Ubuntu in /dev/sda5 (8.85 Gib). Confirm that I am right that /dev/sda5 is Ubuntu. What else can /dev/sda5 be? Everything else is accounted for. Right?

Anyway, if you can get that part done somehow, then look for and choose an option to install the GRUB boot loader in the first sector of the Ubuntu partition. Again, I can't know the perfect wording for that. But don't choose the master boot record. And don't choose no boot loader at all again.

When you are done and reboot, Ubuntu will not boot at first. But it will when you edit the Fedora grub.conf again and put that Ubuntu section in there with that configfile command just like it was described way back up there in post #3.

I am acutely interested in this and how it turns out. If you have remaining questions, ask now. If not, I will be around all evening (U.S.A.) and be back later.

22nd May 2008, 01:18 AM
I don't think there is an option to reinstall in the same partition. When I tried reinstall earlier it wanted to reinstall there, but not format it and use the whole thing. It wanted to use 2.2 gb of it or something. I'm resarching how to do that now. And yes, sda5 is Ubuntu, I just mounted it and am sure. I'm going to try installing now. I'll post the results.

22nd May 2008, 01:28 AM
Okay. Well, you can still do your idea of using GParted to delete /dev/sda5 then re-install Ubuntu in the unpartitioned space created by doing that. Surely it will do that. You may as well delete the swap, too. Just have Ubuntu recreate them both.

22nd May 2008, 02:18 AM
Everything went well, I'm in Ubuntu now. I ended up deleting 5 and 6, and I think 4, too. I installed using the largest continuous space option. The cool part was I didn't change the grub.conf file back from when I edited it last time from your first post, so when it asked me to restart after the installation I restarted and selected Ubuntu and it went to it's own grub type thing and I hit Ubuntu again. Everything worked very well. Thanks for all the help. I still have questions but they're Ubuntu questions that I probably shouldn't ask here, and I'll see what I can figure out on my own first.

Also, do you know of a good tutorial thing for partitioning online somewhere? Not really a tutorial, just something explaining the basics and some of the options. I never realized how little I know about partitioning until now, Windows never really required it. I always thought there was just one kind of partition, a partition. With different file systems, but still, I didn't know logical partitions existed, and I still don't know why they're used, maybe easier file sharing between the partitions. Thanks again.

22nd May 2008, 03:06 AM

Partitions...partitions...I learned a lot about partitions, primary, extended, logical, and master boot records and extended boot records and GRUB stages from the Starman. You can find him here (http://mirror.href.com/thestarman/asm/mbr/index.html) and branch out through his extensive knowledge and interests in this area. I really don't even know who he is, but the dude is smart and knows a lot of stuff.

If that business is too much for now, I saw this Ubuntu thread about partition basics...


P.S.: One last thing about that configfile GRUB menu command. The main advantage of using it instead of those root, kernel, initrd commands is that your Fedora grub.conf will be immune from Ubuntu kernel updates. See, that configfile command merely reloads the GRUB menu with the information in the Ubuntu menu.lst file. Then you go into Ubuntu from there. When Ubuntu's kernel gets updated and the menu.lst file changes, it will not break your boot loader arrangement. The configfile command in the Fedora grub.conf will just reload the menu with the new Ubuntu menu.lst data. See what I mean? Whereas if you copied the root, kernel, and initrd from the Ubuntu menu.lst into the Fedora grub.conf, then an Ubuntu kernel update would make all of that wrong and it would have to be edited. No big deal really. But some people have lots of distros going and editing a grub.conf every time some kernel gets updated is a big deal to them. Anyway, you are on your way now. Good luck, best wishes, and adieu.

22nd May 2008, 04:06 AM
Thanks a lot, I'll check out the links.

22nd May 2008, 05:39 AM
I got one more question. How do I mount the Fedora partiion? It's SDA3 and I keep getting unknown file system errors. Fdisk shows it as Linux LVM. I guess I have to mount logical volumes differently than I know how.