Fixing UBUNTU BOOT-UP

foozball3000

Executive Member
Joined
Oct 28, 2008
Messages
5,928
Reaction score
1,738
Location
Kyalami
I WAS running Windows and Ubuntu (Each on its own HDD).
Windows needed a fresh install, and after I formatted its HDD, I found that the Install CD stops at 30% during the re-install and Aborts.

As Ubuntu is still on the other HDD, I didn't care much, and decided to call it a day. To my horror, Ubuntu won't boot. It says "BOOT FAILURE. PLEASE INSERT BOOT DISK".
How is this possible as it worked 100% earlier on? And How do I fix it? :confused:
Surely, formatting the slave HDD can't interfere with the master HDD's OS?

I am now running of the Ubuntu CD, and can thus access the Ubuntu installation on the HDD... it seems like everything is still in tact.

I'm completely clueless... please help. I really don't wanna re-install Ubuntu.
 
Seems like it's trying to boot from the half-installed Windows disk?
 
Windows wiped the MBR, you need to reinstall grub.

Ubuntu should have a recovery process where you can choose to install it from scratch or just "fix my setup". Just reinstall the boot loader GRUB and all should be dandy again.

If you do it manually:
From a terminal in the LiveCD:
grub
>root (hdx,y)
>setup (hdx)
>quit

Substitute x,y with the appropriate partitions on your disk.
NOTE: Even serial hd's are seen as hd in grub!

Replace x with one of the following:
Grub Normal
0 hda
1 hdb
2 hdc, etc.

Replace y with:
Grub Normal
0 partition one (ie. hda1/hdb1, etc.)
1 partition two (hda2, hdb2, etc.)
2 partition three (hda3, hdb3, etc.)
 
Why did you install Grub on the MBR (seemingly Windows)? I always install Grub on my Linux partition, it's a million times easier to fix.

Ubuntu has a recovery option in the install menu but I've tried that once... and never again. Mine went on from the recover Grub to do the other things too and I had to format then anyways.

Try the manual console method, or get a System Restore cd (this lovely opensource cd with grub-fix, gparted, etc) and fix it that way.
 
Windows wiped the MBR, you need to reinstall grub.

Ubuntu should have a recovery process where you can choose to install it from scratch or just "fix my setup". Just reinstall the boot loader GRUB and all should be dandy again.

If you do it manually:
From a terminal in the LiveCD:
grub
>root (hdx,y)
>setup (hdx)
>quit

Substitute x,y with the appropriate partitions on your disk.
NOTE: Even serial hd's are seen as hd in grub!

Replace x with one of the following:
Grub Normal
0 hda
1 hdb
2 hdc, etc.

Replace y with:
Grub Normal
0 partition one (ie. hda1/hdb1, etc.)
1 partition two (hda2, hdb2, etc.)
2 partition three (hda3, hdb3, etc.)

Nice explanation. The only other thing I would add is:

To see all your hard disks type:
grub> root (hd then hit the <Tab> key to auto-complete.
GRUB will then offer you available boot devices it can see.

To see all your partitions on one of your hard disks type: (for example hd0)
grub> root (hd0, - then hit <Tab> again to list available partitions.

This helps me a lot in the past.
 
Thanks Guys. I'll give it a try tonight. :D

Seeing as my HDD setup is:
1 200GB
1 80GB
1 SATA 500GB,

wouldn't it make more sense to install the grub onto the 500GB? I use the 500GB as a shared drive between the two (soon to be 3) Operating Systems. So, it rarely gets formatted. But then again, I'm not planning on formatting my Linux HDD either...
The windows HDD gets formatted every few months... ;)
 
Okay, first thing, Grub is VERY flexable, so what I would need form you is to figure out on which HD and partition is Ubuntu installed.

Also, give us the exact commands you used to recreate GRUB, or did you do the CD recovery?
 
Okay, first thing, Grub is VERY flexable, so what I would need form you is to figure out on which HD and partition is Ubuntu installed.

Also, give us the exact commands you used to recreate GRUB, or did you do the CD recovery?

Right... I used the Bootable Ubuntu to "try it" without re-installing it.
Then in Terminal:

1 - > Sudo grub
2 - Grub> Root (hd0,0) (Ubuntu Partition) 100% sure..erm nothing happended when I pressed enter... it just moved to the next line "Grub>"

3 - Grub> Setup (hd0) Then some code ran... ending with the word Success
4 - Grub> Quit

Reboot, and then I see the boot menu which shows the 300 different kernels for Ubuntu, and XP at the bottom of the list.

I get the Error 17...

The HDD setup...

hd0,0 is ubuntu
hd0,1 is unknown...
hd1,0 is XP
hd2,0 if my 500gb sata (it doesn't have an OS)
 
I would have booted using the Ubuntu LiveCD.
I would have then opened a terminal
# sudo mkdir /mnt/ubuntu
# sudo mount /dev/<ubuntu_partition> /mnt/ubuntu
# sudo chroot /mnt/ubuntu
# grub-install --no-floppy /dev/<mbr drive>

<mbr drive> would be the drive I set BIOS to boot off eg /dev/sda
 
5. Grub Error 17
Situation

Code Listing*5.1: Grub Output
root (hd0,0)
filesystem type unknown partition type 0x7

Error 17 : Cannot mount selected partition

Solution
This error is returned if the partition requested exists, but the filesystem type cannot be recognized by GRUB.
Be sure to check your root(x,y) settings in your grub.conf.
Also, if you are trying to boot Windows, make sure that your grub.conf file has the root (hdX,Y) (or rootnoverify (hdX,Y)) and chainloader (hdX,Y)+1 in it.

Do the following from the liveCD:
mkdir /mnt/disk
mount /dev/hda1 /mnt/disk
cat /mnt/disk/boot/grub/grub.conf

What does it state is your root? While you are at it you may as well do what milomak said:
cd /mnt/disk
chroot /mnt/disk /bin/bash
grub-install --no-floppy /dev/<mbr drive>

With sudo where appropriate.

XP will still be there because it was in your previous greub.conf BEFORE you removed it. You can simple edit /boot/grub/grub.conf and remove the XP lines.
 
Last edited:
Well, it's still not working. I now understand how it all works and what you guys are talking about... (Thanks google)

I'm gonna swap my HDDs jumpers, then check a few BIOS settings.. and try again.

But, I do suspect that in my Noobness, I might have installed two Grubs... one on each HDD. How do I delete both, and create a new one from scratch?
 
Try the same path but menu.lst

It lists my Hardrives the wrong way around. All the Ububtu Kernels is rooted as (hd1,0) and Windows is rooted as (hd0,0). But under fdisk -l, the Ubuntu partition is sda1, and windows is sdb1.

And apparently i can't just open the menu.lst and modify them...
 
Then you need to edit that and correct it.

Why can't you open it to edit it?
sudo nano /boot/grub/menu.lst
 
Try [url="http://www.supergrubdisk.org/]super grub[/url]. (<5mb download)

Booting off the Super Grub Disk USB or CD will give you a menu that will allow you to boot into any of the available OSes once off, or to fix grub or MBR (except you don't have mbr in this case).

They've also got a forum and wiki that should be able to help with specific grub errors.
 
Then you need to edit that and correct it.

Why can't you open it to edit it?
sudo nano /boot/grub/menu.lst

WOOHOOO!!!!! It works! :D
Well, Ubuntu works. XP is a different story.

I'll see what I can find on Google...

The error was:
Error 13: Invalid or unsupported executable format
 
Top
Sign up to the MyBroadband newsletter
X