Overclock.net banner

1 - 11 of 11 Posts

·
Premium Member
Joined
·
16,927 Posts
Discussion Starter #1
previously my setup was as follows

160gb - empty
320gb - win vista
640gb - win7

i installed Ubuntu onto the empty 160gb drive and now, the Vista option in GRUB points me to Win Vista on my 320GB drive, and so i can't load my Win7 install. any way to fix this? i have a copy of the vista and Win7 install disks, as well as an ubuntu 8.10 install disk if needed.
 

·
Banned
Joined
·
11,136 Posts
The Grub is the culprit. My son could help you with this more than I. He had the same thing happen when he had triple boot XP Pro Vista Ubuntu. Owch... this is a tough one.

Just contacted him via Phone call. He had to have a programmer help him out. He said that the solution was online but not sure where.

Sorry.
 

·
Banned
Joined
·
11,136 Posts
From FreeOS.com

Quote:
GRUB can be obtained from ftp://alpha.gnu.org:/gnu/grub/. The official page where you can look for documentation and FAQ's is http://www.gnu.org/software/grub/. According to the site, the software hasn't been released publicly and the various releases are merely test releases. We haven't faced problems setting up and booting GRUB but there are several known bugs and missing features that might trip you up. The latest release as of writing this article is 0.5.96.1 and this is what we'll be using here.

Installation

Simply un-tar the file somewhere.

bash-2.04$ tar zxvf grub-0.5.96.1.tar.gz

Enter the directory "grub-0.5.96.1" and run the following sequence of commands there

[email protected]:/tmp/grub-0.5.96.1 > ./configure
[email protected]:/tmp/grub-0.5.96.1 > make
[email protected]:/tmp/grub-0.5.96.1 > su -c "make install"

Configuration

GRUB provides a menu-based interface that you can use. By default GRUB will install into /boot/grub and the configuration file will also reside there. The default configuration file is menu.lst. This is the GRUB equivalent of lilo.conf. This is the file where you define the various boot options, boot images etc.

A sample menu.lst file is given below

timeout 5
color black/yellow yellow/black
default 0
password freeos

title My Linux
kernel (hd0,1)/vmlinuz root=/dev/hda3 idebus=66

title Another Distro!
kernel (hd0,6)/boot/vmlinuz root=/dev/hda7 idebus=66

title Windows
root (hd0,0)
makeactive
chainloader +1

Let's look at the configuration options given here

timeout - The delay in seconds before the default entry is booted.

color - The color combination for the menu. The first entry is the foreground and background color of an entry in the menu and the second is the color combination to be used when a entry is highlighted.

default - The default entry that will be booted after the timeout value is reached. Here we've given '0' as the default. This means that the first boot entry will be used. GRUB counts up from '0' and not from '1'. So the first entry would be '0' and the second '1'.

password - This is the password to be used if someone wants to access GRUB's advanced features at boot. GRUB puts some very powerful features at your disposal because of its ability to read filesystems. For example, at the grub boot prompt, someone can just type 'cat /etc/shadow' and read your shadow passwords -- without even booting into your system! Using a password restricts such actions to authorized users only. This password will also be used to prevent booting of other users.

Now come the boot entries. Each boot entry starts with the keyword 'title', followed by any string that describes that entry. Next are the 'kernel' entries. We've not worked with the BSD's, but the process of booting the BSD's is very well documented in the texinfo manual. For the moment, we're sticking with Linux.

kernel (hd0,1)/vmlinuz root=/dev/hda3 hdc=ide-scsi

The line above is pretty self-explanatory but for GRUB's naming convention of your devices. Floppy drives become (fdx) and hard drives become (hdx) where 'x' is the number of the device. One thing to remember is that GRUB counts up from '0' and not '1'. hd0 represents the first hard drive and hd1 the second. All device names are enclosed within brackets. Further, hard drive partitions are specified with a comma separating the two. e.g - (hd0,1) means second partition on the first device. Similarly, (hd1,5) refers to the first logical partition on the second hard drive.

GRUB can read most filesystems, and in the above line we set it up so that GRUB looks for the kernel in (hd0,1), which is the second primary partition on the first hard drive and the file '/vmlinuz'. You will also have to give 'root=/dev/hda3' or wherever your root filesystem lies, otherwise the kernel will not be able to mount the root filesystem. After this, you can put in any parameters that you want to pass to the kernel. These parameters are specified, as they would be when using LILO.

