LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-30-2010, 02:43 PM   #31
windows22
LQ Newbie
 
Registered: Mar 2009
Posts: 26

Original Poster
Rep: Reputation: 15

I don't have GRUB 2 though do I? It says 0.97. What version is the GRUB you kindly provided?

I have no idea of the Linux device numbers - as I say Ubuntu is totally unhelpful here in revealing what you have. If you still have the patience (!) I would suggest you could tell me what to type from the prompt when I run your CD. Isn't it better to put grub in Windows if so what do I type. I have no idea what a chainload is. I will try to read some of the docs but the point is this should not be needed. Which link proposes a menu.cfg file?

Certainly Linux needs to sort this out, totally unacceptable and a core failure if dual booting consistently does not work. Thanks everyone.
 
Old 08-30-2010, 06:51 PM   #32
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: Slackware, Ubuntu, PCLinux,
Posts: 10,506

Rep: Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490Reputation: 2490
Just realized I neglected to post the link for the Grub2 tutorial. There is also a link on the page for a tutorial on Grub Legacy. Here it is:

http://www.dedoimedo.com/computers/grub-2.html

Quote:
I don't have GRUB 2 though do I? It says 0.97. What version is the GRUB you kindly provided?
That is Grub Legacy. The problem is that all of your kernel entries for Ubuntu are for 10.04 which uses Grub2 by default and I believe (?) ext4 filesystem.

Quote:
Isn't it better to put grub in Windows if so what do I type.
Definite NO!

To boot Ubuntu and w98, your current setup, you have to have Grub stage1 in the master boot record. W98 will not be able to boot Ubuntu, in fact, I don't think it can boot later versions of windows on its own?? Also, you do not want any Grub files in a windows partition.

Quote:
I have no idea what a chainload is
Chainload refers to Grub pointing to a specific place on a hard drives partition to look for bootloader files rather than attemtpting to boot the partition filesystem. This is what Grub does with windows partitions. It does not actually boot them.

Quote:
Which link proposes a menu.cfg file?
What?? Grub has either a menu.lst file (Grub Legacy) or a grub.cfg file (Grub2), AFAIK there is no "menu.cfg" file.

Your default installation of Ubuntu 10.04 not having the default bootloader files is likely a problem. Check the tutorial. I've not used Grub 2 as I prefer to stay away from test software.

Also,what are hardware specs (actually just RAM) on your computer?
 
Old 08-30-2010, 09:54 PM   #33
Erik_FL
Member
 
Registered: Sep 2005
Location: Boynton Beach, FL
Distribution: Slackware
Posts: 821

Rep: Reputation: 258Reputation: 258Reputation: 258
Quote:
Originally Posted by windows22 View Post
I don't have GRUB 2 though do I? It says 0.97. What version is the GRUB you kindly provided?

I have no idea of the Linux device numbers - as I say Ubuntu is totally unhelpful here in revealing what you have. If you still have the patience (!) I would suggest you could tell me what to type from the prompt when I run your CD. Isn't it better to put grub in Windows if so what do I type. I have no idea what a chainload is. I will try to read some of the docs but the point is this should not be needed. Which link proposes a menu.cfg file?

Certainly Linux needs to sort this out, totally unacceptable and a core failure if dual booting consistently does not work. Thanks everyone.
I provided version 0.97 of GRUB. I believe what you have now is version 1.97 (GRUB 2). Synaptic will show you the grub package installed on the disk, but that might not be the same as the grub actually installed for booting. Press "Esc" during booting, and then look at the version displayed by GRUB.

Using my boot CD, you can find the correct device numbers with the "find" command. Keep in mind that those device numbers are only correct for my version of grub and not GRUB 2. You will need to know the exact file names and folder names.

find /vmlinuz
find /io.sys


Those commands should print out the device name for the Linux and the Windows partitions.

The "best" version of GRUB is for you to decide. You may have less problem getting help for Ubuntu if you use the normal GRUB 2 that comes with Ubuntu.

