Grub, Problem with installing to correct area and loading.
I am having major problems with grub.
My setup is:-
A Dell Precision 390.
Two Sata, 160 gig hard drives sda and sdb
I have RHEL5 and Debian on SDB (the Second hard drive) partitions 1 and 2.
I want to put Ubuntu on SDA1 (the first hard drive).
The install process is fine but I cannot get the installer to update the existing grub on sdb which loads RHEL and Debian.
I have tried manually adding an entry to menu.lst for the sdb grub but attempts at booting result in:-
I have also tried to install grub using 'grub-install' with the following:-
This looks encouraging but when I ls the drive there is only the following:-
i.e. the Kernel images are there, but no way of loading them.
I tried mounting sda1 to mnt and then doing:-
sda1 is a 300m boot partition where I would like grub to go.
sda2 is for /
In the BIOS settings there is NO way to specify the hard drive order. SO I tried physically swapping the cables over, but the message stated that it could not find an OS to load ....
Can anyone advise me on what to do here!
I can't follow all those details, so let's start from the beginning.
If you want a drive to be bootable, there must be boot code in the MBR of the drive (the first sector). Putting GRUB on a partition does no good unless there is something that links to it.
Assuming that you can boot into something, all you have to do is edit the appropriate menu.lst to point to the other drive. When GRUB is installed to the MBR, it gets "hard-coded" to point to the partition containing its files. If you don't know where this is, just look at all the possibilities until you see the menu.lst that matches what you see on the GRUB menu at startup.
Once you are booted into a working Linux, then proceed as follows:
fdisk -l ....##to confirm the drive numbering
Locate the correct menu.lst file
lets assume that Ubuntu is on sdb1, and there is no separate /boot partition. The menu.lst entry will look like this:
root (hd1,0) ...##This is Grub's way of saying 2nd drive, 1st partition
kernel /boot/vmlinuz...... root=/dev/sdb1 ro
I always alias the vmlinuz..... and initrd..... filenames to simply "vmlinuz" and "initrd". Then I don't have to know the actual names when setting up menu.lst entries.
Note the two "root" statements: The first one tells GRUB where the boot files are. The second one tells the kernel where to mount "/"--ie the root of the filesystem
More gory details in the "booting" link below
Let us see just plain fdisk -l, it appears that you have linux on sda. Do you want to point grub to its own partition?
I was unclear on the aspect of the MBS pointing to grub.
However, what is strange from this is that I did have a working grub from the original Debian installation. This grub could boot both linuxes of their own (second) hard drive and also boot a windows xp which had previously been on the first (sda) hard disk.
So from this I deduced that this grub can access both disks because it has done on many prior occations.
Soooooo... Surely adding a new entry to menu.lst as you suggested:-
Despite these attempts I kept getting the Error 15 and 17 messages.
I also tried manually doing this when grub loaded and entering the grub shell to type the entries in myself and it still refuses to mount the first hard disk and start the boot sequence off.
Thanks for your feedback though, it has helped clarify several things.
Try to use uuids
Your bios maybe complicating the drive order.
(hd1,0) maybe (hd0,0) relative Ubuntu!
The easiest thing to do is
Install one grub to the MBR.
Install the grub of others to their root partition and chainload them from the original grub.
Your entries with a separate /boot partition are going to be very different than if you install Grub stage1 to mbr and the rest of the Grub bootloader to the root partition. I would suggest you check out and read the information on this link, it's specific to Ubuntu but the info on Grub would be the same.
I'd agree with amani about chainloading being the easiest.
I need to cram up on what you have just posted so let me have a read and I will try and reply asap.
Yancek, I did try running grub-install normally and with the seperate /boot partition after the first approach kept installing the files into a directory inside/boot/ on the already booted sdb drive.
Somewhere along the line here I seem to have got very muddled indeed.
Regarding the chainloading of grubs to grubs. Would this result the first grub menu appearing and then upon a selection, having a second new grub menu appear?
On the chainloading that is right, a second grub menu.lst will appear, but you can almost eliminate it by changing the timeout to 1. You have to make sure the default selection is the os that you want to boot.
You can also hide the menu.....
|All times are GMT -5. The time now is 11:35 AM.|