![]() |
Grub, Problem with installing to correct area and loading.
Hello,
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:- Code:
Error 15 or "Error 17 : Cannot Mount the selected partition" errors.I have also tried to install grub using 'grub-install' with the following:- Code:
grub-install /dev/sda1Code:
Searching for GRUB installation directory ... found: /boot/grubThis looks encouraging but when I ls the drive there is only the following:- Code:
abi-2.6.24-19-generic i.e. the Kernel images are there, but no way of loading them. Code:
grub-install --root-directory=/boot /dev/sda2I tried mounting sda1 to mnt and then doing:- Code:
machine_name:/mnt# grub-install --root-directory=/mnt /dev/sda1Code:
fdisk /dev/sda > p 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! Many Thanks, Max. |
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: title Ubuntu root (hd1,0) ...##This is Grub's way of saying 2nd drive, 1st partition kernel /boot/vmlinuz...... root=/dev/sdb1 ro initrd /boot/initrd.... boot 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?
|
Thanks pixellany,
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:- Quote:
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. Max. |
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.
http://users.bigpond.net.au/hermanzo...boot_partition I'd agree with amani about chainloading being the easiest. |
Hi guys,
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? Thanks, Max. |
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.
|
|
| All times are GMT -5. The time now is 06:36 AM. |