If you wish to install my (legacy) version of "grub" the safest thing is to install it in the Windows partition. Ubuntu updates should not modify the Windows partition. Boot from the Ubuntu CD, select the options to run Ubuntu from the CD "Without any change to your computer". Click on "Applications" in the menu, then "Accessories" and then "Terminal". Enter this command to start a root shell.

sudo su -

Type in a command to look at your partition table.

fdisk -l

Create some mount points.

mkdir /mnt/win
mkdir /mnt/cd


Mount the windows partition.

mount -o rw /dev/sda1 /mnt/win

Remove the Ubuntu CD and put in my boot CD.

Mount the CD

mount -o ro /dev/sr0 /mnt/cd

Copy the required files to the Windows partition.

mkdir -p /mnt/win/boot/grub
cd /mnt/win/boot/grub
cp /mnt/cd/install/boot/grub/* .


Edit the "menu.lst" file and add the correct entry for Windows and Ubuntu.

vi menu.lst

or

nano menu.lst

Your "menu.lst" should have entries similar to this in order to boot Windows and Linux.

Code:
title Windows
root (hd0,0)
chainloader +1

title Linux
root (hd0,4)
linux /vmlinuz ro root=UUID=the-disk-id
initrd /initrd.img
or

Code:
title Windows
root (hd0,0)
chainloader +1

title Linux
root (hd0,4)
linux /vmlinuz ro root=/dev/sda4
initrd /initrd.img
Un-mount the Windows partition and GRUB CD.

cd /
umount /mnt/win
umount /mnt/cd


Now you should be able to install the GRUB that is located in the Windows partition. Boot from my GRUB CD.

Type in the commands to install grub to the MBR.

root (hd0,0)
setup (hd0)


Remove the boot CD and restart the computer. You should see the menu for GRUB 0.97. If you have a problem with an entry you can press "e" to edit it (not saved) or "c" to enter boot commands (not saved).

Once you have booted an OS, edit the "menu.lst" file and make corrections.

When you are typing in commands to GRUB to boot manually, follow the commands with the "boot" command. For example:

root (hd0,4)
linux /vmlinuz ro root=/dev/sda4
initrd /initrd.img
boot


You do not use the "title" command when manually entering boot commands. That can only be used in "menu.lst".

To repair the GRUB installation after something changes the MBR you can boot from my GRUB CD again, and repeat these commands.

root (hd0,0)
setup (hd0)


If something changes the GRUB files that you stored in the Windows FAT32 partition you may have to repeat all of the commands including those to copy the files.

As you can see, installing GRUB yourself is not simple and it is easy to make a mistake. I did my best to provide the correct information but I also made some assumptions that could be wrong.
  • I assumed that Ubuntu has "vmlinuz" and "initrd.img" links in the root directory that refer to the correct files.
  • I assumed that your Windows is installed in the first Primary partition and it is FAT32.
  • I assumed that Ubuntu is installed in the first Logical partition.
  • I assumed that Ubuntu is using the device name "/dev/sda" for the hard disk.
  • I assumed that Ubuntu is using the device name "/dev/sr0" for the CD-ROM.

The legacy version of GRUB is not being updated so it may not work with Ubuntu or other Linux distros in the future. There are already patches to support "ext4" and other Linux changes. The version I provided has the "ext4" patch.

I like the legacy version of GRUB because of the ability to search for files using "find" and install grub from the "native" mode that accesses the disk through the BIOS instead of Linux.

Last edited by Erik_FL; 08-30-2010 at 09:55 PM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Want to upgrade Windows Vista to Windows 7 on a Dual Boot machine Ubuntu/Winvista. hector3rd Linux - Desktop 6 08-07-2010 05:33 PM
Booting to Windows 7 from Ubuntu on my dual-boot machine dor Linux - Newbie 3 05-31-2010 02:26 AM
help! dual boot related, cannot boot windows any more, ubuntu is ok parv Ubuntu 16 04-10-2007 12:29 AM
windows boot slow on dual boot machine fobster Linux - Newbie 4 04-21-2006 07:58 AM
Windows on to linux machine dual boot chplat Fedora 2 01-18-2005 03:12 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration