LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu
User Name
Password
Ubuntu This forum is for the discussion of Ubuntu Linux.

Notices


Reply
  Search this Thread
Old 03-23-2007, 05:15 PM   #1
gtyrrell
LQ Newbie
 
Registered: Mar 2007
Posts: 11

Rep: Reputation: 0
Ubuntu newbie -- GRUB failure?


Okay, been fighting this for a few hours now. Attempting to install Dapper Drake from an AMD64 Desktop CD.

I have a Windows XP installation I'm trying to preserve with a dual boot. Ubuntu installation appears to run smoothly, but at the point where I'm instructed to reboot without the CD, the machine boots directly into XP -- no evidence of GRUB doing its thing.

List of partitions (SATA drives):


/dev/sda5 through 8: NTFS
/dev/sda9: FAT32 for sharing (14GB)
/dev/sda10: linux swap (1GB)

/dev/sdb5 through 8: NTFS
/dev/sdb9: FAT32 (14GB)
/dev/sdb10: linux swap (1GB)

/dev/sdc1: Windows XP boot
/dev/sdc2: ext3; root assigned to this space (5GB)


Looking at Gparted, I can see 2GB of data on the ext3 partition, and the swaps are formatted. Booting into the Linux Rescue CD and poking around, I can see the /boot/grub/* files; the menu file appears to be fine.

Lastly, I tried copying the boot info to a file and adding it to the Windows bootloader -- that allows me to choose Ubuntu, but it just leads to a blank screen and no progress.

Any help greatly appreciated.
 
Old 03-23-2007, 11:37 PM   #2
tidiman07
Member
 
Registered: Apr 2006
Distribution: Kubuntu 8.04
Posts: 129

Rep: Reputation: 15
When you installed Ubuntu, which disk did you install grub in? It seems grub was not installed, i have never tried to add ubuntu to windows boot loader and i heard its not an easy task. To install grub, which will automatically have windows in the boot loader, use the live linux rescue disk and start a terminal
Then in terminal type:
Quote:
sudo grub
It should start the grub subsytem in terminal.
Quote:
Grub> root (sd2
after you type sd2 press tab key and it should list the partitions available, look for one with Ext3 filesystem
Quote:
Grub> root (sd2,1)
something like that, then it will display some info about where grub is located in that partition,
Quote:
Grub> setup (sd2,1)
to install grub and then reboot.

Last edited by tidiman07; 03-23-2007 at 11:39 PM.
 
Old 03-24-2007, 12:55 PM   #3
gtyrrell
LQ Newbie
 
Registered: Mar 2007
Posts: 11

Original Poster
Rep: Reputation: 0
Quote:
When you installed Ubuntu, which disk did you install grub in?
I wasn't given a choice. First time through, I thought I did something wrong. Second time through I paid very close attention, and at no point was I prompted to install GRUB. There were messages that GRUB was being installed, and configured, but control never came back to me until I was prompted to reboot without the Desktop CD.

I will try your suggestion and report back.

For the record, adding Ubuntu to the Windows bootloader wasn't difficult, just a bit time-consuming.
 
Old 03-24-2007, 01:13 PM   #4
gtyrrell
LQ Newbie
 
Registered: Mar 2007
Posts: 11

Original Poster
Rep: Reputation: 0
Okay, started up the Linux Rescue CD; it put me in as root, and "sudo" was giving me errors (wanted to "correct sudo as _sudo"). Did the following:


14:02 root@sysresccd /root% grub

grub> root (sd2[tab]
Error 23: Error while parsing number
grub> root ([tab]
Possible disks are: hd0 hd1 hd2
grub> root (hd2,[tab]
Possible partitions are:
Partition num: 0, Filesystem type unknown, partition type 0x7
Partition num: 1, Filesystem type is ext2fs, partition type 0x83


Note: That partition was created as ext3, not ext2; just verified in Gparted that it actually is ext3.


grub> root (hd2, 1)
Filesystem type is ext2fs, partition type 0x83


I'm not sure if that counts as showing where GRUB is located in the partition (doesn't look like it to me), so I quit at that point. Any advice or guidance greatly appreciated.
 
Old 03-25-2007, 09:30 PM   #5
tidiman07
Member
 
Registered: Apr 2006
Distribution: Kubuntu 8.04
Posts: 129

Rep: Reputation: 15
Thats shows where ubuntu is installed. Now what is your primary boot device? lets assume its the first hard drive, hd0. You would want to install grub there,
Code:
grub> setup (hd0)
This would install grub to first HDD. when you reboot grub menu should come up- assuming you boot from first HDD.
 
Old 03-25-2007, 10:21 PM   #6
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
O.K., looks like hd2 is correct given the partition count. Don't worry about your ext3 showing as ext2 - ext3 is merely ext2 with a journal.
Nothing is wrong.
The root command (of itself) doesn't prove anything - except that grub recognised the partition. In your case this will be the right partition, but you should try (from the grub prompt) "find /boot/grub/stage2" to be sure.
The setup command tidiman07 gave you will install to the MBR of the BIOS boot disk, and you should be right to go.
 
Old 03-26-2007, 07:32 AM   #7
gtyrrell
LQ Newbie
 
Registered: Mar 2007
Posts: 11

Original Poster
Rep: Reputation: 0
Thanks to everybody for the advice; I'll have time to mess with this in a couple of days, and will report back on how it works. From everything I've read, my experience has been the exception to how Ubuntu normally takes care of all of this flawlessly. At least it's a learning experience.
 
Old 03-30-2007, 05:06 PM   #8
gtyrrell
LQ Newbie
 
Registered: Mar 2007
Posts: 11

Original Poster
Rep: Reputation: 0
Right, following the instructions above, I booted the Linux Rescue CD, hopped over the "grub" prompt, and followed syg00's suggestion:

Quote:
grub> find /boot/grub/stage2
(hd2,1)
... which was what we expected. Used tidiman07's setup command:

Quote:
grub> root (hd2,1)
Filesystem type is ext2fs, partition type 0x83

grub> setup (hd2,1)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/e2fs_stage1_5" exists... yes
Running "embed /boot/grub/e2fs_stage1_5 (hd2,1)"... failed (this is not fatal)
Running "embed /boot/grub/e2fs_stage1_5 (hd2,1)"... failed (this is not fatal)
Running "install /boot/grub/stage1 (hd2,1) /boot/grub/stage2 p /boot/grub/menu.lst"... succeeded
Done.
Quit grub, rebooted without the CD
... and straight into Windows. No grub menu.

Verified in BIOS that the boot drive is the one that I think it is (easy determination: there are 2x80GB drives and 1x40GB, and it's the 40GB drive that's got Windows boot and Linux root on it).

I'm stumped. Any suggestions?
 
Old 03-30-2007, 08:36 PM   #9
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Quote:
Originally Posted by gtyrrell
Used tidiman07's setup command:
No you didn't - you used your own variation of the setup.
If you ask for help, perhaps you should accept it when offered.

What was suggested puts the loader record in the MBR, what you did puts it in the partition - with no way to reference it.
 
Old 03-31-2007, 12:18 PM   #10
gtyrrell
LQ Newbie
 
Registered: Mar 2007
Posts: 11

Original Poster
Rep: Reputation: 0
Tidiman's suggested syntax from 24 March:
Quote:
Grub> setup (sd2,1)
to install grub and then reboot.
Tidiman's suggested syntax from 25 March:
Quote:
grub> setup (hd0)
This would install grub to first HDD. when you reboot grub menu should come up- assuming you boot from first HDD.
As they both are listed as "install[ing] grub", I'm sorry that I didn't appreciate the difference between two nearly-identical commands. I will try:

Quote:
grub> setup (hd2)
since my boot isn't on the first HDD, but the third. Either way, I'll let you know how it works.
 
Old 03-31-2007, 12:36 PM   #11
gtyrrell
LQ Newbie
 
Registered: Mar 2007
Posts: 11

Original Poster
Rep: Reputation: 0
Getting closer

Rebooted after installing grub to the MBR, and the grub menu actually displayed.

Chose "Ubuntu, kernel 2.6.15-26-amd64-generic" and hit enter. Result:

Quote:
Booting 'Ubuntu, kernel 2.6.15-26-amd64-generic'

root (hd2,1)

Error 22: No such partition

Press any key to continue...
Tried the next choice on the menu, got:

Quote:
Booting'Ubuntu, kernel 2.6.15-26-amd64-generic (recovery mode)'

Error 18: Selected cylinder exceeds maximum supported by BIOS

Press any key to continue...
Next choice:

Quote:
Booting "Microsoft Windows XP Home Edition;

Error 18: Selected cylinder exceeds maximum supported by BIOS
Rescue CD copy of GParted shows the ntfs partition, /dev/sdc1 (aka hd2,0), still has the boot flag, and the ext3 partition, /dev/sdc2 (aka hd2,1) does not. Exited the Rescue CD, rebooted and got the following:

Quote:
Booting "Microsoft Windows XP Home Edition;

root (hd2,0)
Filesystem type unknown, partition type 0xf
savedefault
makeactive

Error 12: Invalid device requested

Press any key to continue...
Help?
 
Old 03-31-2007, 05:47 PM   #12
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
First, sorry for the remark. Flipping back I only saw the latter offering from tidiman07. My bad.

Sooo ...
Which device did you do the setup to - hd0 or hd2. And did you boot straight afterwards ???. Also can we see the contents of /boot/grub/device.map.

From the grub menu, hit <c> to go to command prompt, and do the find for stage2 again - what does it show now ???.
 
Old 04-01-2007, 08:51 AM   #13
gtyrrell
LQ Newbie
 
Registered: Mar 2007
Posts: 11

Original Poster
Rep: Reputation: 0
No worries; I did the setup to hd2, since that's where the Windows boot and Linux ext partitions are.

Following the install (which was listed as successful), I exited grub and rebooted the machine right away.

Booting into grub and hitting <c>, and running find /boot/grub/stage2 gives:

Quote:
hd(0,1)
which doesn't appear to be where I put it.

Contents of /boot/grub/device.map:

(hd0) /dev/sda
(hd1) /dev/sdb
(hd2) /dev/sdc


If I read the Windows boot failure correctly, the root cause of all of this is that I didn't carve out enough space on hd2 for Linux, and so the boot information is too far from the beginning of the drive. To be perfectly honest, right now my priority is getting bootability into Windows back; once that's restored, I'm happy to do whatever kind of start-from-scratch install is needed for the next attempt at getting Ubuntu to work.

As always, advice welcomed.

Edited to add: MBR reset, Windows booting again (good thing, too, since my wife is looking for a job and she apparently updated her CV since the last backups I took).

What I'm going to do is a bit of repartitioning before coming back for advice ... it looks like if I want to keep both Windows and Linux on the same boot drive, I need to make the ntfs partition smaller and get the Ubuntu root closer to the beginning of the drive.

Alternately, I'm considering shifting the 2x80GB HDDs; right now, they're set as mirror images, but I'd be willing to sacrifice the copy for a Linux-only drive (boot, swap, and a big hunk of fat32 for sharing between the two systems). In any event, some hard thinking to do before I take the next steps. Thanks all for your input, and if you have any suggestions I'm grateful for the input.


Gary

Last edited by gtyrrell; 04-01-2007 at 09:23 AM.
 
Old 04-01-2007, 02:05 PM   #14
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,126

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Quote:
Originally Posted by gtyrrell
If I read the Windows boot failure correctly, the root cause of all of this is that I didn't carve out enough space on hd2 for Linux, and so the boot information is too far from the beginning of the drive.
That's what it says. But don't worry doing any repartitioning - won't help.
I expected the result you got from the "find"; just needed confirmation. All the problems you are seeing are due to the "strange" arrangement you have with Windows on the third drive. Almost everything you read will say Windows must be on the first drive or it won't boot (using the M$oft loader). Which is almost true - it must be on the "boot" drive. The BIOS will start looking for a boot record on the first drive, then keep looking until it finds a valid boot record. Once it finds one, that drive becomes the boot (and thus first) drive. Confusing huh.

What we were all suggesting was you do "setup (hd0)" - then you wouldn't have seen these issue. Would probably require some fiddling with menu.lst to get Windoze sorted, but that's easy.

Edit: Added the italic text above for clarity.

Last edited by syg00; 04-01-2007 at 02:12 PM.
 
Old 04-11-2007, 07:35 PM   #15
gtyrrell
LQ Newbie
 
Registered: Mar 2007
Posts: 11

Original Poster
Rep: Reputation: 0
Unexpected work travel, holiday kept me away

But I'm back now.

Thanks for the clarification about setting up grub on hd(0). I'll give that a try this weekend, hopefully -- I want to do some shifting of non-boot partitions first, make sure that I can share data between Windows and Linux.

So that I don't have to pester anybody, what should I be researching so that I can make the anticipated changes to menu.lst? Any good guides you can point me towards?


Gary
 
  


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
Newbie with Login Failure McCorvic Mandriva 1 02-02-2007 09:12 AM
Booting my new ubuntu install = "GRUB GRUB GRUB GRUB GRUB" etc. dissolved soul Ubuntu 2 01-13-2007 12:55 PM
Installed FC5> Wrote over Ubuntu MBR: How do i add Ubuntu Partition to Grub Loader Free_beer Ubuntu 4 10-02-2006 06:11 PM
Newbie here, Linux Ubuntu V 5:10. GRUB error 18 goldretro Linux - Software 1 12-24-2005 12:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Ubuntu

All times are GMT -5. The time now is 04:29 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