LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   add other linux distros to grub (https://www.linuxquestions.org/questions/linux-newbie-8/add-other-linux-distros-to-grub-647540/)

james2b 06-06-2008 09:05 PM

add other linux distros to grub
 
I have Fedora 9 installed on a external SATA drive with a separate /boot partition and the grub installed on that drive. My internal drive has both windows XP and a few other Linux installed, but after I had to run fixmbr, I then lost capability to boot into these other Linux's, but XP boots fine.So how can I manually add these to the Fedora's grub file (grub.conf)? Here is my current grub file after a fresh install,

# 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/sdb2
# initrd /initrd-version.img
#boot=/dev/sdb
default=0
timeout=15
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Fedora (2.6.25.3-18.fc9.i686)
root (hd0,0)
kernel /vmlinuz-2.6.25.3-18.fc9.i686 ro root=UUID=50b5fde3-f83e-4666-a1d4-76f206f58685 rhgb quiet
initrd /initrd-2.6.25.3-18.fc9.i686.img
title Fedora (2.6.25-14.fc9.i686)
root (hd0,0)
kernel /vmlinuz-2.6.25-14.fc9.i686 ro root=UUID=50b5fde3-f83e-4666-a1d4-76f206f58685 rhgb quiet
initrd /initrd-2.6.25-14.fc9.i686.img
title Other
rootnoverify (hd1,0)
chainloader +1

yancek 06-06-2008 09:53 PM

It's not clear from your post if you can boot the new install of Fedora or only xp? Were you previously booting with Grub? From a previous Fedora install? When you re-installed Fedora, did you install Grub to the mbr?

james2b 06-06-2008 11:30 PM

Yes I can boot into both XP and Fedora, this is done by hitting F10 key and then selecting the external hard drive as first boot device, (to boot into the Fedora) and for XP, I just boot the PC and it starts windows. Before I was useing a grub installed on the internal drive MBR, but now since the fix of MBR, I choose to install the Fedora grub boot loader on the same hard drive as Fedora,(the external eSATA/USB drive), which has a separate partition as; /boot, as well as for / (root).

yancek 06-06-2008 11:43 PM

Depends how you want to do it. You may be able to change your drive order in the BIOS to boot from the external drive first if you want to boot from Grub or you could continue to boot the way you do. You could also install Grub to the mbr of the first drive. If you have other Linux distros and a separate boot partition you will need to have the vmlinuz and initrd files from each in the separate boot partition and appropriate entries in the grub.conf file of Fedora. Can't give you any more specifics as I don't know your partition structure.

I assume you don't have a copy of the grub.conf file you were previously using? You could post the results of the "fdisk -l" command and indicate what distro you have on each partition and post the results of the "ls -l" command in the /boot partition of each distribution you have and someone should be able to give you specific instructions for your entries.

Larry Webb 06-07-2008 03:58 AM

You need to find your original /boot/grub/menu.lst. Then you can get back your original boot menu and add a entry for you usb drive. Find the the menu by using terminal as root

find /boot/grub/menu.lst

Also as yancek mentioned give us your fdisk -ls.

james2b 06-08-2008 04:40 AM

Here is my fdisk -ls partitions;
the external eSATA/USB drive is the first one, as /sda, and Fedora 9 is on /sda1 as /boot and on sda2 as /, no other Linux in now installed there, and sda5 and sda10 are only for storage. And for the internal IDE drive; windows XP is on sdb1, with 3 Linux distros on sdb2,5,6, which are in order these distros; PClinuxOS, Ubuntu 8.04, Mepis 6.5

Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x826d56f6

Device Boot Start End Blocks Id System
/dev/sda1 * 1 26 208813+ 83 Linux
/dev/sda2 1959 3916 15727635 83 Linux
/dev/sda3 6201 16970 86510025 f W95 Ext'd (LBA)
/dev/sda4 27 1958 15518790 83 Linux
/dev/sda5 14164 16970 22547227+ 7 HPFS/NTFS
/dev/sda6 6201 6722 4192902 82 Linux swap / Solaris
/dev/sda7 6723 8680 15727603+ 83 Linux
/dev/sda8 8681 10638 15727603+ 83 Linux
/dev/sda9 10639 12596 15727603+ 83 Linux
/dev/sda10 12597 14163 12586896 b W95 FAT32

Partition table entries are not in disk order

Disk /dev/sdb: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x89518951

Device Boot Start End Blocks Id System
/dev/sdb1 * 534 10976 83883397+ 7 HPFS/NTFS
/dev/sdb2 10977 13587 20972857+ 83 Linux
/dev/sdb3 13588 24321 86220855 f W95 Ext'd (LBA)
/dev/sdb5 13588 15545 15727603+ 83 Linux
/dev/sdb6 15546 17503 15727603+ 83 Linux
/dev/sdb7 17504 18064 4506201 82 Linux swap /

Larry Webb 06-08-2008 06:21 AM

With this many partitions I presume you will be adding and upgrading distros, I suggest that you boot indirectly (chainload). To do this you need to find 500 meg to make a fat partition to install grub. The beauty of this is that you can change or upgrade distros without changing the boot menu. If not you need to give us you /boot/grub/menu.ls and which partition it resides in now.

http://www.justlinux.com/forum/showt...hreadid=147959

james2b 06-09-2008 01:55 AM

All right then thanks for the information. When I installed Fedora 9 on the external SATA/USB drive, during the grub boot loader install procedure, I selected grub to be installed on this same drive, (so not on the internal hard drive), and it suggested I use a separate small /boot partition, so I did, and so is my grub boot loader installed in the MBR of this external drive, right? And I will read Saikee's post at www.justlinux.com , thanks.

Larry Webb 06-09-2008 06:29 AM

If grub is installed on the external drive in order to use grub you need to go into your bios and make your external drive first in the boot order. There is no problem doing this if you have a later model computer that will boot usb. If there is any way I would make about a 200 meg partition on my internal drive. If it has windows on it make sure and defrag before resizing the partition.

james2b 06-11-2008 06:53 PM

So now if I want to boot into Fedora on the external drive, I just press the F10 key early in the boot process, then select a boot first device under the hard drive category, (change from the internal to external hard drive), then the Fedora grub boot menu comes on screen. But now I realize that I may have a drive mapping issue, and after I did some partitioning changes, the swap file has changed. Is there a easy way to edit a file to correct the swap file partition number in each Linux distro ? Also I think that the internal IDE drive should been seen as hda not as sda. And Fedora has the drives switched in order, so it thinks (hd0,0) is the external drive, but originally my internal IDE was seen as first. SATA drives are seen as SCSI drive type, right? So it should be hda, and sda, or in grub speak, hd0, and hd1, correct ? thanks

yancek 06-11-2008 07:57 PM

Did you have your internal drive plugged in when you installed Fedora to the external? That may be why it sees the external as (hd0).

Some newer releases of Linux use sda for all drives, IDE, SATA, SCSI.

I don't think you have Grub installed to the mbr of your external drive which Linux sees as sda so that's why you have to boot the way you do. I expect if just install Grub to the mbr of the external it would solve this problem.

james2b 06-11-2008 08:59 PM

Yes I did have both internal and external hard drives connected during the Fedora 9 install. I had just finished fixing the master boot record and then rebuilding the partition table also, on the internal IDE drive, due to a issue of neither XP or Linux was booting. I had heard that Ubuntu 8.04, that new version install will clear your partition table, and it's a bug to be fixed we hope. I used a tool called Test Disk, to detect and fix both internal and the external drives partition tables. After this I used the GParted partition tool to modify some of my partitions on both drives, which changed the partition numbers some, (such as the swap file).


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