The other entry you will see here for booting Windows. This entry is a little different. The root entry here points to the root partition (c
of your DOS/Windows installation. The next entry sets the active flag on the partition. The final entry tells GRUB to grab the first sector of the partition -- booting the OS there.

This was the configuration of the most common dual-boot setup for GRUB. Now you have to install GRUB as your boot loader. Keep a LILO floppy or a rescue disk in hand before you do so.

grub-install /dev/hda

Login as root and run the command "grub". You will then be looking at the following

GRUB version 0.5.96.1 (640K lower / 3072K upper memory)

[ Minimal BASH-like line editing is supported. For the first word, TAB
lists possible command completions. Anywhere else TAB lists the possible
completions of a device/filename. ]

grub>

This is the grub prompt that we will use to install GRUB on the hard drive. There's one long and complicated command-line that we're going to use.

grub> install (hd0,1)/boot/grub/stage1 d (hd0) (hd0,1)/boot/grub/stage2 p (hd0,1)/boot/grub/menu.lst

GRUB is divided into 2 major stages: stage1 and stage2. Stage1 is the tiny code that is embedded into the MBR. Stage2 is the main component here and handles everything else after Stage1 transfers control to it at boot-up.

The relevant parts of the command-line here are the first parameter given after 'install'. This should point to the location of stage1 on your hard drive. As you can see, we're using the full drive notation as well as pointing to a specific directory on the partition. This is possible because GRUB can read filesystems. The 'd' parameter means that Stage1 will look for the disk where Stage2 is installed. (hd0) is the location where GRUB will be installed to. Since we want to use it as our primary boot loader, this means that it will install to the MBR. You can also point it to the root partition of your filesystem. The next parameter is the location of Stage2. This is also specified in the same manner as for Stage1. Then comes 'p' followed by the location of the configuration file menu.lst.

One problem that could arise with the above notation is if /boot is a separate partition. Let's say (hd0,1) (hda2), is being mounted as /boot on your system. (hd0,2) (hda3) is your root partition. The above installation would have to be modified to the one below. You cannot say (hd0,2)/boot/grub/stage1 because GRUB does not know that (hd0,1) is mounted as /boot on your system. In this case, you will have to point first to the partition that is mounted as /boot and then to the grub directory under it.

grub> install (hd0,1)/grub/stage1 d (hd0) (hd0,1)/boot/grub/stage2 p (hd0,1)/grub/menu.lst

Reboot and you will have a decent GRUB menu in your hands. In case of any configuration problems you can check the web site or the locally installed documentation. The manual pages are in texinfo format so use 'info grub' to get to the real detailed documentation ('man grub' will give you very basic information).

This was a installation guide to GRUB. We're leaving it in place for a while as we evaluate the pros and cons of using this over LILO. It's not difficult to configure or install but if LILO is working fine then you probably should leave that as is. On the other hand, GRUB has some neat and powerful features that should be explored further.

GRUB Home
 

·
Banned
Joined
·
11,136 Posts
I found this on Google. (How to Modify Grub)

Quote:
Howto Modify Grub and Menu List

--------------------------------------------------------------------------------

If you are adding partitions and installing other Linux distros, you will have had problems with either GRUB or the menu.lst.

This guide shows you how to add distros to the menu.lst so that they are bootable from GRUB at startup.

Quote:
================================================== =====================
This is an example of how to use the GRUB edit function.

Highlight the menu entry you want to edit, then press 'e', then
highlight the line you want to edit and press 'e'. Add what
you want to the line 'hdd=scsi' etc. and press enter, then
'b' to boot.

Examples of the difference between Linux and GRUB device names.

1st Physical Hard Disc
Linux IDE: GRUB IDE: Linux SCSI: GRUB SCSI:
/dev/hda1 ----(hd0,0)----- /dev/sda1-------(hd0,0)
/dev/hda2 ----(hd0,1)----- /dev/sda2-------(hd0,1)
/dev/hda3 ----(hd0,2)----- /dev/sda1-------(hd0,2)
/dev/hda4 ----(hd0,3)------/dev/sda2-------(hd0,3)

2nd Physical Hard Disc
Linux IDE: GRUB IDE: Linux SCSI: GRUB SCSI:
/dev/hdb1---- (hd1,0)----- /dev/sdb1------ (hd1,0)
/dev/hdb2---- (hd1,1)----- /dev/sdb2------ (hd1,1)
/dev/hdb3---- (hd1,2)----- /dev/sdb1------ (hd1,2)
/dev/hdb4---- (hd1,3)----- /dev/sdb2-------(hd1,3)

These are some examples of how to use GRUB from the command prompt.

Press the 'c' key for the command prompt.

If you want to boot a Linux system on a partition, using it's kernel
/boot/vmlinuz etc., do this.

grub> root (hd0,1)
grub> kernel /boot/vmlinuz root=/dev/hda2 ro
grub> boot

(you can also copy and paste the above (minus the "grub>" to the menu.lst)

You could do this to find what partition the kernel is on.
For example, show me what partitions have a /boot/vmlinuz.

grub> find /boot/vmlinuz
(hd0,1)
(hd0,2)

If you want to boot a Dos/Win partition, do this.

For example, boot partition on /dev/hda1.

grub> rootnoverify (hd0,0)
grub> makeactive
grub> chainloader +1
grub> boot

If you want to boot a FreeBSD partition using /boot/loader.

For example, boot freebsd partition on /dev/hda4.

grub> root (hd0,3,a)
grub> kernel /boot/loader
grub> boot

If that doesn't work, try this instead.

grub> rootnoverify (hd0,3,a)
grub> chainloader +1
grub> boot
================================================== ============

Press the [Esc] key to return to the GRUB menu.

I regularly test and install new distros and knowing how GRUB works makes life a whole lot easier.

Whe you install Linux, the Grub install at the end should detect all other operating systems on your PC, but sometimes it doesn't, no problem just add it manually.
If you only want to add an already installed distro so that it boots at startup, (maybe you already have Linux installed and now you are installing a second Linux).

Do this in the terminal :-

Quote:
sudo nano /boot/grub/menu.lst

This will show you a list of all the OS's that can be booted from GRUB.

You now only have to copy the same format, below, after the last OS.

For example, on your harddrive, you have just installed another linux distro on partition 3. You would add this to the menu.lst

Quote:
title Debian Sid
root (hd0,2)
kernel /boot/vmlinuz-2.6.20-4-486 root=/dev/hdc3 ro
initrd /boot/initrd.img-2.6.20-4-486
savedefault

Remember that you NEED to know the kernel and initrd.image numbers, above is 2.6.20-4-486, otherwise it won't boot. Some linux distros only put "vmlinuz" and "initrd.img".

To find this out, you need to take a peek in the boot folder of the new partition. Like this:-

Quote:
cd /dev/hdc3/boot

Then to see it's contents, type:-

Quote:
ls

You can now copy those numbers onto the menu.lst.

To save the file press Ctrl + X then typ "Y" for yes and hit "Enter".

You should now see the other operating system on the list when you reboot the computer.

--------------------------------------------------------------------------------
Last edited by richbarna; March 30th, 2007 at 10:37 AM..
 

·
Premium Member
Joined
·
16,927 Posts
Discussion Starter #7
ok, i'll try with EasyBCD first and then have a shot at manually editing GRUB. thanks a lot guys
 

·
Registered
Joined
·
2,167 Posts
Easy BCD won't do anything to grub.

press Alt+F2 in ubuntu, type gksudo gedit. Open the file /boot/grub/menu.lst

Scroll to the part where it says windows. It will have something like this:

title Windows Vista
root (hd1,0)
makeactive
chainloader +1

Rename that Windows 7. Copy it and paste it onto a new line, call it Vista. Now look at the line that says root, both on windows and on the ubuntu entry which should be above it. ubuntu will probably be root (hd0,0) and windows will probably be (hd1,0). Vista's partition will then be (hd3,0). I'm not sure what all of your disks will be labeled as, but there will be a combination of the 3 hard drives. Save the file and reboot, and you should be good to go.
 

·
Premium Member
Joined
·
16,927 Posts
Discussion Starter #10
nope, it didn't. the GRUB bootloader is still there

i'm trying H33b's suggestion now
 
1 - 11 of 11 Posts
Top