PDA

View Full Version : How to install Grub from a live Ubuntu cd.



catlett
July 28th, 2006, 01:34 AM
EDIT: I have not been around in a long time, but it appears grub can still give people headaches:) I notice people are still referring to this guide now and then, so I wanted to post a link to a grub2 guide. There are differences so you may want to check there as well http://ubuntuforums.org/showthread.php?t=1195275. Glad to see Ubuntu is still going strong:) Take care.

This will restore grub if you already had grub installed but lost it to a windows install or some other occurence that erased/changed your MBR so that grub no longer appears at start up or it returns an error.

(This how to is written for Ubuntu but should work on other systems. The only thing to take note of, when you see "sudo" that will mean to you that the following command should be entered at a root terminal.)

Boot into the live Ubuntu cd. This can be the live installer cd or the older live session Ubuntu cds.

When you get to the desktop open a terminal and enter. (I am going to give you the commands and then I will explain them later)


sudo grub

This will get you a "grub>" prompt (i.e. the grub shell). At grub>. enter these commands


find /boot/grub/stage1

This will return a location. If you have more than one, select the installation that you want to provide the grub files.
Next, THIS IS IMPORTANT, whatever was returned for the find command use it in the next line (you are still at grub>. when you enter the next 3 commands)


root (hd?,?)
Again use the value from the find command i.e. if find returned (hd0,1) then you would enter root (hd0,1)

Next enter the command to install grub to the mbr


setup (hd0)

Finally exit the grub shell

quit

That is it. Grub will be installed to the mbr.
When you reboot, you will have the grub menu at startup.

Now the explanation.
Sudo grub gets you the grub shell.
Find /boot/grub/stage1 has grub locate the file stage1. What this does is tell us where grub's files are. Only a small part of grub is located on the mbr, the rest of grub is in your boot folder. Grub needs those files to run the setup. So you find the files and then you tell grub where to locate the files it will need for setup.
So root (hd?,?) tells grub it's files are on that partition.
Finally setup (hd0) tells grub to setup on hd0. When you give grub the parameter hd0 with no following value for a partition, grub will use the mbr. hd0 is the grub label for the first drive's mbr.
Quit will exit you from the grub shell.



THIS IS AN EDIT. 5-HT MADE A GOOD POINT AND I AM JUST GOING TO COPY/PASTE IT HERE


Just have recommendation to add that may be irrelevant: it might be of benefit to give an explicit warning (though it is mentioned) that this guide will write GRUB to the MBR (just in case someone is using a different boot loader on their MBR and would like to reinstall GRUB to a partition).

If someone wants GRUB on a partition, the 'setup (hd0)' step can be modified to 'setup (hdX,Y)'. Where X is the hard disk, and Y the partition using GRUB's nomenclature of starting from 0 (first partition=0, second=1,...).

THIS IS ANOTHER EDIT. TOSK POSTED A WAY TO MOUNT PROC AND UDEV. THIS WAS NEEDED BECAUSE GRUB WASN'T RECOGNISING THE DRIVE. I THOUGHT IT WAS A VALUABLE COMMENT AND DECIDED TO PUT IT IN THE ORIGINAL POST SO PEOPLE WILL SEE IT AT THE TOP. IT MAY BE MISSED AS JUST A REPLY POST DOWN THE PAGE.
ALL KNOWLEDGE IS WELCOME!


Mine was a slightly different story. I couldn't get grub to find the stage1 file or even recognize my drive. So I borrowed some knowledge I picked up while using Gentoo:

You have to mount your root partition using the livecd:
Code:

$
sudo mkdir /mnt/root $
sudo mount -t ext3 /dev/sda6 /mnt/root

Then you have to mount the proc subsystem and udev inside /mnt/root also:
Code:

$
sudo mount -t proc none /mnt/root/proc $
sudo mount -o bind /dev /mnt/root/dev

Doing this allows grub to discover your drives. Next you have to chroot:
Code:

$
sudo chroot /mnt/root /bin/bash

Now that you're chrooted into your drive as root everything should work.
Code:

#
sudo grub I edited in the sudo, just to be safe. When I enter grub and not sudo grub, grub cannot find the file. I do not know if the chroot changes this because I did not try it that way. In the end I figured it was better to err on the side of caution. Tosk I hope you don't mind my editing of your reply.
grub>
find /boot/grub/stage1

It found mine on (hd0,5)
Code:

grub>
root (hd0,5)

It successfully scanned the partition and recognized the filesystem-type
Code:

grub>
setup (hd0)

That was it. It installed and on reboot I was thrown back into Ubuntu.

This might help some people who are having issues so I thought I would post it.

PLEASE NOTE: My Ubuntu was installed to /dev/sda6. This may not be the same for everyone. /dev/sdaX means it's SCSI/SATA/USB/FireWire drive. And it's partition 6 because I have a weird partitioning scheme in place.

--Tosk



**This set of instruction is a combination of 2 guides I saw before. One was a Mepis grub how to but I never found it again. The other is the grub manual. It's section explained the find, root, setup process but never mentioned it could be done from a live session.

This is the grub link http://www.gnu.org/software/grub/manual/html_node/Installing-GRUB-natively.html#Installing-GRUB-natively

Post script;
Just to post as much information as possible, this is an older how to for resoring grub to the mbr. The original post is directions for using the install cd and then there are replies that mention the method I posted here, as well as the chroot method mlind mentioned. If this method fails, you may want to try this http://ubuntuforums.org/showthread.php?t=24113

mlind
July 28th, 2006, 02:33 AM
This looks very useful info. Is the result same as running grub-install /dev/xxx ?

catlett
July 28th, 2006, 04:20 AM
The end result is the same but grub-install /dev/hd? doesn't work with a live cd. When I run grub-install from a live cd, I get an error about grub not being able to read the bios.
When I first installed ubuntu there was a grub re-install guide. It said something about mounting the ubuntu partition. Then cd to the directory and chroot. At the time it was over my head and I didn't pay much attention to it. Now I can't find it.
The other guide was the Breezy guide where you trick the install cd into re-installing grub.I gues it worked for people but I thought there had to be a simpler way to do it.
I finally found the grub manual entry on native installs and tried it from a live cd and it worked.
Hopefully reinstalling grub will now be a simple thing to do from a live cd.

mlind
July 28th, 2006, 05:25 AM
You probably mean something like this as root


mkdir /mnt/root
mount /dev/xxx? /mnt/root
chroot /mnt/root /bin/bash
grub-install /dev/xxx


Thanks for your HOWTO though, I'll try it next time I screw up my grub. Which is probably at weekend when I testdrive Edgy.

catlett
July 28th, 2006, 08:49 AM
You probably mean something like this as root


mkdir /mnt/root
mount /dev/xxx? /mnt/root
chroot /mnt/root /bin/bash
grub-install /dev/xxx


Thanks for your HOWTO though, I'll try it next time I screw up my grub. Which is probably at weekend when I testdrive Edgy.

Please try the chroot grub-install and post what happens. Like I said I saw the how to when I didn't understand commands and never saw it again. Then I saw the grub manual describing the find, root, setup commands and I went with that.I think find, root, setup doesn't return the bios error because they are given from the grub shell.
Just for FYI, this is the error I get with grub-install from the live session.

ubuntu@ubuntu:~$ sudo grub-install /dev/hda
Probing devices to guess BIOS drives. This may take a long time.
Could not find device for /boot: Not found or not a block device.This is the output of find, root, setup


grub> find /boot/grub/stage1
(hd0,1)
(hd0,10)

grub> root (hd0,10)
Filesystem type is ext2fs, partition type 0x83

grub> setup (hd0)
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 (hd0)"... failed (this is not fatal)
Running "embed /boot/grub/e2fs_stage1_5 (hd0,10)"... failed (this is not fatal
)
Running "install /boot/grub/stage1 d (hd0) /boot/grub/stage2 p /boot/grub/menu
.lst "... succeeded
Done.

catlett
August 2nd, 2006, 04:55 AM
Just wanted to post with more concrete proof. I knew it was right from the documentation and I got feedback from one success story plus I ran it but it was just replacing the same list so it was hard to tell.
BUT NOW, I have absolute proof. I just installed Fedora Core 5 yesterday. I allowed Fedora to install grub. Fedora's grub didn't recognise Ubuntu's installation.
I thought to myself, Perfect! Lets put the guide to work. This is just the scenario I was hoping to help people with. You had grub but lost it to another install (or another issue that caused grub to return an error or what not. The main thing is that grub is already installed somewhere. The issue is you can't access it)
This is actually how anyone could handle this. I copied down Fedora's grub entry , then I rebooted and put the Ubuntu Live installation cd. When I got to the desktop I opened the terminal and did the 4 commands. One from the regular ubuntu terminal and 3 at the grub shell.

sudo grub
then at grub>

find /boot/grub/stage1
It returned 2 listings, hd0,2 and hd0,6. I forgot Ubuntu's root partition believe it or not but I knew I just put Fedora on /dev/hda3 (that is hd0,2 to grub)
Now that I know Ubuntu's grub is on hd0,6 I let the grub shell know what grub files I wanted to use
Still at grub>


root (hd0,6)
Now the command to install grub on the mbr with hd0,6's grub files

setup (hd0)
Grub then prints a little read out in the terminal about how it found the kernel and everything else until it says "succeeded". Now all I have to do is get out of the shell
grub>
quitThen I shutdown Ubuntu and restarted the computer.
Gone was Fedora's grub and in it's place was my Ubuntu grub menu. Success.
(As for accessing Fedora, I just inserted the Fedora entries I copied from Fedora's grub before I booted the live cd. Now I have Ubuntu's grub back and it is booting to fedora.)

To sum up, hd0,6's grub installed flawlessly on the mbr. It took all of 2 minutes from putting the cd in to restarting.

Here it is again just to put it to bed.

sudo grub

find /boot/grub/stage1
whatever the find command returns use for root

root (hd?,?)

setup (hd0)
hd0 is the mbr of the first drive (as far as grub is concerned)

quit

5-HT
August 2nd, 2006, 06:18 AM
Thanks for the HowTo!
Just have recommendation to add that may be irrelevant: it might be of benefit to give an explicit warning (though it is mentioned) that this guide will write GRUB to the MBR (just in case someone is using a different boot loader on their MBR and would like to reinstall GRUB to a partition).

If someone wants GRUB on a partition, the 'setup (hd0)' step can be modified to 'setup (hdX,Y)'. Where X is the hard disk, and Y the partition using GRUB's nomenclature of starting from 0 (first partition=0, second=1,...).

catlett
August 3rd, 2006, 01:09 AM
Thanks for the HowTo!
Just have recommendation to add that may be irrelevant: it might be of benefit to give an explicit warning (though it is mentioned) that this guide will write GRUB to the MBR (just in case someone is using a different boot loader on their MBR and would like to reinstall GRUB to a partition).

If someone wants GRUB on a partition, the 'setup (hd0)' step can be modified to 'setup (hdX,Y)'. Where X is the hard disk, and Y the partition using GRUB's nomenclature of starting from 0 (first partition=0, second=1,...).

Thanks for the feed back. I have been worried I would forget something and it would effect someone's system. I hope you don't mind, I just copy/pasted your comments into the how to. They stated the issue and were to the point so why not use them? (as long as you don't object of course)

true_friend
August 4th, 2006, 01:08 AM
find /boot/grub/stag1
this command is resulting can not find the file
what i do for this????????

true_friend
August 4th, 2006, 01:09 AM
file is there. i saw it after mounting the partition having linux installed on it.
i tried to give /B/boot/grub/stag1 command while /B is the mount folder but it did the same error.
i am sick of this reinstallation process.

5-HT
August 4th, 2006, 01:50 AM
find /boot/grub/stag1
this command is resulting can not find the file
what i do for this????????

Looks like it may be a typo. What about trying
find /boot/grub/stage1

This step isn't necessary, it's only a convenient way of finding which partition grub's stage1 is on. If you know which hard drive and partition /boot/grub is on, you can simply bypass the find step, while following the other steps in catlett's guide, and plug in the proper values for the root (hdX,Y) command.

e.g., if you've only one hard drive and /boot/grub is on the first partition


root (hd0,0)
e.g., if you've only one hard drive and /boot/grub is on the second partition


root (hd0,1)

Thanks for the feed back. I have been worried I would forget something and it would effect someone's system. I hope you don't mind, I just copy/pasted your comments into the how to. They stated the issue and were to the point so why not use them? (as long as you don't object of course)

No worries, glad to be of help. Even if most people probably have grub on the MBR, it's nice to have mention of how you can put it on a partition.
Though if I knew it was going to be tacked on to the guide I'd have done a better proof read for grammar and coherence. #-o

Jabran Asghar
August 4th, 2006, 08:19 PM
Hi,

I got my PCs MBR overwritten by XPs, boot loader. is it possible that instead of restoring GRUB Boot Loader, I somehow write the boot sector (512 bytes) to a file, and then add an entry for the file to boot.ini of ntloader? I remember I saw it somewhere, but dont remember now.

Thanks for any hint.

5-HT
August 4th, 2006, 08:38 PM
Hi,

I got my PCs MBR overwritten by XPs, boot loader. is it possible that instead of restoring GRUB Boot Loader, I somehow write the boot sector (512 bytes) to a file, and then add an entry for the file to boot.ini of ntloader? I remember I saw it somewhere, but dont remember now.

Thanks for any hint.

Does this help? http://www.ubuntuforums.org/showpost.php?p=1229036&postcount=9
(thread: http://www.ubuntuforums.org/showthread.php?t=211370)

Jabran Asghar
August 5th, 2006, 09:32 AM
Yes, this is what I was looking for. Thanks for the link.

true_friend
August 5th, 2006, 10:28 AM
my problem was not the stage spelling. but path
root (hd0,0) was missing.

catlett
August 5th, 2006, 11:12 AM
my problem was not the stage spelling. but path
root (hd0,0) was missing.

Grub need the grub files to run the setup. The path is where grub will find them. When you do the find command, it is telling you where the file are located on the hard drive. The root (hd?,?) is how you tell grub where the files are. The setup (hd?) is grub installing itself and the patyh you enter there is telling grub where you want it instaled.
You can try running setup (hd0) to see what happens but it appears grub wasn't installed previously. If you know it, enter the path root is on even if grub isn't there. You may get lucky.

Adrian_b
August 5th, 2006, 02:31 PM
Thanks!
Was exactly what i needed..
I kept doing 'sudo grub-install '(hd0,0)'' which obviously didn't work :p

kurup
August 5th, 2006, 04:54 PM
I follwed your procedure to the T, infact the live cd (6.06 LTS) took everything in beautifully. It even gave me the output that the grub has been succesfully loaded.

I have a dual boot (windows 2000 and dapper). This is how my menu.1st looks like

# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not change this entry to 'saved' or your
# array will desync and will not let you boot your system.
default 0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 10

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu

# Pretty colours
#color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=/dev/hda2 ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,1)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery mode) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## ## End Default Options ##

title Ubuntu, kernel 2.6.15-26-386
root (hd0,1)
kernel /boot/vmlinuz-2.6.15-26-386 root=/dev/hda2 ro quiet splash
initrd /boot/initrd.img-2.6.15-26-386
savedefault
boot

title Ubuntu, kernel 2.6.15-26-386 (recovery mode)
root (hd0,1)
kernel /boot/vmlinuz-2.6.15-26-386 root=/dev/hda2 ro single
initrd /boot/initrd.img-2.6.15-26-386
boot

title Ubuntu, kernel 2.6.15-23-386
root (hd0,1)
kernel /boot/vmlinuz-2.6.15-23-386 root=/dev/hda2 ro quiet splash
initrd /boot/initrd.img-2.6.15-23-386
savedefault
boot

title Ubuntu, kernel 2.6.15-23-386 (recovery mode)
root (hd0,1)
kernel /boot/vmlinuz-2.6.15-23-386 root=/dev/hda2 ro single
initrd /boot/initrd.img-2.6.15-23-386
boot

title Ubuntu, memtest86+
root (hd0,1)
kernel /boot/memtest86+.bin
boot

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title Other operating systems:
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/hda1
title Windows 2000
root (hd0,0)
savedefault
#makeactive
chainloader +1


Could I have a corrupted grub? If so..how do I go about rectifying it?

Thanks in advance.

catlett
August 6th, 2006, 12:48 AM
That appears to be a perfectly fine grub menu. Is it having an issue?
Right now it is booting with the 2.6.15-23-386 kernel to the second partition of your first hard drive, where it expects to find ubuntu. Are you getting into Ubuntu?
It is also booting to the first partition of your first hard drive where it expects to find windows. Are you getting into windows?

This file can be edited by any text editor as long as you have root priveleges. The file's path is /boot/grub/menu.lst.
If you needed to access this document from Ubuntu, the commmand would be
sudo gedit /boot/grub/menu.lst

But this appears to be a perfectly fine menu. It has windows on the first partition and ubuntu on the second partition.

catlett
August 6th, 2006, 01:06 AM
Thanks!
Was exactly what i needed..
I kept doing 'sudo grub-install '(hd0,0)'' which obviously didn't work :p

Glad you found it and it worked. I drove myself crazy ever since I first started adding other distros to my system.
I started with windows and ubuntu. Never had a problem, grub would install during the ubuntu install and that would be it.
Once I started multi-booting and constantly installing,deleting partitions, installing another etc I would end up with grub issues.
I never could find an easy way to install grub without being booted into a Linux distribution.
Not for nothing but what good is "grub-install" when you can't boot into your desktop to issue the command?!
My temporary solution was to install grub to a floppy on installation. Then I would have a copy of grub on the floppy that I could always use. Once the floppy booted me into my desktop I would issue grub-install.
I even found out how to make a grub floppy (that is my only other how to) but it still wasn't what I wanted. I wanted a simple way to install grub without being in an installed Linux distro. I couldn't believe the grub developers didn't make a way to install from a boot disk. They did, of course, but it wasn't easy to find. The find, root, setup string is buried in the grub manual and it doesn't mention using a live CD. They state it as an alternative to grub-install. I then saw a mempis how to about using a live cd and find, setup etc. I am always looking for grub info so I bookmarked it to go into it later but I must not have saved it. I searched and searched but never found it again. I finally decided to look into it myself and see if it can be done. Once I knew it worked, I thought I would share it with others who are have grub issues.
I hope this ends the agony of grub. As far as the "help I installed windows and grub is gone" or "grub was working yesterday but today I get error ##?

kurup
August 6th, 2006, 07:07 AM
That appears to be a perfectly fine grub menu. Is it having an issue?
That is correct. It gives me the grub menu on boot-up..but when I scroll down to the 'Windows 2000' line..it flips me back to the first line. Strange..have no clue why?!


Right now it is booting with the 2.6.15-23-386 kernel to the second partition of your first hard drive, where it expects to find ubuntu. Are you getting into Ubuntu?
Ubuntu is booting up just fine..no problems there whatsoever


It is also booting to the first partition of your first hard drive where it expects to find windows. Are you getting into windows?
No. That is really the problem!

Here's what my fdisk looks like

Disk /dev/hda: 40.0 GB, 40060403712 bytes
255 heads, 63 sectors/track, 4870 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 1305 10482381 7 HPFS/NTFS
/dev/hda2 1306 4780 27912937+ 83 Linux
/dev/hda3 4781 4870 722925 5 Extended
/dev/hda5 4781 4870 722893+ 82 Linux swap / Solaris
Its supposed to be set to boot thru Windows.

Any suggestions for me?

confused57
August 6th, 2006, 07:34 AM
catlett, your "HowTo" worked perfectly...I had installed Mepis after Dapper on another partition, allowing Mepis to overwrite grub to the mbr. However, Ubuntu wasn't automatically added to Mepis grub...I was able to add the Dapper into my Mepis menu.lst in order to boot Dapper.
Used your method with the Live CD to reinstall Dapper's grub to the mbr, then added the entry to boot Mepis. Thanks.

kurup, you might try removing the # in front of makeactive:


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

If that doesn't work, try rootnoverify (hd0,0)

catlett
August 6th, 2006, 01:01 PM
No. That is really the problem!

Here's what my fdisk looks like
Quote:
Disk /dev/hda: 40.0 GB, 40060403712 bytes
255 heads, 63 sectors/track, 4870 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 1305 10482381 7 HPFS/NTFS
/dev/hda2 1306 4780 27912937+ 83 Linux
/dev/hda3 4781 4870 722925 5 Extended
/dev/hda5 4781 4870 722893+ 82 Linux swap / Solaris
Its supposed to be set to boot thru Windows.

Any suggestions for me?
Open the grub menu with this command (if you are in ubuntu, if you are using a distro that uses su instead of sudo, su to root and leave out sudo from the command)

sudo gedit /boot/grub/menu.lstThe only thing strange is what confused57 pointed out. There is a comment in front of makeactive. A # tells the system that the following text is to be ignored. That the text is a comment by the writer and not a commnand.
Since "makeactive" is commented out, grub isn't setting the partition active and this may be the issue. So remove the # in front of makeactive and try to boot.
The only other thing to try is mentioned by confused57 as well, replace root with rootnoverify. This tells grub not to try and mount the partiution



# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/hda1
title Windows 2000
rootnoverify (hd0,0)
savedefault
makeactive
chainloader +1See what happens. It should be booting because
/dev/hda1 * 1 1305 10482381 7 HPFS/NTFSdev/hda1 is written by grub as (hd0,0). So the entry is correct. Try removing the # and then try rootnoverify.

If there is still an issue, you can re-installl grub again from the terminal. To install grub from the terminal
sudo grub-install /dev/hda

kurup
August 9th, 2006, 06:29 PM
tried doing what you said..even followed this (http://doc.gwos.org/index.php/Restore_Grub) thread. still can't figure out where I'm screwing up?

Below is part of my dmeg:

[17179590.420000] NTFS driver 2.1.25 [Flags: R/O MODULE].
[17179590.452000] NTFS-fs warning (device hda1): is_boot_sector_ntfs(): Invalid boot sector checksum.
[17179590.452000] NTFS-fs error (device hda1): read_ntfs_boot_sector(): Primary boot sector is invalid.
[17179590.452000] NTFS-fs error (device hda1): read_ntfs_boot_sector(): Mount option errors=recover not used. Aborting without trying to recover.
[17179590.456000] NTFS-fs error (device hda1): ntfs_fill_super(): Not an NTFS volume.

disk-manager app to fails to read the windows partition..any clues on what the real problem could be?

tincbtrar
August 10th, 2006, 12:04 AM
Catlett,

Many thanks for your howto. I hosed my grub about 2 months ago after some Windows Updates for my ThinkPad. Today, after installing some other updates, grub was again broken. Your howto saved me from pulling out my hair!

Cheers.
Brian.

tosk
August 10th, 2006, 04:15 AM
Mine was a slightly different story. I couldn't get grub to find the stage1 file or even recognize my drive. So I borrowed some knowledge I picked up while using Gentoo:

You have to mount your root partition using the livecd:

$ sudo mkdir /mnt/root
$ sudo mount -t ext3 /dev/sda6 /mnt/root
Then you have to mount the proc subsystem and udev inside /mnt/root also:

$ sudo mount -t proc none /mnt/root/proc
$ sudo mount -o bind /dev /mnt/root/dev
Doing this allows grub to discover your drives. Next you have to chroot:

$ sudo chroot /mnt/root /bin/bash
Now that you're chrooted into your drive as root everything should work.

# grub
grub> find /boot/grub/stage1
It found mine on (hd0,5)

grub> root (hd0,5)
It successfully scanned the partition and recognized the filesystem-type

grub> setup (hd0)
That was it. It installed and on reboot I was thrown back into Ubuntu.

This might help some people who are having issues so I thought I would post it.

PLEASE NOTE: My Ubuntu was installed to /dev/sda6. This may not be the same for everyone. /dev/sdaX means it's SCSI/SATA/USB/FireWire drive. And it's partition 6 because I have a weird partitioning scheme in place.

--Tosk

catlett
August 10th, 2006, 11:27 AM
This might help some people who are having issues so I thought I would post it.
I for one appreciate it. I did not know about mounting proc and udev.

Just a comment to your self and anyone else,
Please post any helpful information about grub. I made this "how to" not to show I was smart or as "the final word", I wanted it to be a source of help. I struggled with grub issues and I never found an easy way to re-install. When I finally did, I posted the info for otheres. So please, anyone, post any information that you know of that isn't here, it is welcome by me and I am sure it will be by people looking for grub help.
Thanks for the info tosk/

P.S. tincbtrar....Glad it helped.

petri
August 11th, 2006, 11:12 AM
I used this HOWTO and now I can't start any hd, only cdrom and live cd works. BIOS finds hd's but GRUB doesn't show up. PC just stops.

On my second hd I have Edubuntu and when it's kernel is updated it chances grub and I can't start Ubuntu on my first hd. w2k starts although it's in my first hd. I thought that this howto would help me out but it did make everything just worse.

How is it possible that my PC can't find any hd after this howto? I didn't chance any BIOS or anything else, just followed this howto and everything vanished. :confused:

petri
August 11th, 2006, 04:34 PM
Just forget it. I reinstalled Ubuntu instead.

Welcome back to Windows! =D>

pt78
August 11th, 2006, 07:02 PM
I'm also having problems reinstalling grub (after installing XP). After doing either shorter or longer method described above (everything works just fine - no error messages) I reboot my machine ad get empty screen with blinking prompt. I tried installing to hd0, hd0,0 - always the same situation.
Any gueses what am I doing wrong?

pt78
August 11th, 2006, 07:42 PM
This reminds me: Does the same procedure aplly if /boot is on separate partition? I have / on hda6 and /boot on hda1. Would this make difference? And what about having /boot/grub/stage1 on both hda1 and hda6? Could this confuse grub? (not mentioning me :-) )

OK. Got this working finally. I have /boot on /dev/hda1 and / on /dev/hda6. Here is what I did:
1. Boot Ubuntu CD
2. Start Terminal
3.
sudo mkdir /mnt/root
4.
sudo mount -t ext3 /dev/hda6 /mnt/root
5. You probably won't need this:
sudo mv /mnt/root/boot/grub/stage1 stage1.bkp
6.
sudo mount -t proc none /mnt/root/proc
7.
sudo mount -o bind /dev /mnt/root/dev
8.
sudo chroot /mnt/root /bin/bash
9. Now I mounted my /boot as follows:
sudo mount -t ext3 /dev/hda1 /boot
10. And finally, instead of running grub I used grub-install:
sudo grub-install /dev/hda
11. Rebooted and that's it!

catlett
August 11th, 2006, 11:44 PM
Just a note to anyone who posts, I live in Boston, MA USA. My time is Eastern Standard Time USA or GMT -4. I am most likely the only person who will regularly check this thread. It can be 20 hours between my log-ons, (i.e. In bed at 10pm. Up at 5:30am and off to work. Home, shower, dinner and then log on around 6pm) so I am not abandoning anyone or nor do I not care. It's just I am not online to respond.
This method is from the grub manual http://www.gnu.org/software/grub/manual/grub.html In the "install grub natively" section http://www.gnu.org/software/grub/manual/grub.html#Installing-GRUB-natively

Just for the sake of full disclosure and to show this method is not a creation of mine but is a feature of grub. Here is the grub manuals description of the 2 ways to install grub. find/setup and grub-install


3.2 Installing GRUB natively

Caution: Installing GRUB's stage1 in this manner will erase the normal boot-sector used by an OS.

GRUB can currently boot GNU Mach, Linux, FreeBSD, NetBSD, and OpenBSD directly, so using it on a boot sector (the first sector of a partition) should be okay. But generally, it would be a good idea to back up the first sector of the partition on which you are installing GRUB's stage1. This isn't as important if you are installing GRUB on the first sector of a hard disk, since it's easy to reinitialize it (e.g. by running `FDISK /MBR' from DOS).

If you decide to install GRUB in the native environment, which is definitely desirable, you'll need to create a GRUB boot disk, and reboot your computer with it. Otherwise, see Installing GRUB using grub-install.

Once started, GRUB will show the command-line interface (see Command-line interface). First, set the GRUB's root device4 to the partition containing the boot directory, like this:

grub> root (hd0,0)

If you are not sure which partition actually holds this directory, use the command find (see find), like this:

grub> find /boot/grub/stage1

This will search for the file name /boot/grub/stage1 and show the devices which contain the file.

Once you've set the root device correctly, run the command setup (see setup):

grub> setup (hd0)

This command will install the GRUB boot loader on the Master Boot Record (MBR) of the first drive. If you want to put GRUB into the boot sector of a partition instead of putting it in the MBR, specify the partition into which you want to install GRUB:

grub> setup (hd0,0)

If you install GRUB into a partition or a drive other than the first one, you must chain-load GRUB from another boot loader. Refer to the manual for the boot loader to know how to chain-load GRUB.

After using the setup command, you will boot into GRUB without the GRUB floppy. See the chapter Booting to find out how to boot your operating systems from GRUB.

Next: Making a GRUB bootable CD-ROM, Previous: Installing GRUB natively, Up: Installation
3.3 Installing GRUB using grub-install

Caution: This procedure is definitely less safe, because there are several ways in which your computer can become unbootable. For example, most operating systems don't tell GRUB how to map BIOS drives to OS devices correctly—GRUB merely guesses the mapping. This will succeed in most cases, but not always. Therefore, GRUB provides you with a map file called the device map, which you must fix if it is wrong. See Device map, for more details.

If you still do want to install GRUB under a UNIX-like OS (such as gnu), invoke the program grub-install (see Invoking grub-install) as the superuser (root).

The usage is basically very simple. You only need to specify one argument to the program, namely, where to install the boot loader. The argument can be either a device file (like `/dev/hda') or a partition specified in GRUB's notation. For example, under Linux the following will install GRUB into the MBR of the first IDE disk:

# grub-install /dev/hda

Likewise, under GNU/Hurd, this has the same effect:

# grub-install /dev/hd0

If it is the first BIOS drive, this is the same as well:

# grub-install '(hd0)'

Or you can omit the parentheses:

# grub-install hd0

But all the above examples assume that GRUB should use images under the root directory. If you want GRUB to use images under a directory other than the root directory, you need to specify the option --root-directory. The typical usage is that you create a GRUB boot floppy with a filesystem. Here is an example:

# mke2fs /dev/fd0
# mount -t ext2 /dev/fd0 /mnt
# grub-install --root-directory=/mnt fd0
# umount /mnt

Another example is when you have a separate boot partition which is mounted at /boot. Since GRUB is a boot loader, it doesn't know anything about mountpoints at all. Thus, you need to run grub-install like this:

# grub-install --root-directory=/boot /dev/hda

By the way, as noted above, it is quite difficult to guess BIOS drives correctly under a UNIX-like OS. Thus, grub-install will prompt you to check if it could really guess the correct mappings, after the installation. The format is defined in Device map. Please be quite careful. If the output is wrong, it is unlikely that your computer will be able to boot with no problem.

Note that grub-install is actually just a shell script and the real task is done by the grub shell grub (see Invoking the grub shell). Therefore, you may run grub directly to install GRUB, without using grub-install. Don't do that, however, unless you are very familiar with the internals of GRUB. Installing a boot loader on a running OS may be extremely dangerous.

Elcoco
August 19th, 2006, 03:07 AM
hi i tried doing this on my systemi did setup (hd2) after doing root (hd1,0) hd2 is sda1 which is where my windows is installed and hd1 is where my linux is installed. i did this because when i tried to boot of my iwndows drive grub was never called and if i booted off the linux one i got an error 17, now it boots grub first in both cases but if i do it with my sda drive it jsut hagns after writing grub on the screen and on the linux one i still get error 17. how can i erase grub from my windows partition or make it work at least?

# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not change this entry to 'saved' or your
# array will desync and will not let you boot your system.
default 0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 10

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu

# Pretty colours
#color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=/dev/hdd1 ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd1,0)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash (IDE=nodma)

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery mode) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## ## End Default Options ##

title Ubuntu, kernel 2.6.15-23-386
root (hd1,0)
kernel /boot/vmlinuz-2.6.15-23-386 root=/dev/hdd1 ro quiet splash (IDE=nodma)
initrd /boot/initrd.img-2.6.15-23-386
savedefault
boot

title Ubuntu, kernel 2.6.15-23-386 (recovery mode)
root (hd1,0)
kernel /boot/vmlinuz-2.6.15-23-386 root=/dev/hdd1 ro single
initrd /boot/initrd.img-2.6.15-23-386
boot

title Ubuntu, memtest86+
root (hd1,0)
kernel /boot/memtest86+.bin
boot

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title Other operating systems:
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/hdc1
#title Microsoft Windows XP Professional
#root (hd0,0)
#savedefault
#makeactive
#chainloader +1


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title Windows XP Media Center Edition
root (hd2,0)
savedefault
makeactive
map (hd1) (hd2)
map (hd2) (hd1)
chainloader +1

soham
August 19th, 2006, 03:44 AM
thanks

Drakkor
August 19th, 2006, 04:26 AM
A BIG THANKS, CATLETT !! =D>
You just saved me,lol !! Had Ubuntu/XP dual boot working fine,both on different drives with grub on the mbr.Was working great till I got the brilliant idea of installing the GAG bootloader, wanted to see if I could boot 9 different OSs on my computer,like it says, I guess and installed GAG on my mbr, Long story short, it wouldn't boot to Ubuntu, said "boot device missing or invalid" Holy Shiite !! So anyway your guide fixed it up,just like new,lol !! Thanks Again :D

catlett
August 19th, 2006, 04:45 AM
soham & Drakkor, you are very welcome. This is why I posted it. I battled grub re-installation for quite a while until I found this method.

Now to Elcoco

how can i erase grub from my windows partition or make it work at least?

Grub has been having alot of issues with sata. It is a recurring post on the forum that people install grub on sata and can't boot.
If I was you, I would restore windows botloader. That way you can access your windows instalolations. Then I would try another bootloader for accessing linux.

You need an XP installation disk. Not a recovcery disk that a computer maker sends you with your system but a real XP install disk.

Boot to the installation disk. Enter into the recovery option. Eventually you will get to a command prompt ( i.e. C:\ ) At the prompt enter
fixmbr Just in case you want some screen shots http://www.geocities.com/kilian0072002/recconsole2.html


Now bot into the cd again and run the commands to install grub. But install grub to the partition not the mbr. Meaning enter setup (hd1,0).

Now you shopuld have the windows loader on the mbr and grub on linux's partition. This is where I would try GAG. It is another bootloader. It can boot xp and linux. Hopefully it will do the trick. http://gag.sourceforge.net/
http://users.bigpond.net.au/hermanzone/p12.htm
(but it appears it didn't help Drakkor)

You could also try the grub super disk.
http://adrian15.raulete.net/grub/tiki-index.php
http://users.bigpond.net.au/hermanzone/SuperGrubDiskPage.html

theadventuresofanidealist
August 23rd, 2006, 11:33 PM
the command find /boot/grub/stage1 doesnt find anything.
also cant do the sudo mount -t ext3 /dev/sda6 /mnt/root says no such device sda6. where do i go from here?

theadventuresofanidealist
August 24th, 2006, 12:43 AM
neither of these two work for me.
the first method cant find the the file.
the second it says :

mount: wrong fs type, bad option, bad superblock on /dev/hda7,
missing codepage or other error
In some cases useful info is found in syslog - try dmesg tail or so.

pls help.

catlett
August 24th, 2006, 03:36 AM
Did you have ubuntu installed and Grub working? If so, how did you lose grub? The find command is looking for the files. It needs to find your root partition. If you erased your root partition, this isn't going to work. It sounds like your partition has been deleted or corrupted. I only say it because find/grub... didn't find anything and mount came up with a wrong fs type. You need to have ubuntu installed on a partition and for the partition to be uncorrupted. This will put grub on the mbr but everything else has to be fine. The mbr can be corrupted or gone but your root has to be there and have ubuntu installed on it.

But first things first. Did you have grub installed and working and how did it stop functioning?

cleentrax
August 24th, 2006, 08:53 PM
Thanks for the tips. But I'm having no luck. When I run grub> /boot/grub/stage1, I get error 15, file not found.

If I try an install from the live cd I get an error that it cannot install grub.

I have five hard drives: one for the boot, and 4 for a software raid 5. The drives all show up, but I can't get an install to work. I must have some mbr messing me up somewhere. How can I wipe all the drive's MBRs and start over? Or am I having some other problem?

catlett
August 25th, 2006, 01:03 AM
Raid has become a big problem. Grub just has a problem identifying the correct mbr (or so it appears). You can try one more thing. Don't bother with find /boot/grub/stage1. Just run the root and setup commands. The only thing is you have to know which partition your ubuntu installation is on. If you know the partition then try it with just root and setup.
There are other methods to try as well.
You could also try the grub super disk. This is the download site.
http://adrian15.raulete.net/grub/tiki-index.php
This is a tutorial on it.
http://users.bigpond.net.au/hermanzo...bDiskPage.html

There is also GAG. It is another bootloader. Here is it's site. http://gag.sourceforge.net/
This is another one of Hermans guides. It is about gag.
http://users.bigpond.net.au/hermanzone/p12.htm

If you feel like a little research, here is grub's manual http://www.gnu.org/software/grub/manual/grub.html

jerry_c
August 27th, 2006, 08:55 PM
Dear Catlett,

I sure appreciate your expertise in this area and your willingness to share it. I've been fighting this problem for 3 days now. I've been posting to my lug, googling, reading some of the ubuntu forum posts, and your post is definitely the closest to my problem. I'm working from the Dapper Live CD.

A little historical background: This computer originally came with Windows XP Home Edition about 3 years ago. As soon as I got it home I immediately removed Windows and installed Linux. A couple years ago I had to recover the HD and the recovery cd's reinstalled Windows. However, I never used Windows on it until the other day. I had what seemed like a hardware problem with my ethernet card not letting me connect to the Internet. Remembering that I had Windows on the computer, I decided to see if Windows had the same problem with the network card. Sure enough, it did. So I installed another ethernet card. Unfortunately, one time while fiddling with the cables behind the computer I bumped the power cord while the computer was booted into Windows. When I put the cord all the way back in, it seems that Windows automatically "fixed" the MBR and now the computer only boots to Windows.

Here are my partitions:

hda1 - MBR FAT32
hda2 - Windows NTFS
hda3 - Linux swap (This placement because suggested Windows will sometimes write a little beyond its partition limits. Placing swap here prevents Windows from overwriting the beginnings of a Linux install or data partition.)
hda4 - extended partition pointers
hda5 - /boot ext2
hda6 - previous install (no longer used) ext3
hda7 - current Ubuntu Dapper install ext3
hda8 - /home ext3

/boot on hda6 and hda7 point to hda5
/home on hda6 and hda7 point to hda8

What I've done so far:

sudo grub-install /dev/hda
sudo grub-install /dev/hda1
sudo grub-install /dev/hda5
sudo grub-install hd0

All returned: "Could not find device for /boot: Not found or not a block device."

"sudo fdisk -l" listed hda2 as the boot partition.

So I did:

"sudo fdisk /dev/hda"

followed by "a" Enter, "1" Enter, "w" Enter, then turned off the computer and restarted. (Just rebooting did not work.) It put an * in the boot column for both hda1 and hda2. I retried the "sudo grub-install hd*" commands, and still got "Could not find device for /boot: Not found or not a block device."

So, I tried "sudo grub" followed by "find /boot/grub/stage1" which returned, "Error 15: File not found."

I mounted the ubuntu partition using "sudo mount -t ext3 /dev/hda7 /mnt/ubuntu". I mounted proc and udev like tosk described and chrooted:

sudo mount -t proc none /mnt/ubuntu/proc
sudo mount -o bind /dev /mnt/ubuntu/dev
sudo chroot /mnt/ubuntu bin/bash

They all seemed to work fine. Then, when I tried "sudo grub" I got:

sudo: unable to lookup ubuntu via gethostbyname()

I tried chrooting to /mnt/boot, where hda5 is mounted but got:

chroot: cannot run command `/bin/bash': No such file or directory

grub> root (hd0,4)
Filesystem type is ext2fs, partition type 0x83

grub> setup (hd0)
Checking if "/boot/grub/stage1" exists... no
Checking if "/grub/stage1" exists... no

Error 15: File not found

Also, fwiw, I cannot read the files in the mounted hda5 with nautilus or gedit, but gparted shows they are still there. It is possible that hda5 is corrupted.

So, I'm still running from the Live CD. If I try to boot from the hard drive, it goes directly to Windows.

My first preference would be to be able to boot from grub, even if it means not being able to boot Windows. My second preference would be for the Windows boot loader to give me the option to boot Ubuntu.

In the meantime, if I could even use the Live CD to boot the Ubuntu distro that's on my hard drive, that would be a big step forward. My floppy drive does not work, nor does the CD writer, so making a boot floppy or a boot CD is not an option.

Is it possible to install grub to the hd using apt-get or some other command from the Live CD? Maybe only stage1 is needed. The CD seems to contain grub. Can stage1 just be made with gedit or pasted in from a post?

If you notice what seems to be a range of some rather sophisticated pieces mixed in with some noob sounding questions or thinking, it is because I had some help in some of the setup. I am only part geek, myself.

Any help would sure be appreciated. I sure miss my usual Ubuntu setup and all my files.

Thanks.

P.S. I notice you're in Boston. I was bon and raised in Woosta.

catlett
August 27th, 2006, 09:57 PM
I would recomend the super grub disk but making any kind of boot disk is out of the question. There are a couple of things to do though. One you could try booting from the windows bootloader. I never did this but there are a couple of how tos, crap I forgot they need a floppy.

You could try to chroot into your root partition. NEVERMIND.. You tried that and got an error.

Before you go any farther, I would install the ext2 driver for windows, if you haven't already. http://www.fs-driver.org/ Copy anything important to a flash drive or upload it to a file hosting site http://s7.quicksharing.com/ (just in case you loose the ability to boot altogether) and then you can try 2 things.

You could try apt-get. I never apt-get installed grub from a live cd. I do not know what it does. Hopefully it will put grub's file's somewhere so you can use them for the setup (hd0).
If that doesn't work, you can try apt-get install lilo. Lilo, as you know, was the first linux bootloader. Again I never installed it from a live cd. They are both in synaptic but I do not know the effect of using a live cd. Maybe you can get lucky and it will let you select where you want to install grub and you can choose your mounted partition.

If you have important data, then the safest way is to use windows with the ext2 driver. Upload/copy off all important data and reinstall ubuntu from an installation cd. Now that I think of it, if you are going to reinstall, you only have to copy data to your windows parttitionm with the ext2 driver because the installer will leave that partition alone.

I know this is a bit rambling, I've been thinking and writing at the same time. To sum it up, your only options appear to be using spt-get from the liove cd to install grub or lilo.
The safe way would be to get your data off the computer and re-install ubuntu.
Do you have an installation disk? If you don't, pm me with your address and I'll mail one out to you. Ship-It sent me 5 so I have a few extra to spare. I only mention it because you don't have the ability to download abd burn an iso and ship-it takes a month.
Let me know.

P.S. This is the old grub restore How To for ubuntu. I never liked it and it is the reason I posted this one but it may help you. If you have an installation disk, you can try this. I do not know if this matters but this how to was originally made during Breezy and using the 5.10m install disk, I think you can get the results from any install disk but I just wanted to mention it. http://doc.gwos.org/index.php/Restore_Grub


ONE MORE THING. I was just looking at your chroot error. try chrooting without the !bin/bash. I was just searhing for gub restore and I found the old how to and it had a reply about chroot. It did not mentiuon ! bin/bash. Maybe it will work without adding it.

jerry_c
August 27th, 2006, 10:46 PM
Thanks for your quick reply. The Live CD I'm using does have an install option. I'm hesitant to reinstall, though, because I have added a LOT of extra packages and I don't want to have to reinstall them. I tried doing apt-get from the CD. I used post # 3 from this thread as a guideline:

http://ubuntuforums.org/showthread.php?t=223975

It said:

Or... use a Ubuntu live CD on your computer with a faster connection. Let's say you wanted to install alien, kword, and epiphany.

Boot up the live CD on the faster connection computer. Then go to the terminal and type in

Code:

sudo apt-get clean sudo aptitude update sudo aptitude install kword epiphany-browser alien

Then go to /var/cache/apt/archives and copy all the .deb files to a USB key or iPod or some external drive.

Then copy those .deb files to the other computer's desktop and then

Code:

cd ~/Desktop sudo dpkg -i *.deb

I tried this for grub, but when I went to /var/cache/apt/archives there were no .deb files there to copy. If they were there, I would have just copied them to the mounted partition of my ubuntu distro on my hd.

So, the suggestion you posted at http://doc.gwos.org/index.php/Restore_Grub seemed like a good idea. I tried it, but when I got to step 4, it wanted a mount point for everything, not just / /boot and swap. I gave mount points for them all and finished step 5. Then, instead of going to step 6 and asking me to save, it said it was now going to install. I'm hesitant to go that far without more assurance that it won't really install.

Any pointers?

How about a way to boot to my ubuntu distro on my HD from the install CD?

catlett
August 27th, 2006, 11:09 PM
I didn't look at the link but if you want a deb for grub, go to the Dapper packages site and download the deb http://packages.ubuntu.com/dapper/admin/grub

I do not knmow about the dependencies or if that is it.
You can get any ubuntu package here http://packages.ubuntu.com/

jerry_c
August 28th, 2006, 01:03 AM
It got me the deb, thanks. I downloaded it and copied it into where I have my ubunto distro mounted on my hard drive, but running
sudo dpkg -i --root=/mnt/ubuntu grub_0.97-1ubuntu9_i386.deb
still didn't seem to make a stage1 file anywhere.

I know you never liked the old grub restore, and it does seem a little like an overkill, but might there be some script that would restore grub without risking installing a whole new distro?

Also, is there a way to use the install CD to boot a distro that's already installed on the HD?

catlett
August 28th, 2006, 01:18 AM
Do you know what partition holds ubuntu's root? For sake of arguement let's say it is on (hd0,2). Try running it without the find command and go right to root and setup. Can't hurt to try.


sudo grub
at grub<

root (hd0,2)

setup (hd0)

quit

What does that do? Also did you chroot without bin/bash?

jerry_c
August 28th, 2006, 02:40 AM
Good try, catlett, but when I do setup (hd0), I get the same error message as I did when I tried to do setup after making hda5 the root
Checking if "/boot/grub/stage1" exists... no
Checking if "/grub/stage1" exists... no

Error 15: File not found

Even without putting /bin/bash on the end of chroot, I get that error message. It is the default of chroot.

I have figured out that hda5 was either corrupted or reformatted somehow. So, I mounted /dev/hda5 on /mnt/ubuntu/boot, and did
dpkg -i --root=/mnt/ubuntu --force-overwrite for both grub and the latest kernel. That did put something meaningful into my /boot partition. However, there is still no file called stage1.

catlett
August 28th, 2006, 03:10 AM
since it is a partition issue, Azz's gparted recovery method may help. The live cd should have gparted but if not just apt-get install gparted.

Here is the link, hope it somehow helps http://www.ubuntuforums.org/showthread.php?t=226836

jerry_c
August 28th, 2006, 06:56 AM
Dear catlett,

I got it working.

To recap from some earlier posts and update, I have a separate /boot partition that seems to have gotten corrupted by a Windows recovery boot. A more detailed description of my system and what I tried that did not work is here: http://ubuntuforums.org/showpost.php?p=1429899&postcount=42

Here's what worked to restore grub using only the Live/Install CD to access the problem hard drive. No other drives, floppies, pen drives, or other CD's were used.

1. Made a new directory under /mnt as a mountpoint for mounting the ubuntu root partition
sudo mkdir /mnt/ubuntuExplanation: The live cd does not automatically mount your hard drive. You have to do this manually, partition by partition.

2. Mounted the ubuntu root partiton
sudo mount -t ext3 /dev/hda7 /mnt/ubuntu
3. Mounted the boot partition to the boot directory of the mounted ubuntu root
sudo mount -t ext2 /dev/hda5 /mnt/ubuntu/boot
Explanation: This mounts the boot partiton in the same place it would be mounted if the hard drive were booted to the ubuntu distro installed on hda7.

4. Changed to the package archives directory.
cd /var/cache/apt/archives
Explanation: This is where the latest kernel package would be.

5. Found the latest kernel image.
ls -l linux*
6. Forced a kernel install into the /boot partition.
sudo dpkg -i --root=/mnt/ubuntu --force-overwrite linux[XXX].deb
Explanation: Running dpkg on a kernel package places the kernel image into the /boot directory. In this case, since the /boot directory of the mounted ubuntu root is really the /boot partition mounted on the mounted ubuntu root, the kernel ends up in the /boot partition.

7. Since the previous item gave some notification of grub errors, downloaded the latest grub .deb file, then did a force install of the grub package.
sudo dpkg -i --root=/mnt/ubuntu --force-overwrite grub[XXX].deb
8. Said yes when asked to have a menu.lst file created.

9. Repeated step 6. This time there were no grub errors reported. It is possible that reversing steps 6 and 7 would have avoided this step.

10. Ran grub-install to the device, not the partition, using the mounted ubuntu partition as the root directory.
sudo grub-install --root-directory=/mnt/ubuntu /dev/hda This also created the previously missing stage1 file, the lack of which was preventing earlier attempts to fix grub from working.

Note. This did not work an earlier time when the boot partition was not mounted on /boot of the mounted root partition.

I also believe that using the
--root-directory=[path to your mounted root directory] option is critical with using this command from the live CD. Others have reported that this command does not work from the live CD. It should work fine if you use this option.

11. Used
sudo gedit to edit the root line of /mnt/ubuntu/boot/grub/menu.lst from (hd0,0) to (hd0,4).

NOTE_0,0 (note_a1): If a boot partition exists (as in this case), use its location instead of the location of the root partition. This can be confusing because it is asking for the root location and you are answering with the boot location. On many systems they are the same, but not if you have a /boot partition.

NOTE_0,1 (note_a2): There are two counting systems. The alphabetized system, e.g.: hda, hdb, etc, begins counting partitions at 1, whereas the numerical system, e.g.: hd0, hd1, etc, begins counting partitions at 0. So, for example, in this case, the boot partition, hda5, is hd0,4.

NOTE_0,2 (note_a3): I realize now that, at this point, I could have used sudo grub and followed the instructions in catlett's opening post to this thread http://ubuntuforums.org/showpost.php?p=1308395&postcount=1 to set the root partition, since I now had a stage1 file. I had tried it before I had a stage1 file and that solution wasn't working because it couldn't find the stage1 file. Because step 10 created the missing stage1 file, catlett's solution would probably have worked at this point, but I didn't think of it at the time.

NOTE_0,3 (note_a4):At some time in the future, I can edit the meun.lst for more choices, such as to my alternate distro on hda6, booting to a command prompt, or even booting to Windows (if I ever wanted to do that again).

12. Shut the computer completely down. When doing major changes, particularly when dealing with booting issues, I have found that changes stick more often than when just rebooting. YMMV.

13. Restarted.

14. Logged onto this site to share what worked and express my gratitude.

While this might not be the most elegant way to restore grub, the bottom line is that it did work. I'm so glad to be back up on my usual system with all my programs, settings and files. Thanks for all your help. Thanks to the folks in my local LUG who helped, too.

afx
August 28th, 2006, 09:47 AM
Hello peeps!
My grub is also gone to hell so i'm trying to get it back. My partition table looks like this:

/dev/hda1 /boot Linux Boot
/dev/hda2 /win Windows XP
/dev/hda3 / Linux root
/dev/hda4 (extended partition)
/dev/hda5 /swap Linux swap
/dev/hda6 /home Linux home
/dev/hda7 /wind Widows second partition (d:)

As you can notice, I installed my boot files on hda1 /boot partition. I followed the howto from above to recover my grub files, but when I type find /boot/grub/stage1 it returns nothing!
Assumably I should type root (hda0,0) (hda1 right?) for setup to fetch the grub files from that partition and then... this is what bothers me - install it to MBR hd(0) or to /boot hd(0,0) partition? Please help me clear these things out, I don't want my boot files to be lost forever!

jerry_c
August 28th, 2006, 10:05 AM
Here's what I'd do first. Boot with the live/install CD.

The CD does not mount your hard drive. Use the partition editor to view your partitons, then mount all your partitions.

Then run
sudo nautilus and browse your system. If you want to edit anything, use
sudo gedit which will give you root permission to edit any file you have mounted. Of course, back up anything before you edit. Do not rely on the gedit auto backup feature. Those backup files get overwritten with each automatic backup. After the second automatic backup, the backup file is no longer your original file.

You might want to copy all your key files from your /boot partition to some new directory you create on your /home partition before you edit or run anything. Running Nautilus as sudo should make that easy to do.

You should be able to recover from what's going on. If you have to remake your /boot partition it's not that big of a deal, far simpler than reinstalling your whole distro or some of the problems Windows users have been known to have.

I'm headed to bed. catlett, the expert on this subject, will probably check in sometime after daylight here on the east coast. It's only 5am now. Good luck.

catlett
August 29th, 2006, 11:01 AM
Jerry,
That was some work! Persaverence paid off. Glad you are up and running.

afx,
sorry to not get online yesterday. I need to move to werstern mass. with Jerry. My car was vandalised yesterday amd it was an all day project to fix the windows and tire. Life in the city#-o
I do not knmow if your issue is resolved or not but, you are right about boot. Your grub files are in boot and since you have a boot partition, grub is installed there. You can try to rub setup without find if you know boot has grub. Hopefully nothing happened to the partition. Just run
sudo grub
root (hd0,0)
setup (hd0)
quit
You want to install to hdo because you need the first part of grub on the nbr. If you use setup (hd0,0) then grub will not start at boot, you would need another bootloader to send the boot to grub on hd0,0

afx
August 29th, 2006, 06:29 PM
Thanks guys...
it worked just fine, of course ;-)

@jerry_c: i mounted the /boot partition and copied it just in case... case that didn't happen ;-)

Thanks again!

jerry_c
August 30th, 2006, 06:52 AM
I'm in Western NC, catlett, not Western MA. New England is too cold for me and, yes, it's nice to be out of the big city. I found another thread where a Tomosaur wrote a script called GrubED that gives a gui for editing grub. It's here: http://ubuntuforums.org/showthread.php?t=228104 If anybody would be able to evaluate it, it would be you. Thanks again for all your help. Good luck getting your car restored.

imhdd
August 30th, 2006, 08:23 PM
Thank you catlett.

I was experimenting using Norton Ghost 2003 to clone dual boot Win98SE and Ubuntu 6.06 from 80GB drive to 40 GB drive. Clone went fine but Ghost clone doesn't recognize GRUB so I couldn't boot the clone.

After much trying to restore GRUB I gave up and began a search.
Found your directions. Used live CD per your first post and it worked on first try. GREAT! Another lesson learned.

Thanks very much.
imhdd

themusicwave
September 5th, 2006, 01:05 AM
I am trying to help a friend fix his dual boot. He accidentaly overwrote GRUB when he installed XP.

I followed the directions in the first post and Grub is now working. There is just 1 problem, now Windows isn't showing on the GRUB list.

Is there an easy fix to this issuse? My friends use of Ubuntu rests on my figuring this out. If I don't get it soon he will propably ditch Ubuntu for just windows.

jerry_c
September 5th, 2006, 01:24 AM
The menu.lst file probably just needs editing. It's in /boot/grub.

Note that it uses a numerical system starting at 0 for drives and partitions. hda1 = hd0,0. hda2 = hd0,2. hdb1 = hd1.0. hdb2 = hd1,1.

Good luck.

confused57
September 5th, 2006, 02:53 AM
I am trying to help a friend fix his dual boot. He accidentaly overwrote GRUB when he installed XP.

I followed the directions in the first post and Grub is now working. There is just 1 problem, now Windows isn't showing on the GRUB list.

Is there an easy fix to this issuse? My friends use of Ubuntu rests on my figuring this out. If I don't get it soon he will propably ditch Ubuntu for just windows.

You'll need to open a terminal and edit the menu.lst file:

cd /boot/grub
sudo cp menu.lst menu.lst_backup
gksudo gedit menu.lst

then add something like this to the bottom of the file:


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

the above should boot Windows, if it is on the first partition of the first(or only) hard drive.

Edit: You can actually have savedefault set to more than one entry in grub and if you have the entry:
default saved

grub will boot the last OS that you booted into.

themusicwave
September 5th, 2006, 03:15 AM
thanks GRUB is working now!

jerry_c
September 5th, 2006, 03:28 AM
Good clarification, 57. Here are a few more:

If the menu does not show, comment out this line:

hiddenmenuso that it looks like this:
# hiddenmenu

If the menu is defaulting too fast, you can also change this line:
timeout Xto whatever amount of seconds you are comfortable with.

The line:
savedefaultgoes into the boot menu option you want as your default, e.g: Windows, Ubuntu, etc. and should only be in one option.

Hope this helps.

antisho
September 12th, 2006, 02:35 AM
Hello, I am having a problem with using grub to boot Windows from a logical partition, and was referred here. I don't feel like typing the whole thing again or even copying it (:P), so I'll just link to the thread (http://ubuntuforums.org/showthread.php?t=255053).

devilkin
September 22nd, 2006, 11:22 AM
Hello,

I've got a similar-ish problem, with Windows XP 64bit and Grub under Kubuntu.

link to thread: http://ubuntuforums.org/showthread.php?t=262766

quickwitt
September 24th, 2006, 03:56 AM
Brilliant!

I am back into Unbutu on my tri-boot XP/OSX/Ubuntu machine!

Thanks!:p

heri0n
September 30th, 2006, 11:44 PM
after reinstalling windows i need to reinstall grub however it doesnt seem to be working this is what i get

setup (hd0)
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 (hd0)"... 15 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd0) (hd0)1+15 p (hd0,6)/boot/grub/stage2
/boot/grub/menu.lst"... failed

Error 22: No such partition

can someone tell me whats wrong
i tried doing fixmbr from the windows recovery mode that didnt help
ubuntu is installed on (hd0,6)

jerry_c
October 1st, 2006, 01:13 AM
Dear heri0n,

It looks like your menu.lst file needs editing. You may need to mount it first. Earlier posts on this thread explain this. If that doesn't work, post again. Catlett checks in periodically on this thread and he's the real expert on this subject. There are some others here who also know way more than I do on this subject.

I can tell you this much. I was way more stuck than you are a few weeks ago, and the posts on this thread gave me what I needed to get unstuck overnight.

Good luck.

confused57
October 1st, 2006, 03:33 AM
after reinstalling windows i need to reinstall grub however it doesnt seem to be working this is what i get

setup (hd0)
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 (hd0)"... 15 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd0) (hd0)1+15 p (hd0,6)/boot/grub/stage2
/boot/grub/menu.lst"... failed

Error 22: No such partition

can someone tell me whats wrong
i tried doing fixmbr from the windows recovery mode that didnt help
ubuntu is installed on (hd0,6)
Here is an excellent explanation of grub:
http://users.bigpond.net.au/hermanzone/p15.htm

What do you get when you enter?:

grub> find /boot/grub/stage1

You might want to boot with the live cd and check the output of:

sudo fdisk -l
The -l is a small "L".

As jerry_c mentioned, catlett checks in frequently and I'm sure he can help you.

heri0n
October 1st, 2006, 06:19 AM
fdisk -l produces

Device Boot Start End Blocks Id System
/dev/hda1 * 1 637 5116671 7 HPFS/NTFS
/dev/hda2 638 9725 72999360 f W95 Ext'd (LBA)
/dev/hda3 4462 4588 1020096 82 Linux swap / Solaris
/dev/hda5 638 4461 30716217 b W95 FAT32
/dev/hda6 4589 9725 41262921 83 Linux

find /boot/grub/stage1

find /boot/grub/stage1
(hd0,6)

ill check out that link thankls

confused57
October 1st, 2006, 08:44 AM
Your Linux partition hda6 is the same as root (hd0,5) in grub...so you might be able to use the live cd, get to a grub prompt as described at the beginning of this thread, then root (hd0,5)...setup (hd0)...quit.

May or may not work.

heri0n
October 1st, 2006, 05:28 PM
ok i tried that, it shows me the fat partition though but i just followed through

grub> root (hd0,5)
Filesystem type is fat, partition type 0xb

grub> setup (hd0)
Checking if "/boot/grub/stage1" exists... no
Checking if "/grub/stage1" exists... no

Error 15: File not found


yeah, didnt work

but i think what you said is the problem

i think something is wrong with the device mapping
cuz when i try to do grub-install /dev/hda
it says it cant find /dev/hda7 which is true
i need it to look for hda6...

heri0n
October 1st, 2006, 05:47 PM
ok i think it is my partition table that may be messed up
i ran parted and i tried print and it says cant have overlapping partitions

and gparted shows my whole disk as unallocated
but windows boots fine

it may be because i killed the two ntfs partitions before and i made a ntfs and fat, but i looked at the table and it had like 2 small partitions in between < 1 mb...

is there any solution to this
or do i have to kill my partitions and restart?

lee101
October 1st, 2006, 06:04 PM
is there any way of installing this without the live cd i have lost mine:( :mad:

jerry_c
October 2nd, 2006, 03:45 AM
If you can boot to ubuntu with what you've got on your hard drive and all you need to do is edit grub so you can also boot to windows, the instructions on this thread should work, and you won't need to do any mounting. If you can't get ubuntu booted because grub isn't letting you, that's where the live/install CD comes in.

You or a friend can just download and burn one from another computer if you can't find your copy. You don't need to wait for one in the mail. Even an old CD of an earlier version of ubuntu should have everything you need on it to fix grub.

Good luck.

catlett
October 2nd, 2006, 06:59 AM
Hey Jerry and C57. Glad you check in on the thread. I moved this weekend and it has been a long weekend. I don't have internet service until tomorrow.
I am checking in because I bought a wireless card before I moved on the outside chance I could grab a channel. Well here I am :twisted:
Anyways, glad to see you guys and if there are still issues, post an update and I'll be back on 5pm Eastern Standard Time US to see if I can help.

jerry_c
October 2nd, 2006, 07:35 AM
ok i think it is my partition table that may be messed up
i ran parted and i tried print and it says cant have overlapping partitions

is there any solution to this
or do i have to kill my partitions and restart?

Dear Heri0n,

As you can see by Catlett's recent post, he's out for another day moving. So, I'll do the best I can to help you in the meantime, and maybe between me, c57, and some of the others here, we can get you going.

I'd say you have a problem that's beyond just a grub problem. If you overlaped your partition boundaries, grub isn't the only problem you'll have. I don't know any other way to fix that problem than to repartition.

I had an expert partition mine the first time I installed linux, many years ago, and I still use his system. It's posted at http://ubuntuforums.org/showpost.php?p=1458107&postcount=16, (http://ubuntuforums.org/showpost.php?p=1458107&postcount=16)along with the reasons why.

I hope this helps. Good luck.

VCSkier
October 5th, 2006, 06:12 AM
thanks! this saved my butt. i thought i was going to have to reinstall ubuntu...

heffo_j
October 5th, 2006, 12:38 PM
G'day all,

This is a very informative thread. Thank you Catlett et. al. for your significant input.

Can I pose another problem? I want to delete my windows xp partition and replace it with FAT32 (so my vmware xp can use it). What is the safest way to do this without wrecking everything?

Best regards
John

petri
October 5th, 2006, 12:42 PM
This should have got another thread, heffo_j

Why not just reformat it with Gparted? If you don't have it install with Synaptic. After installation paste this in terminal
sudo update-grub to get an updated grub menu. Yours XP will be gone and doesn't have an entry in grub.

cactaur
October 14th, 2006, 10:03 PM
Ok, emergency here. I tried this method, and when I try to boot, my hard drive makes a funny noise and I get a GRUB read error. Now, I'm dependent on the live CD. My Ubuntu is in hda(0,1). If it makes a difference, I originally put Warty (EDIT: Sorry, I meant Breezy) then did a dist-upgrade to Dapper. If I can get a quick reply, that would be very very helpful. Before I did this, my GRUB worked great.

petri
October 14th, 2006, 10:35 PM
This isn't a quick reply and you are not going to like it. you shouldn't have upgraded and skipping Breezy. From Warty to Breezy and from Breezy to Dapper. These upgrades can be quite a mess. Is't too late now but I'm afraid your OS is gone. You could try to boot to recovery mode and type
apt-get update and enter then
apt-get dist-upgrade and enter. Try to boot to older kernel also.

What is the Grub error number?

cactaur
October 14th, 2006, 10:53 PM
Oh whoops, sorry, I meant from Breezy. I got them confused for a moment right there, well, anyways, I went from Breezy to Dapper, and GRUB's been working wonders up until I reinstalled from the Dapper live CD. The problem is, GRUB doesn't show up at all. If I booted from the CD first, it hangs. If I chose to boot from the Hard Drive first, it merely says "GRUB read error".

catlett
October 15th, 2006, 02:48 AM
What was the original error that made you need to restore grub? All this method does is restore a copy of grub that is on your hard drive, it doesn't add or take away anything.
For example I have a copy of grub for my Dapper install and my Puppy linux install. If I run the commands with dapper's root, I get the menu list from my dapper install. If I run the commands with Puppy's root, I get Puppy's menu when I boot to grub.
That is why this only works if you already had grub installed.

I guess my questions are, "What was the original problem with grub?" "Did the dist-upgrade run through to the end and did it boot after running?" I ask the second one because a new version of grub may have been part of the upgrade and there is a possibility the new version wasn't installed correctly.

If you know how to mount your hard drive's partitions, mount your dapper partition and open up the boot folder. Post the menu.lst from the grub folder and then post the output of
sudo fdisk -lIf you don't know how to mount, post the fdisk result and I'll give you the commands.

cactaur
October 15th, 2006, 03:51 AM
The reason I decided to reinstall grub was because I was trying to get grub to display Fedora, and it was recommended that I reinstall (last post) (http://www.ubuntuforums.org/showthread.php?t=274298) grub so that it might update and display it. My dist-upgrade went perfectly, I did it months ago and grub worked wonderful. So, I don't think there are any problems directly related to the upgrade, but apparently, my upgraded ubuntu is incompatable with the one I downloaded on the Live CD.

Here's my fdisk -l


Disk /dev/hda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 4864 39070048+ 7 HPFS/NTFS
/dev/hda2 4865 11523 53488417+ 83 Linux
/dev/hda3 14218 14593 3020220 5 Extended
/dev/hda4 11524 14217 21639555 83 Linux
/dev/hda5 14406 14593 1510078+ 82 Linux swap / Solaris
/dev/hda6 14218 14405 1510047 82 Linux swap / Solaris

Partition table entries are not in disk order


Hmmmm......I think we discovered something, very surprisingly enough, the menu.lst is gone! I see the plot thickens, maybe I should try putting a copy of my menu.lst back in the grub folder. I'll let you know how this turns out.

EDIT: Wait, can you post how I can change my file system from my live CD?

catlett
October 15th, 2006, 04:00 AM
All you have to do is mount the partition. First create a mount point.

sudo mkdir /media/ubuntu
Then mount your partition to it.

sudo mount /dev/hda2 -t ext3 /media/ubuntu
It is possible that ubuntu is in hda4 but I would think that is fedora. Now you will find the partition in the media folder.
To open the menu,lst just remember that it is in /media/ubuntu

sudo gedit /media/ubuntu/boot/grub/menu.lst
You may have to use the menu from fedora. Just to be safe, mount the hda4 partition as well. We'll assume it is fedora

sudo mkdir /media/fedora

sudo mount /dev/hda4 -t ext3 /media/fedora

cactaur
October 15th, 2006, 05:54 AM
Wow, it worked. It turned out that when I reinstalled, my menu.lst just "vanished". Well, it works now. And I can't thank you enough.

gairik
October 19th, 2006, 04:53 AM
Hey....
I badly need help with this
I followed the steps and got this

grub> setup (hd0)
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 (hd0)"... 15 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd0) (hd0)1+15 p (hd0,5)/boot/grub/stage2 /boot/grub/menu.lst"... failed

Error 12: Invalid device requested


What does that mean? What should i try now?
i tried setup (hd0,5) .......... same error

catlett
October 19th, 2006, 10:52 PM
I do not know if you are still hunting for an answer since you posted 17hours ago. I am in Boston, MA USA. I am only around a few hours a night after work (6 to 10pm eastern standard time US) 17 hours ago was 11pm and I was in bed. It is 6pm now and I just got online so sorry I couldn't reply sooner.
Anywasy, it appears to be an issue with your mbr. Was grub working on this hard drive before?
The first thing I would do to just get a booting system is install grub to a floppy. If you have a floppy drive, use setup fd0 so your commands would be

sudo grub
grub> root (hd0,5)
grub> setup (fd0)
This way you can boot from the floppy. Do you know why there are 15 sectors embedded? Is there anything out of the ordinary on your mbr? If grub was working before it should install again and work.
The long and short of it seems to be the embedded sectors of your mbr. It appears grub cannot write enough info to the mbr because of those sectors. At lest that would be my guess. Try installing to a floppy, if you have one, and see if it boots.
You may also want to try the Super Grub Disk http://adrian15.raulete.net/grub/tiki-index.php

jimchristopher
November 9th, 2006, 12:40 AM
Thanks! This saved my install on an external USB drive. I have reinstalled twice now because of this problem, both times reformatting and setting up everything again from scratch. Does this seem like a somewhat common problem with 6.10 or are there many people with 6.06 having this problem too?? Anyway, thanks again!!!

djbentrem
November 20th, 2006, 08:05 AM
Thanks catlett...big help :-)

fsanders
December 3rd, 2006, 01:01 AM
Awesome explanation catlett! It worked perfectly for me! I'm a Systems/Network Admin who is a diehard Linux guy, but I have to evaluate Windows Vista for work (I support Linux, Solaris, and Windows). Well, I didn't want to mess up my nicely tweaked Ubuntu Edgy 6.10 install which I use all day long, so I installed Vista (replacing the previous Windows XP Partition) and then followed your instructions to get my Grub back! Perfect!

Thanks Again!
Fred :KS :)

WishMaster
December 6th, 2006, 10:18 PM
I was installing TortoiseSVN and it needed to reboot to complete the installation.
That's when I got "grub error 17".

Thanx to the Live CD and this How-to, my grub was fixed.
Thank you thank you thank you !!!

catlett
December 8th, 2006, 01:27 AM
I just got my internet copnnection up and running after a week + :confused: I am always concerned someone will be asking for help and I cannot reply. Anyways after a frustrating week it is great to see people wer helped and took the time to post a thank you reply.
To everyone, your welcome. It is great to be able to help and thank you for taking the time to post a thank you to me. It means alot.
I'll stop rambling but I'll leave with the now famous saying "Don't pay me back, pay it forward." http://www.payitforwardfoundation.org/home.html

randiroo76073
December 8th, 2006, 02:01 PM
May Santa be very kind to you Christmas! Your tutorial saved me alot of hassle. I'm still a newbie to linux & a bad kernel update thru update mngr had me borked, not too detailed but I've got 18 partitions, home & root for 7 distros, swap, windows 98se. Using your tutorial I was able to get to menu.lst and replace with backup copy :D
Thanks for your dedicated work!
Randy

WishMaster
December 9th, 2006, 12:17 PM
hmm... seems like it don't work out 100%

I got my grub menu back, and booting WinXP does work fine.
But when I tried to boot into Ubuntu today, I got this error:

root (hd0,6)
Filesystem type unknown, partition type 0x82
kernel /boot/vmlinuz-2.6.17-10-generic root=/dev/hda7 ro quiet splash
Error 17: Cannot mount selected partition
Press any key to continue...With the Live CD, I did this:

sudo grub
grub> find /boot/grub/stage1
(hd0,5)
grub> root (hd0,5)
grub> setup (hd0)


That worked all fine, and booting into Windows works fine.
But booting into Ubuntu gives the above error...

catlett
December 9th, 2006, 12:30 PM
I only have a minute so I won't be able to respond after I post but I hope I can be clear.

You setup the 0,5 partition as root but ubuntu is listed as 0,6. One of them is wrong. I would bet on 0,6


root (hd0,6)
Filesystem type unknown, partition type 0x82
kernel /boot/vmlinuz-2.6.17-10-generic root=/dev/hda7 ro quiet splash
Error 17: Cannot mount selected partition
Press any key to continue...

sudo grub
grub> find /boot/grub/stage1
(hd0,5)
grub> root (hd0,5)
grub> setup (hd0)

Next time you boot press
e At the grub menu with ubuntu highlighted as the selection. This will allow you to edit the ubuntu menu selection. Change the (hd0,6) to (hd0,5)
You edit by moving the cursor with the arrow keys and then backspace to erase and hitting e (of course) then press
bTo boot.
I am off to work, good luck.

WishMaster
December 9th, 2006, 01:39 PM
Okay, I changed it to hd0,5
and got this:

BusyBox v1.1.3 (Debian 1:1.1.3-2ubuntu3) Built-in shell (ash)
Enter 'help' for a list of built-in commands.
/bins/sh: can't access tty; job control turned off
(initramfs)_](*,) :p

*edit* on another forum they told me to change grub to hd(0,5) and root=/dev/hda6
and that worked :)
Very bizarre since hda6 is my swap.... Ubuntu is on hda7
Anyway, I changed my /boot/grub/menu.lst to hd(0,5) and dev/hda6
Hopefully it works...

HeSh
December 13th, 2006, 10:12 PM
I'm having quite a problem.

Fist i installed ubuntu from live cd and it appeared that no grub was installed (i left default option to install grub on hd0 after the installation). Then i followed instructions written here. Grub found stage1 on my hd2,2, so i installed it as:
root (hd2,2)
setup (hd2)

And as such grub was installed but it reported "error 17".
My hdd is SATA and ubuntu partition is sda3. I had 2 more IDE hard disks installed (hdc and hde) and cdrom on hdb.

Then i removed the 2 disks and reinstalled ubuntu. Again no grub was installed so again i ran grub command from live cd and now it found stage1 on hd0,2. Ubuntu partition is sda3 and grub is still reporting error 17.

Any ideas what's going on? Where should i install grub?

catlett
December 14th, 2006, 03:33 AM
as you can see from somew of the posts, grub has issues with sata. But you can try some troubleshooting.
There arte a few things you want to check. You want to know how linux sees your drives. You want to know how grub sees your drives, through the device map. And then you want to see how grub's menu lists your drives.
First you need to boot to the live cd. Then mopuint your ubuntu partition. Entert this to mount ubuntu from the live c


ACTUALLY try this real quick with just the ubuntu drive installed

sudo grub

root (hd0,2)

setup (hd0)

That should work but if not lets go back to trouble shooting.

Boot to live cd

sudo mkdir /media/ubuntu

sudo mount /dev/sda3 -t ext3 /media/ubuntu

It is easiesty if you launch the file manager as root. This way you can just open the grub files by double clicking on them
Launch as root

gksudo nautilus

Now go to the media folder. Then go into the ubuntu folder and open the boot folder. That is where you will find the grub folder. Error 17 is usually grub booting to the wrong partitionm. So you need to check the grub menu to the file that tells grub about your drives. Anyways open up the device map file and then open up the menu.lst file.
The last file is your system "view" Open a terminal and enter
sudo fdisk -l (That's a lower case l)

All you want to do is see if your ubuntu drive and partition are listed the same in all. If not, that could be your issue.

IU would try just the ubuntu drive and sewtup (hd0,2) root (hd0)

You coul keep you original setup but use hd0 instead of hd2
root (hd2,2)
setup (hd0)

I won't be on again until tomorrow night. Try the setup hd0 and if nothing, post the three files and hopefully we'll find something

charlie.
January 4th, 2007, 08:34 AM
I'm also getting "Error 15: File not found" from the "find" command. I mounted the root, proc and dev mounts as instructed and used the chroot environment. I used sudo where instructed.

Symmetry
January 4th, 2007, 02:17 PM
Hello,like everyone else posting here I'm having trouble with GRUB. My box origionally ran Windows XP on an IDE drive, but I decided to install Ubuntu on a new serial drive I purchased. I was dual booting happily for a while, but then I tried to get a windows program to recognize my ext3 space at bootup as a valid drive and things broke. Whenever I tried to boot up the system it would say I was starting GRUB stage 1.5, but then give me error 17.

My system has an Asus K8N-E motherboard, and I had it setup with the windows drive as the boot drive. The motherboard still sees both my main drives fine, and experimentally yanking drives physically shows that yanking my PATA drive results in no GRUB at all, and yanking my SATA drive changes the error code to 21.

I've tried the techniques I found in this thread, but its still not working. When I ask GRUB to find stage1 it doesn't work even if I've already mounted my SATA drive, merely telling me "Error 15: File not found". When I try to setup manually it seems to like the root command fine, but when I run setup it gives me "Error 17: Cannot Mount Selected Partition" which I'm guessing might be what GRUB stage 1.5 was failing on as well.

The Gnome partition editor is correctly recognizing all three drives (I have a small extra NTFS PATA drive too) and the partitions on them. As I said I've managed to mount my SATA drive just fine. Interestingly when I run fdisk this is what I get for my SATA drive:



Disk /dev/sda: 300.0 GB, 300069052416 bytes
255 heads, 63 sectors/track, 36481 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 36104 290005348+ 7 HPFS/NTFS
/dev/sda2 36105 36481 3028252+ 5 Extended
/dev/sda5 36105 36481 3028221 82 Linux swap / Solaris

So it seems to think that my linux partition, which GParted correctly recognizes as an ext3 partition, is NTFS for some reason and I guess that could explain the failures in the boot loader. For completeness, here are some entries from menu.lst in the Grub directory



title Ubuntu, kernel 2.6.17-10-generic
root (hd2,0)
kernel /boot/vmlinuz-2.6.17-10-generic root=/dev/sda1 ro quiet splash
initrd /boot/initrd.img-2.6.17-10-generic
quiet
savedefault
boot

# on /dev/hda1
title Microsoft Windows XP Professional
root (hd0,0)
savedefault
makeactive
chainloader +1

I also noticed that in my grub directory there was a menu.lst~ I compared the two versions, and the new one had this inserted into it near the top between the two examples:


Disk /dev/sda: 300.0 GB, 300069052416 bytes
255 heads, 63 sectors/track, 36481 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 36104 290005348+ 7 HPFS/NTFS
/dev/sda2 36105 36481 3028252+ 5 Extended
/dev/sda5 36105 36481 3028221 82 Linux swap / Solaris

I think I'll try reverting back to the old menu.lst and see if that helps any. Right now I'm happy to have my Ubuntu live CD, a Windows2000 OEM cd which came with my old box, a Windows XP upgrade CD which I used to port my HD over to my new machine through a reinstall, and a bit more swap space than data if it should prove neccesary to copy stuff over from one place to another.

Symmetry
January 5th, 2007, 06:29 PM
I decided to reinstall Ubuntu on a new partition. Teh installer put GRUB on the new partition, so I'm booting fine into it and into Windows. My thoughts that this was due to ext3fsd are pretty much confirmed because due to some accident of fate they've made changes in their latest release to prevent this from happening to people link (http://ext2fsd.sourceforge.net/projects/projects.htm)...

I still can't boot into the old partition, but its no longer a GRUB problem it seems.

chandrakant_silver
January 5th, 2007, 08:16 PM
This will restore grub if you already had grub installed but lost it to a windows install or some other occurence that erased/changed your MBR so that grub no longer appears at start up or it returns an error.

(This how to is written for Ubuntu but should work on other systems. The only thing to take note of, when you see "sudo" that will mean to you that the following command should be entered at a root terminal.)

Boot into the live Ubuntu cd. This can be the live installer cd or the older live session Ubuntu cds.

When you get to the desktop open a terminal and enter. (I am going to give you the commands and then I will explain them later)


sudo grub

This will get you a "grub>" prompt (i.e. the grub shell). At grub>. enter these commands


find /boot/grub/stage1

This will return a location. If you have more than one, select the installation that you want to provide the grub files.
Next, THIS IS IMPORTANT, whatever was returned for the find command use it in the next line (you are still at grub>. when you enter the next 3 commands)


root (hd?,?)
Again use the value from the find command i.e. if find returned (hd0,1) then you would enter root (hd0,1)

Next enter the command to install grub to the mbr


setup (hd0)

Finally exit the grub shell

quit

That is it. Grub will be installed to the mbr.
When you reboot, you will have the grub menu at startup.

Now the explanation.
Sudo grub gets you the grub shell.
Find /boot/grub/stage1 has grub locate the file stage1. What this does is tell us where grub's files are. Only a small part of grub is located on the mbr, the rest of grub is in your boot folder. Grub needs those files to run the setup. So you find the files and then you tell grub where to locate the files it will need for setup.
So root (hd?,?) tells grub it's files are on that partition.
Finally setup (hd0) tells grub to setup on hd0. When you give grub the parameter hd0 with no following value for a partition, grub will use the mbr. hd0 is the grub label for the first drive's mbr.
Quit will exit you from the grub shell.



THIS IS AN EDIT. 5-HT MADE A GOOD POINT AND I AM JUST GOING TO COPY/PASTE IT HERE



THIS IS ANOTHER EDIT. TOSK POSTED A WAY TO MOUNT PROC AND UDEV. THIS WAS NEEDED BECAUSE GRUB WASN'T RECOGNISING THE DRIVE. I THOUGHT IT WAS A VALUABLE COMMENT AND DECIDED TO PUT IT IN THE ORIGINAL POST SO PEOPLE WILL SEE IT AT THE TOP. IT MAY BE MISSED AS JUST A REPLY POST DOWN THE PAGE.
ALL KNOWLEDGE IS WELCOME!





**This set of instruction is a combination of 2 guides I saw before. One was a Mepis grub how to but I never found it again. The other is the grub manual. It's section explained the find, root, setup process but never mentioned it could be done from a live session.

This is the grub link http://www.gnu.org/software/grub/manual/html_node/Installing-GRUB-natively.html#Installing-GRUB-natively

Post script;
Just to post as much information as possible, this is an older how to for resoring grub to the mbr. The original post is directions for using the install cd and then there are replies that mention the method I posted here, as well as the chroot method mlind mentioned. If this method fails, you may want to try this http://ubuntuforums.org/showthread.php?t=24113
I tried the above steps through Live Cd, but all in vain.
Since I have /boot as a separate partition and thus it was not working.
Therefore I did this... (the only step missing above is the auto-mounting of other fstab listed partitions)


sudo mkdir /mnt/root


sudo mount /dev/xxx? /mnt/root


sudo chroot /mnt/root


sudo mount -a ##this will auto-mount other fstab listed partitions



sudo grub


grub> find /boot/grub/stage1

grub> root (hd?,?)
Replace above "?" by the values returned from the find command i.e. if find returned (hd0,1) then you would enter root (hd0,1)


grub> setup (hd?)
Again, use the value returned from the find command i.e. if find returned (hd0,1) then you would enter setup (hd0)


grub> quit

This worked for me!!!!

chandrakant_silver
January 5th, 2007, 08:24 PM
This will restore grub if you already had grub installed but lost it to a windows install or some other occurence that erased/changed your MBR so that grub no longer appears at start up or it returns an error.

(This how to is written for Ubuntu but should work on other systems. The only thing to take note of, when you see "sudo" that will mean to you that the following command should be entered at a root terminal.)

Boot into the live Ubuntu cd. This can be the live installer cd or the older live session Ubuntu cds.

When you get to the desktop open a terminal and enter. (I am going to give you the commands and then I will explain them later)


sudo grub

This will get you a "grub>" prompt (i.e. the grub shell). At grub>. enter these commands


find /boot/grub/stage1

This will return a location. If you have more than one, select the installation that you want to provide the grub files.
Next, THIS IS IMPORTANT, whatever was returned for the find command use it in the next line (you are still at grub>. when you enter the next 3 commands)


root (hd?,?)
Again use the value from the find command i.e. if find returned (hd0,1) then you would enter root (hd0,1)

Next enter the command to install grub to the mbr


setup (hd0)

Finally exit the grub shell

quit

That is it. Grub will be installed to the mbr.
When you reboot, you will have the grub menu at startup.

Now the explanation.
Sudo grub gets you the grub shell.
Find /boot/grub/stage1 has grub locate the file stage1. What this does is tell us where grub's files are. Only a small part of grub is located on the mbr, the rest of grub is in your boot folder. Grub needs those files to run the setup. So you find the files and then you tell grub where to locate the files it will need for setup.
So root (hd?,?) tells grub it's files are on that partition.
Finally setup (hd0) tells grub to setup on hd0. When you give grub the parameter hd0 with no following value for a partition, grub will use the mbr. hd0 is the grub label for the first drive's mbr.
Quit will exit you from the grub shell.



THIS IS AN EDIT. 5-HT MADE A GOOD POINT AND I AM JUST GOING TO COPY/PASTE IT HERE



THIS IS ANOTHER EDIT. TOSK POSTED A WAY TO MOUNT PROC AND UDEV. THIS WAS NEEDED BECAUSE GRUB WASN'T RECOGNISING THE DRIVE. I THOUGHT IT WAS A VALUABLE COMMENT AND DECIDED TO PUT IT IN THE ORIGINAL POST SO PEOPLE WILL SEE IT AT THE TOP. IT MAY BE MISSED AS JUST A REPLY POST DOWN THE PAGE.
ALL KNOWLEDGE IS WELCOME!





**This set of instruction is a combination of 2 guides I saw before. One was a Mepis grub how to but I never found it again. The other is the grub manual. It's section explained the find, root, setup process but never mentioned it could be done from a live session.

This is the grub link http://www.gnu.org/software/grub/manual/html_node/Installing-GRUB-natively.html#Installing-GRUB-natively

Post script;
Just to post as much information as possible, this is an older how to for resoring grub to the mbr. The original post is directions for using the install cd and then there are replies that mention the method I posted here, as well as the chroot method mlind mentioned. If this method fails, you may want to try this http://ubuntuforums.org/showthread.php?t=24113

I tried the above steps through Live Cd, but all in vain.
Since I have /boot as a separate partition and thus it was not working.
Therefore I did this... (the only step missing above is the auto-mounting of other fstab listed partitions)


sudo mkdir /mnt/root


sudo mount /dev/xxx? /mnt/root


sudo chroot /mnt/root


sudo mount -a ##this will auto-mount other fstab listed partitions

sudo grub


grub> find /boot/grub/stage1

grub> root (hd?,?)
Replace above "?" by the values returned from the find command i.e. if find returned (hd0,1) then you would enter root (hd0,1)


grub> setup (hd?)
Again, use the value returned from the find command i.e. if find returned (hd0,1) then you would enter setup (hd0)


grub> quit

This worked for me!!!!

Firedog
January 6th, 2007, 09:44 PM
ok.. i hope u guys can help me out...

i have had alot of problems.. and i am ALL new to linux.. just installed ubuntu..

the first problems where alot of windows / Linux boot problems.. as my windows all crashed..

so i painfully came thru all this.. so i started a fresh.

I have 1 disk, so i decided to install Linux first and decide how it should install it.. and it took it all as i wanted, except that it used the whole drive, so i resized it before it installed linux down to 5 gb.... and the swap partion where there still..

then after that i installed Windows ont he other drive.. now everything if perfect except i had now Grub loader, so i couldnt load linux.. so i used ur guide here, and now then there is only linux..

how can i get em both into Grub loader??? :)

fpois
January 7th, 2007, 12:03 PM
ok.. i hope u guys can help me out...

i have had alot of problems.. and i am ALL new to linux.. just installed ubuntu..

the first problems where alot of windows / Linux boot problems.. as my windows all crashed..

so i painfully came thru all this.. so i started a fresh.

I have 1 disk, so i decided to install Linux first and decide how it should install it.. and it took it all as i wanted, except that it used the whole drive, so i resized it before it installed linux down to 5 gb.... and the swap partion where there still..

then after that i installed Windows ont he other drive.. now everything if perfect except i had now Grub loader, so i couldnt load linux.. so i used ur guide here, and now then there is only linux..

how can i get em both into Grub loader??? :)
to have grub multi-boot, you need to have the other OS installed *BEFORE* grub is installed, so you should've installed Linux last... Especially when you're dealing with Windows, which will just over-write your MBR without mentioning it. if you've never done grub install before and i assume you want a rather painless way to do this, reinstall Linux again.

juwaidah1990
January 7th, 2007, 03:28 PM
Hello,

I have Windows on my internal hdd and I have Linux on the external one so I have

/dev/hda Windows XP's bootloader
/dev/hda1 Windows XP's partition (NTFS)
/dev/hda2 The data partition on the internal hdd (FAT32)

/dev/sda Where I want GRUB to be
/dev/sda1 The Linux partition (ext3)
/dev/sda2 The data partition on the external hdd (FAT32)

I had GRUB installed with when I installed ubutnu but when I try to boot I Linux I get Error 17: Unable to mount the selected partition and when I try to boot Windows I get Error 19: Unknown executable format or something like this... I want things this way so that my parents can still work on Windows when I remove my hdd and when I connect it I can boot from Linux and I can boot from Windows without the need to remove my hdd, here's my menu.lst without the comments:

title Ubuntu, kernel 2.6.17-10-generic
root (hd1,0)
kernel /boot/vmlinuz-2.6.17-10-generic root=/dev/sda1 ro quiet splash
initrd /boot/initrd.img-2.6.17-10-generic
quiet
savedefault
boot

title Ubuntu, kernel 2.6.17-10-generic (recovery mode)
root (hd1,0)
kernel /boot/vmlinuz-2.6.17-10-generic root=/dev/sda1 ro single
initrd /boot/initrd.img-2.6.17-10-generic
boot

title Ubuntu, memtest86+
root (hd1,0)
kernel /boot/memtest86+.bin
quiet
boot


title Other operating systems:
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/hda1
title Microsoft Windows XP Home Edition
root (hd0,0)
savedefault
chainloader +1

And here is my device.map:

(hd0) /dev/hda
(hd1) /dev/sda

Anyone?

mrquick
January 18th, 2007, 12:47 AM
great post, saved me hours of digging through old debian netinst cds' thanks

Choad
January 23rd, 2007, 02:47 AM
just want to say thanks for this how to. im rather drunk yet still managed to get my ubuntu system back after a windows install with no pain due to this guide. thanks!

hannav85
February 6th, 2007, 02:18 PM
Hi,

I've managed to get grub working again, so that it shows ubuntu but not windows. I can probably sort that out myself apart from the biggest problem im having at the moment... when i go into ubuntu, I type my username and password into the login screen and it shows the nvidia logo and then goes straight back to the login screen! :confused: so now i cant get into windows or linux!!

any help would be very much appreciated :)

Hanna

hannav85
February 6th, 2007, 03:33 PM
Edit: I found the solution to the problem below! I changed grub to (hd0,3)! and now all works perfectly!

Hi,

I worked out why i was getting returned to the login screen; i had no hard disk space left so deleted some using the live cd.

But having said i would prob be able to work out how to add windows to grub, i cant!

Basically my fdisk -l looks like:

Disk /dev/sdc: 164.6 GB, 164696555520 bytes
255 heads, 63 sectors/track, 20023 cylinders
Units = cylinders of 16065 * 512 = 8225280

Device Boot Start End Block Id System
/dev/sdc1 1 20023 160834716 c W95 FAT32 (LBA)


Also according to gparted, my windows partition is under /dev/sda4
(nb swap is sda1, linux OS is sda2, my files are under sda3)

I installed windows after ubuntu (because after 9 months of using linux i needed windows for one programme :( ) and so its at the end of the hard drive.

My grub file has: title Microsoft Windows
root (hd0,0)
savedefault
makeactive
chainloader +1

so i'm guessing the problem is knowing what to have instead of (hd0,0)


Again, any help would be very much appreciated

confused57
February 6th, 2007, 03:40 PM
Hi,

I worked out why i was getting returned to the login screen; i had no hard disk space left so deleted some using the live cd.

But having said i would prob be able to work out how to add windows to grub, i cant!

Basically my fdisk -l looks like:

Disk /dev/sdc: 164.6 GB, 164696555520 bytes
255 heads, 63 sectors/track, 20023 cylinders
Units = cylinders of 16065 * 512 = 8225280

Device Boot Start End Block Id System
/dev/sdc1 1 20023 160834716 c W95 FAT32 (LBA)


Also according to gparted, my windows partition is under /dev/sda4
(nb swap is sda1, linux OS is sda2, my files are under sda3)

I installed windows after ubuntu (because after 9 months of using linux i needed windows for one programme :( ) and so its at the end of the hard drive.

My grub file has: title Microsoft Windows
root (hd0,0)
savedefault
makeactive
chainloader +1

so i'm guessing the problem is knowing what to have instead of (hd0,0)


Again, any help would be very much appreciated

You may have difficulty booting Windows from grub, since it's located on a partition after Linux...what you can do is at the grub menu at bootup, scroll(arrow down) to your Windows entry, press "e" for edit, then change the root from (hd0,0) to root (hd0,3), then I think it's "b" to boot. If it boots, this is only temporary, you'd need to make it permanent in your menu.lst.

lukanium
February 7th, 2007, 12:11 AM
I have 2 HDD
HDD-0 : Windows
HDD-1 : Ubuntu feisty
Grub is installed on the 1st HDD.
Then HDD-0 crashed :( ... so I have to install grub on the 2nd HDD. I've tried all that thing but no use. It said that it can't find stage1.
I push apt-get remove grub. Then apt-get install --reinstall grub.
Then repeat the steps above and thanks God it works fine.
Thnks all !

NorgeNerd
February 23rd, 2007, 07:03 AM
This looks like the answer to my slightly different issue: My dual-boot install bombed because Grub defaulted to the MBR, preventing Windows from booting. If I let Windows take back the MBR, I can reinstall Grub elsewhere, using this procedure, right? And this will leave my current Edgy installation intact and allow me to dual-boot, as originally planned, correct?

confused57
February 23rd, 2007, 06:21 PM
This looks like the answer to my slightly different issue: My dual-boot install bombed because Grub defaulted to the MBR, preventing Windows from booting. If I let Windows take back the MBR, I can reinstall Grub elsewhere, using this procedure, right? And this will leave my current Edgy installation intact and allow me to dual-boot, as originally planned, correct?

If Edgy is on a separate hard drive, you should be able to repair your Windows mbr & install grub to Edgy's mbr(using this guide with the live cd)...if you only have one hard drive, it would be more difficult...you'd need to search the forum for methods to boot Linux from Windows mbr.
Let me know if you have 2 hard drives & I'll try to help you get it set up.


You might want to burn a copy of the Super Grub Disk:
http://users.bigpond.net.au/hermanzone/SuperGrubDiskPage.html

NorgeNerd
February 24th, 2007, 06:56 AM
Ooh. Not good news. With 300 GB, I'm set with one hard drive for a while. I'll tell you, though--I followed the standard Ubuntu dual-boot install intructions pretty closely (don't believe I overlooked anything). Didn't see a word about keeping Grub out of the MBR. I only found that tidbit after Windows bombed, and I was doing a post-mortem. I really wish the std. install instructions were clear on this.

Oh well--back to the search.

Thanks much for your offer of help.

confused57
February 24th, 2007, 07:34 AM
Ooh. Not good news. With 300 GB, I'm set with one hard drive for a while. I'll tell you, though--I followed the standard Ubuntu dual-boot install intructions pretty closely (don't believe I overlooked anything). Didn't see a word about keeping Grub out of the MBR. I only found that tidbit after Windows bombed, and I was doing a post-mortem. I really wish the std. install instructions were clear on this.

Oh well--back to the search.

Thanks much for your offer of help.

What kind of errors are you getting when trying to boot Windows, if there is a Windows entry in grub?
You still might want to burn a copy of the Super Grub Disk(approx 500 kb download), you can do this in Ubuntu with no problems. The SGD can boot Windows or Linux, restore mbr, etc.
The more you can tell us about your Windows booting problem, the better chance someone may be able to, hopefully, help you.

JohnPhys
February 25th, 2007, 05:35 PM
Hey all,

I tried using the method in the first post (grub, root, setup, quit), from the edgy live cd to restore grub (was on a dapper install) and no matter how many times I tried it, it would't work. Specifically,


sudo grub

then (at grub prompt)


root (hd0,0)


setup (hd0)


quit

My dapper install was located on the first partition of the first drive (which is hdc, actually, hda is cd rom).

To resolve the problem, I had to use a grub boot cd, manually boot the partition, and once I was in ubuntu, do a grub-install.

Is there a reason for the inititial failure?

Is there a quicker fix?

NorgeNerd
February 25th, 2007, 05:52 PM
Windows shows up as an option in the Grub boot menu. When I select Windows, the Win logo splash screen comes right up, but is followed by a blue screen stating that Windows encountered errors and and cannot boot. Then there's the usual offer of a full memory dump. Could this be due to something other than Grub taking up residence in the MBR?

Azakus
February 25th, 2007, 08:56 PM
No, that sounds more like you either didn't do a chain-loader, or your NTFS partition is corrupt.

confused57
February 25th, 2007, 09:07 PM
Windows shows up as an option in the Grub boot menu. When I select Windows, the Win logo splash screen comes right up, but is followed by a blue screen stating that Windows encountered errors and and cannot boot. Then there's the usual offer of a full memory dump. Could this be due to something other than Grub taking up residence in the MBR?

Grub on the mbr "shouldn't" affect booting Windows, unless there's a setting in bios that might prevent Windows booting properly without Windows bootloader in the mbr.

You could try booting up the Windows install cd(not a recovery cd), enter "R" for recovery, then issue the command fixboot, which should restore the ntldr boot sector in Windows. The command fixmbr restores Windows mbr, which you can try as a last resort

Here's another way:
http://www.ubuntuforums.org/showpost.php?p=2203511&postcount=4

If you happen to try "fixmbr" & it still doesn't boot Windows, you can reinstall grub to the mbr with the live cd, as described in this thread.

I haven't actually had to restore Windows mbr or bootsector, but the instructions I've given "may" give you some ideas to try.

akirksey
March 11th, 2007, 05:08 AM
i had a intresting problem come up as a result from this tutorial. I hope you can offer some sorta answer or sudgestion for its resolution. I split my partition in half to install windows xp and then followed your instructions to restore the grub. Done and done. I log in though, and all of the display fonts are gone. All my windows my calender have been replaced with little squares or something, rectangles. I'm going to monkey a bit with the system preferences and try changing the fonts to see if that fixes it. Oddly enough i still have working fonts in open office.

Beruka
March 11th, 2007, 01:58 PM
I found these instructions useless....thanks for trying though

sudo grub from the live cd will result in an error

daz23
March 14th, 2007, 08:47 PM
Thank you for the guide.

I bought this computer 5 months ago for a Dual Boot Winxp/Ubuntu. Yesterday was the first time I was able to do get it working. I spent the last 3 days researching every link I could think of and I finally was able to understand the problem and the solution.

I'll post the steps I did to get my system up and running. I hope this will help somebody.



Issue: I could not get grub to boot into Ubuntu nor WinXP with my 3 SATA and 1 IDE hard drives. Errors received were Error 22 - No such partition for Linux and No ntloader found for WinXP.

Reason for failure: Ubuntu installation installs and points grub to the wrong HD MBR when using multiple SATA hard drives or combination SATA/IDE hard drives. When Grub loads it's boot menu, it sees the hard drives order a certain way (example hd0, hd1, hd2), but when you have booted into a live cd the hard drives order is different than the way Grub sees it(example hd2, hd1, hd0). (This is a known bug https://launchpad.net/ubuntu/+source/grub/+bug/8497 )

Solution: Configure grub to point to correct hard drive MBR.

1. Check your Bios for the order of your Hard Drives (In my BIOS the order is SATA1 (Contains Winxp/Ubuntu partitions), SATA2 (NTFS), SATA3 (NTFS), and IDE1 (NTFS))

2. Boot from the live CD.

3. Type sudo fdisk -l in a terminal window.
#As you can see, on my system, Winxp is installed on "/dev/sdb1" meaning 2nd hard drive partition 1, and ubuntu is installed on "/dev/sdb2" meaning 2nd hard drive partition 2.
Notice how Ubuntu sees the hard drives order different than the BIOS sees it. My Bios sees it as sdb, sda, sdc, hda while ubuntu live CD sees it as sda, sdb, sdc, hda. Not only that, but grub sees it differently too. On my system it sees it as hda, sdb, sda, sdc. This is the cause of this whole mess.




Disk /dev/sda: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 38913 312568641 7 HPFS/NTFS

Disk /dev/sdb: 74.3 GB, 74355769344 bytes
255 heads, 63 sectors/track, 9039 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 3648 29302528+ 7 HPFS/NTFS
/dev/sdb2 3649 8816 41511960 83 Linux
/dev/sdb3 8817 9039 1791247+ 5 Extended
/dev/sdb5 8817 9039 1791216 82 Linux swap / Solaris

Disk /dev/sdc: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdc1 * 1 38913 312568641 7 HPFS/NTFS

Disk /dev/hda: 251.0 GB, 251000193024 bytes
16 heads, 63 sectors/track, 486344 cylinders
Units = cylinders of 1008 * 512 = 516096 bytes

Device Boot Start End Blocks Id System
/dev/hda1 1 486341 245115832+ 7 HPFS/NTFS


4. Type sudo mkdir /mnt/root
#We need to mount the linux partition.
5. sudo mount -t ext3 /dev/sdb2 /mnt/root
#My linux patrition is sdb2. See step 3 to find your linux partition.
6. sudo mount -t proc none /mnt/root/proc
7. sudo mount -o bind /dev /mnt/root/dev
#Step 7 errored out for me. I ignored it.

8. Type sudo grub
9. Type find /boot/grub/stage1
10.(hd2,1)
#On my computer this is the location I am interested in. Your location is different
11.Type root (hd?,?)
#Use the result you got in step 10
12.Type setup (hd2)
#Use the result you got in step 10
13.Type quit

14.Type sudo gedit /mnt/root/boot/grub/device.map
#Now we need to check the logs that grub created.

15.This is my device.map. What the? (hd0) is the drive that Linux uses to boot. Why has /dev/hda my IDE drive been assigned to (hd0)? This is wrong needs to be corrected.

Not Working:


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


16. Lets back up the file first. Type sudo cp /mnt/root/boot/grub/device.map /mnt/root/boot/grub/device.map.bakup

17. Modify the /mnt/root/boot/grub/device.map to look similar to mine where the correct drive is listed by (hd0). Save the file.

Working:


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


18. Type sudo /mnt/root/boot/grub/menu.lst
#This is my menu.lst file. What the? Look at the root (hd2,1). Compare this with the device.map "(hd2) /dev/hda" It's pointing to the wrong drive, it needs to point to my linux drive which is "(hd0) /dev/sbd"

Not Working:


# groot=(hd2,1)


title Ubuntu, kernel 2.6.17-10-generic
root (hd2,1)
kernel /boot/vmlinuz-2.6.17-10-generic root=/dev/sdb2 ro quiet splash
initrd /boot/initrd.img-2.6.17-10-generic
quiet
savedefault
boot

title Ubuntu, kernel 2.6.17-10-generic (recovery mode)
root (hd2,1)
kernel /boot/vmlinuz-2.6.17-10-generic root=/dev/sdb2 ro single
initrd /boot/initrd.img-2.6.17-10-generic
boot

title Ubuntu, memtest86+
root (hd2,1)
kernel /boot/memtest86+.bin
quiet
boot

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title Other operating systems:
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sdb1
title Microsoft Windows XP Professional
root (hd2,0)
savedefault
makeactive
map (hd0) (hd2)
map (hd2) (hd0)
chainloader +1


19. Lets back up the file first. Type sudo cp /mnt/root/boot/grub/menu.lst /mnt/root/boot/grub/menu.lst.bakup

20. Modify the /mnt/root/boot/grub/menu.lst to look similar to mine where the correct drive is listed by root. Note the changes in the WinXp section also. Save the file.

Working:



# groot=(hd0,1)


title Ubuntu, kernel 2.6.17-10-386
root (hd0,1)
kernel /boot/vmlinuz-2.6.17-10-386 root=/dev/sdb2 ro quiet splash
initrd /boot/initrd.img-2.6.17-10-386
quiet
savedefault
boot

title Ubuntu, kernel 2.6.17-10-386 (recovery mode)
root (hd0,1)
kernel /boot/vmlinuz-2.6.17-10-386 root=/dev/sdb2 ro single
initrd /boot/initrd.img- 2.6.17-10-386
boot

title Ubuntu, kernel 2.6.17-10-generic
root (hd0,1)
kernel /boot/vmlinuz-2.6.17-10-generic root=/dev/sdb2 ro quiet splash
initrd /boot/initrd.img-2.6.17-10-generic
quiet
savedefault
boot

title Ubuntu, kernel 2.6.17-10-generic (recovery mode)
root (hd0,1)
kernel /boot/vmlinuz-2.6.17-10-generic root=/dev/sdb2 ro single
initrd /boot/initrd.img- 2.6.17-10-generic
boot

title Ubuntu, memtest86+
root (hd0,1)
kernel /boot/memtest86+.bin
quiet
boot

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title Other operating systems:
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sdb1
title Microsoft Windows XP Professional
root (hd0,0)
savedefault
makeactive
chainloader +1


21. We need to install grub again because we made changes to /mnt/root/boot/grub/device.map

22. Type sudo grub-install --root-directory=/mnt/root /dev/sdb
# see link for more info and make sure you use your drive and not mine https://help.ubuntu.com/community/RecoveringUbuntuAfterInstallingWindows#head-bf3232f10ddf1b078de064622ccbb25225cdb3c0

23. We should now have a bootable system. Reboot.

Notes: After a kernel upgrade, the menu.lst got changed again with the root pointing to the wrong hard drive. This is not an issue if # groot=(hd0,1) is set correctly in menu.lst. (Thanks confused57)

confused57
March 15th, 2007, 01:09 AM
daz23,
Impressive, thanks for sharing.

You also need to change this line in your menu.lst:

# groot=(hd2,1)
to

# groot=(hd0,1)

When a kernel is updated, update-grub looks at this line to assign the root partition to the kernel boot entries, when it automatically updates your menu.lst.

daz23
March 15th, 2007, 06:13 PM
confused57, thanks for the info. I forgot to change that line.

granny4linux
March 19th, 2007, 09:50 PM
Catlett, thank you so much for this very helpful guide. I was able to reinstall my Grub without a hitch following your "How To".

morequarky
March 23rd, 2007, 09:53 AM
I am frustrated.

I have read almost this entire thread. The howto seems so simple.

My wife has messed up my GRUB twice on two different computers.

This how-to doesn't work for me.

Here's the deal.

I boot the live CD.

I sudo grub

I run the commands.

I quit

I reboot

And I get errors. This time when I boot...It shows like three ubuntu kernals and windows. Grub boots windows FINE, but all three of the ubuntu kernels don't work.

I wonder. I use the driver to read the linux drive in windows. Could that driver have messed up my Ubuntu harddrive in a way so it won't boot?

Let me see what errors I get....and get back to you in a few minutes.

daz23
March 24th, 2007, 01:41 AM
morequarky, I would try to follow the steps here: http://users.bigpond.net.au/hermanzone/p15.htm#cli

This page helped me solve all my grub problems.

diebels
March 30th, 2007, 02:22 PM
This will restore grub if you already had grub installed but lost it to a windows install or some other occurence that erased/changed your MBR so that grub no longer appears at start up or it returns an error.

Using the feisty live-cd, my chroot had no hardisk devices in /dev,
so what i did was something like this:

sudo -s
mkdir /target
mount /dev/sda2 /target
mount --bind /dev /target/dev
mount --bind /proc /target/proc
mount --bind /sys /target/sys
chroot /target
grub-install /dev/sda

Azakus
March 30th, 2007, 03:37 PM
Using the feisty live-cd, my chroot had no hardisk devices in /dev,
so what i did was something like this:

sudo -s
mkdir /target
mount /dev/sda2 /target
mount --bind /dev /target/dev
mount --bind /proc /target/proc
mount --bind /sys /target/sys
chroot /target
grub-install /dev/sda

Yes. This is what I had to do last time.

djindepth
March 31st, 2007, 02:38 PM
I'm trying to install on a Mac Mini, and have run into the same issue with the grub. That's what I know. I have tried a number of these terminal scripts t try to reinstall grub but I continue to run into the same problem. I am using a CD I burned from the website (i386) and I have setup a linux partition (sda3 ext3) and a swap (sda4 swap). Any suggestion why I'm not able to complete install?

confused57
March 31st, 2007, 04:12 PM
I'm trying to install on a Mac Mini, and have run into the same issue with the grub. That's what I know. I have tried a number of these terminal scripts t try to reinstall grub but I continue to run into the same problem. I am using a CD I burned from the website (i386) and I have setup a linux partition (sda3 ext3) and a swap (sda4 swap). Any suggestion why I'm not able to complete install?
I don't know anything about installing on a Mac Mini, but you would probably get more replies from someone who does, by posting a new thread in the "Absolute Beginner" section. Make sure your thread title includes the words "grub install mac mini"... you should get plenty of help.

morequarky
April 2nd, 2007, 12:32 PM
thanks, great website
http://users.bigpond.net.au/hermanzone/p15.htm#cli

kubobbu
April 8th, 2007, 08:32 PM
Catlett... thanks for your response, and thanks also to those who added additional comments.

I ran the procedure outlined, closed the terminal, and exitied the live CD. Then rebooted the computer, and got Grub Error 18 again, so I guess the bios still can't find Grub to load the kernal.

I guess I'll have to reinstall, but I need someone to give me the partition information that will be needed so that the boot ends up in the right place... the first cylinders on the disk so it can be found.

Thanks!

maccawolf
April 12th, 2007, 01:29 PM
Catlett,
I want to say thank you, cos I also lost my mountpoint for Grub, and following your instructions I was able to re point to it.:KS :KS 8-) 8-)

THANK YOU!

Nightmist
April 22nd, 2007, 04:07 PM
Hello,

I am trying to help a guy installing Ubuntu on an older computer. It's got enough RAM and HD space, so it should be no problem. The computer has one HDD, a couple of CD/DVD drives (I think only one works) and Windows 98 installed. It had a lot of unpartitioned space, and I used this for the Linux installation.

Installation worked well with the Live CD, but when I rebooted I got the Grub Error 17. I have seen a lot of complicated partition set-ups here, but I am baffled that the simple setup of 1 HD and 3 partitions (hda1 = win98 fat 32, hda2 = linux ext3, hda3 = linux swap) gives me Error 17.

Grub should point to (hd0) since there is only 1 HD (or can one of the CD drives take up this position somehow?), and hopefully think Linux is on (hd 0,1). Is there a chance Grub thinks Linux is on (hd 0,0)? And would that give me Error 17?

I can't check anything right now (the PC is not mine), but I will check on it tonight. I didn't have much time to fiddle with it when I installed it, but will have some time tonight. So I hope someone can answer these questions so I know what to do when I see how Grub is set up.

Thanks.

[EDIT: The following is from another thread I started before I discovered this one]

I've done some testing to fix the Error 17. First I tried the following...

sudo grub
find /boot/grub/stage1
root (hd0,1)
setup (hd0)

...and (hd0,1) is the only option that worked. Everything was successful, and then I rebooted. But I still got Error 17.

The computer has got only one HD, with 3 partitions (hda1 windows, hda2 linux, hda3 swap), and menu.lst seems to be properly set up, as well as the setup of grub (see above). So how come Grub can't find itself when I only have one HD?

Booting a Windows CD and running "fdisk /mbr" reset the mbr so I can get into windows when I need to use the computer, but Grub is stuck with Error 17 when I install it again. Any tip to get Grub to work would be appreciated.

parkermauney
April 25th, 2007, 12:06 AM
This happens to me at least 2 times a month. I just get ubuntu setup perfect, then BOOM! A windows install screws it to pieces. This sure will be helpful. :D

ssican
April 25th, 2007, 10:27 AM
Nightmist, on Super Grub Disk Page, there is a reference about GRUB error 17: http://users.bigpond.net.au/hermanzone/SuperGrubDiskPage.html#17
See all the INDEX of SUPER GRUB DISK PAGE http://users.bigpond.net.au/hermanzone/SuperGrubDiskPage.html

bravemosquito
April 28th, 2007, 03:41 PM
If someone has a freetime and knowledge could take a look to my problem:
http://ubuntuforums.org/showthread.php?t=426191

Thanks

micfreedom
May 2nd, 2007, 05:48 PM
Sorry to butt in this lengthy article on GRUB.
I made a mistake in the partioning program. In GParted I clicked on "reboot from external drive".The program downloaded my booting program. But then I made the mistake in partitioning the External hard drive again!. This time, obviously, the booting program is not in the external hard drive any more. So The bootloader tried in vain to reboot.
I constantly come up0 with the error Grub stage 1.5 error 21.

I have changed the CMOS to read type = user, LBA Mode=on, P10 Mode= auto, Primary slave = Auto
yet, I still cannot by apss error 21.


I did go into Ubuntu terminal on the Live CD. When I tried find /boot/grub/stage1
it said "cannot find"
So I am with a blank screen and error 21 (I write this from my wife's computer!)

Staach
May 10th, 2007, 01:54 PM
Sigh..
I reinstalled a win-xp on the same hd as my ubuntu..So I tried to reinstall my grub. This is what I got:
grub> find /boot/grub/stage1
(hd0,5)

grub> root (hd0,5)

grub> setup (hd0)
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 (hd0)"... 16 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd0) (hd0)1+16 p (hd0,5)/boot/grub/stage2
/boot/grub/menu.lst"... failed

Error 22: No such partition

Can anyone help me on this?

n8bounds
May 10th, 2007, 02:23 PM
Once again these forums gave me exactly what I needed. Thanks guys!

TimelessRogue
May 15th, 2007, 01:43 AM
Thanks, Catlett ... simple, straight forward and, more importantly, it works ... at least on a "normal" system setup, as are both my far-from-normal self-built base station and the older generic HP laptop, after upgrading (???) from Win2k to ******* XP (strictly as a back up system and to allow access to some data/files that have not be transferred over to Ubuntu (yet ... yeah, I know: I'm a habitual, lifelong procrastinator ... which perhaps contributes to that longlife) and few esoteric programs not available in Ubuntu ... which is just fine with me.) It should work just fine on more "exotic" configurations also with, a bit of tweaking to accommodate such particular situations ...

The only difference is I used Super Grub to log onto Ubuntu and your instructions to install the grub/menu.lst to the MBR of the ******* disc. From there all was well.

Another point to emphasize is MAKE A BACKUP OF YOUR ******* MBR ... just on the off chance that things get all bolluxed up and you need to reinstall said MBR ... using the following from a terminal window: sudo dd if=/dev/hda of=/dev/hdambr bs=512 count=1.

This will give you an MBR backup from which you can restore said MBR with: sudo dd if=/tmp/hdambr of=/dev/hda bs=512 count=1 (again, in a terminal window.)

I used both on my system and everything worked out fine ...

barcaxi
May 16th, 2007, 03:27 PM
Thank you.

I tried to install Ubuntu 7.04 to a external USB disk and subsequently got the error message at boot time:-

GRUB loading stage1.5
GRUB loading, please wait...
Error 21


The commands mentioned above (and listed below) fixed my grub setup. Thanks!


$ sudo grub
grub>find /boot/grub/stage1
(hd0,0) # a old Debian version
(hd0,2) # the existing Ubuntu version I want to recover

grub>root (hd0,2)

grub>setup (hd0)

grub>quit

$ sudo reboot # Grub works again!!

dolaksiz
May 17th, 2007, 11:16 PM
Hi,

I get the following messages after I did all the things as described..

Checking..... yes
Checking.....yes
Checking.....yes

Running.... 15 sectors are embedded succeeded

but after this:

Running "install /boot/grub/stage1 (hd0) (hd0)1+15 p (hd0,5)/boot/grub/stage2 /boot/grub/menu.lst" ... failed

error 12: invalid device requested


What should I do now?

ShirishAg75
May 18th, 2007, 11:03 AM
Sorry I haven't read the whole thread but are u guys using GRUB 0.97 or the latest 1.95 . !.95 is supposed to have increased features for USB-based drives.

JRS
June 3rd, 2007, 10:26 AM
Thank you catlett
I have (had) a dual boot system with windows and ubuntu. I decided to see what gentoo was all about
and install it on the windows partition. It wiped out grub and I had no way to boot ubuntu. Because of people like
you I have always been able to find answers to what I was looking for. With that said..Thank you..thank you..
thank you so much. Your instructions worked great! One day I hope to be good enough to help people, who decide to become Linux users.

Hooked on Ubuntu

doubledave
June 4th, 2007, 11:39 PM
wow, i just wanted to post how appreciative i am!

this worked for ubuntu moron numero uno (me)-

i had wiped my kubuntu partition after having problems with ubuntu (feisty), and my boot screen was big time effed.

got grub looking back to normal, which is a huge relief.

now off to try to fix one of my other huge mistakes...

ArchangelUriel
June 5th, 2007, 09:53 AM
Good morning from Greece... Well, as most ppl who read this thread, I had a working dual-boot systmem with Ubuntu Feisty and Windows XP. Unfortunately I had to format my Windows partition and reinstall them. So there goes the GRUB... Since I do not want just to reinstall Ubuntu but only to get GRUB working I followed your instruction and here is what i got...




ubuntu@ubuntu:/$ sudo mkdir /mnt/root
ubuntu@ubuntu:/$ sudo mount -t ext3 /dev/sda5 /mnt/root
ubuntu@ubuntu:/$ sudo mount -t proc none /mnt/root/proc
ubuntu@ubuntu:/$ sudo mount -o bind /dev /mnt/root/dev
ubuntu@ubuntu:/$ sudo chroot /mnt/root /bin/bash
root@ubuntu:/# grub
Probing devices to guess BIOS drives. This may take a long time.

[ 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> find /boot/grub/stage1
find /boot/grub/stage1
(hd0,5)
grub> root (hd0,5)
root (hd0,5)
grub> setup (hd0)
setup (hd0)
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 (hd0)"... 17 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd0) (hd0)1+17 p (hd0,5)/boot/grub/stage2 /boot/grub/menu.lst"... failed

Error 22: No such partition
grub>



Trying to see what is going wrong I tried "fdisk -l". Here is the result.



root@ubuntu:/# fdisk -l
omitting empty partition (5)

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 1 510 4096543+ 12 Compaq diagnostics
/dev/sda2 * 511 17219 134215042+ 7 HPFS/NTFS
/dev/sda3 17220 19457 17976735 5 Extended
/dev/sda4 19333 19457 1003968 82 Linux swap / Solaris
/dev/sda5 17220 19332 16972609+ 83 Linux

Disk /dev/sdb: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 1 30401 244196001 c W95 FAT32 (LBA)
root@ubuntu:/#


I think heri0n had the same problem.... So is there any way to recover GRUB, or should I format the disk and start over?

Thank you in advance

Archangel Uriel

komsas
June 5th, 2007, 01:28 PM
I have same problem like ArchangelUriel :) help somebody please :)

Delirious
June 27th, 2007, 03:16 PM
This is the message i get when looking for a boot loader.

Probing devices to guess BIOS drives. This may take a long time.

[ 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> find /boot/grub/stage1
find /boot/grub/stage1

Error 15: File not found
grub>

Then when i try to install it on hd0 it says that it doesn't exist. So far i have waste 3 days trying to just install this. For now i gave up on dual boot and am just focusing on booting this.

I finally found the grub file looking through the gui and it looks like its installed on the swap partition i created on my raid array which is about as far from the primary sata drive that /boot and / are installed on as it can get.

[rant] Seriously im trying to restrain myself but i cant believe ubuntu has this big of a problem doing something this simple. but i guess if having a full featured mouse menu is too hard then this shouldn't surprise me [rant]

forevereating
June 29th, 2007, 08:37 PM
I have GRUB already installed on my windows partition, but I want to reinstall windows, this would thus delete my GRUB. And using the find command shouldn't come back with anything. So my question is, how do I do a clean install of GRUB again? I want to keep my current install of Ubuntu btw. Thanks in advance.

Azakus
June 29th, 2007, 08:50 PM
I have GRUB already installed on my windows partition, but I want to reinstall windows, this would thus delete my GRUB. And using the find command shouldn't come back with anything. So my question is, how do I do a clean install of GRUB again? I want to keep my current install of Ubuntu btw. Thanks in advance.

You don't have to delete GRUB to install Windows. Just put windows in a different partition. The only thing Windows will overwrite will be your MBR, which shouldn't be confused with GRUB. GRUB is the linux bootloader located in /boot/. The MBR is the first 512 bytes of the harddrive that tells the BIOS where to look for a bootloader. Windows overwrites teh MBR when installed, but with dd, you can backup your MBR, install Windows, then replace the Windows MBR with the one you backed up. Then, you can add Windows into your GRUB list to boot Windows from GRUB.
Note: make sure to replace all instances of /dev/hdx with the /dev listing of your harddrive

Step 1: Backup GRUB's MBR

dd if=/dev/hdx of=~/MBRbackup.dd count=1 bs=512

Step 2: Install Windows

Step 3: Restore GRUB's MBR

dd if=~/MBRbackup.dd of=/dev/hdx count=1 bs=446

Step 4: Add Windows to GRUB bootlist
Run this:

sudo /usr/sbin/update-grub
It should automatically add Windows to the boot list.
Then double-check your /boot/grub/menu.lst file and make sure something like this is at the bottom
EXAMPLE!

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title Other operating systems:
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/hdc1
title Microsoft Windows XP Home Edition
root (hd0,3) #Windows is fourth partition
savedefault
makeactive
chainloader +1

forevereating
June 29th, 2007, 09:01 PM
Thanks for the guide, but IIRC my GRUB is not installed in the MBR. I installed it onto a usb stick then using a command created a file called boot.lnx, copy and pasted boot.lnx onto usb stick then onto c:\, and then I edited the hidden windows file boot.ini and added in a line at the end so that it refers to boot.lnx to start GRUB thus booting ubuntu. So when I format my sda1 (windows partition with GRUB inside) I would lose my GRUB, and I would like to reinstall windows to the same partition. Perhaps in other words, is there a sole GRUB installer of some sort? I think thats all I need.

Azakus
June 30th, 2007, 03:25 AM
Thanks for the guide, but IIRC my GRUB is not installed in the MBR. I installed it onto a usb stick then using a command created a file called boot.lnx, copy and pasted boot.lnx onto usb stick then onto c:\, and then I edited the hidden windows file boot.ini and added in a line at the end so that it refers to boot.lnx to start GRUB thus booting ubuntu. So when I format my sda1 (windows partition with GRUB inside) I would lose my GRUB, and I would like to reinstall windows to the same partition. Perhaps in other words, is there a sole GRUB installer of some sort? I think thats all I need.

I think this guild will work better in your case. It installs the full version of grub on any harddisk you wish.
Installing GRUB using grub-install (http://www.gnu.org/software/grub/manual/html_node/Installing-GRUB-using-grub_002dinstall.html#Installing-GRUB-using-grub_002dinstall)

forevereating
June 30th, 2007, 05:17 AM
:confused: so I guess there isn't an easier way to do it? I don't really get the image and root it talks about. Would this method let me install it like I did before?

Bacardilvr
July 1st, 2007, 04:21 AM
Catlett:

Thank you SO much for this guide. I was actually able to use to compete the addition of Ubuntu to my Vista Bootloader. Without the instruction on how to install GRUB to my linux partition, it couldn't have worked. So, thanks again.

OzzMosiz
July 3rd, 2007, 03:03 PM
Ok, I've done the same as most here. Reinstalled Windows XP and voila Grub doesn't work.
I've booted into ubuntu using the CD. Find command in grub doesn't find anything and I cannot mount the /dev/hda drives (tried 0-9).

Any suggestions?

wwoollff
July 3rd, 2007, 04:41 PM
sorry to post another Grub problem but I'm really stuck . I have installed WinXp and tried to restore my grub with a LiveCd.After doing the 'find /boot/grub/stage1 , root (sdX,Y) setup (sdX,Y) ' with absolutely no error, I have restarted my pc and nothing worked.I've tried with the chroot, and the same stuff...and also by mounting the proper partition with the livecd, and checked the devices.map and menu.lst ...

btw, I'm using Ubuntu 7.04 thx.
my fdisk -l

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 1215 9759456 7 HPFS/NTFS
/dev/sda2 1216 8254 56540767+ f W95 Ext'd (LBA)
/dev/sda5 1216 5470 34178256 b W95 FAT32
/dev/sda6 5471 8187 21824271 b W95 FAT32

Disk /dev/sdb: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 2550 20482843+ 7 HPFS/NTFS
/dev/sdb2 2551 28938 211961610 f W95 Ext'd (LBA)
/dev/sdb3 28939 30401 11751547+ 83 Linux
/dev/sdb5 2551 15298 102398278+ 7 HPFS/NTFS
/dev/sdb6 15299 28871 109025091 7 HPFS/NTFS
/dev/sdb7 28872 28938 538146 82 Linux swap / Solaris

my find /boot/grub/stage1: (hd1,2)
and my menu.lst:



# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/hda1
title Microsoft Windows XP Professional
root (hd0,0)
savedefault
makeactive
chainloader +1


title Ubuntu, kernel 2.6.20-15-386
root (hd1,2)
kernel /boot/vmlinuz-2.6.20-15-386 root=UUID=8128ee1b-2a29-4a8a-a68a-45107f35067d ro quiet splash
initrd /boot/initrd.img-2.6.20-15-386

B33R
July 3rd, 2007, 05:45 PM
Thanks for the guide, exactly what I needed!

Now I use ******* for games and Ubuntu for everything else.

a85lee
July 7th, 2007, 04:11 AM
Grub need the grub files to run the setup. The path is where grub will find them. When you do the find command, it is telling you where the file are located on the hard drive. The root (hd?,?) is how you tell grub where the files are. The setup (hd?) is grub installing itself and the patyh you enter there is telling grub where you want it instaled.
You can try running setup (hd0) to see what happens but it appears grub wasn't installed previously. If you know it, enter the path root is on even if grub isn't there. You may get lucky.

Thanks for the tips, just use the way you said without finding it, the GRUB reinstalled successfully, but there is one more problem, there is no Vista in the grub list and ubuntu is not working properly right now..:(:(:( so sad

clinto
July 8th, 2007, 04:20 AM
This is throwing me through a frickin' loop. I'm using the Ubuntu Feisty live cd to reinstall the grub after installing xp. For some reason, the live cd isn't mounting my partitions. The only way I can find them is by using the gui under places>computer. When I open it in Nautilus, it mounts the partition in media but calls it "disk."

So, I decided to try it from there and see if grub would pick it up...


grub> find /media/disk/grub/stage1

Error 15: File not found

grub>

I have my /boot on a separate partition. I can't do anything with the live cd if it doesn't even allow me to access my partitions. I tried looking under /dev and they're not listed. I peeked at /mnt and of course not.

This laptop has two sata drives. I remember changing something in the BIOS to allow windows to read the hard drives. Maybe that's my problem?

RAH66
July 12th, 2007, 12:00 PM
thanx man you saved my *** I dual boot xp for gaming and so on on a seperate drive and old faithful xp crashed and I had to reinstall and it screwed my boot loader didn't know what to do


anyway thanx ......... :)

terabyte1
July 15th, 2007, 03:58 PM
Ooh! Catlett is cool for info - i've saved that reply in case I have that kind of problem (Grub can be grumpy at times) :) !

terabyte1

odin_dax
July 22nd, 2007, 07:39 PM
I have a problem with my GRUB. I followed all the steps in the guide, but when I reboot without the live CD I get "booting Ubuntu..." as normal, followed by "> root (hd0,1)" and nothing else, no boot.
In the steps I've followed, GRUB said (hd0,0). Also, I never saw any text responses after inputting commands in this guide except for "find ...stage1"

HELP!

UPDATE: Tried setting up for (hd0,1), but it says it can't find the partition.

odin_dax
July 22nd, 2007, 08:24 PM
Here's a copy I managed to find through the live CD.

# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not change this entry to 'saved' or your
# array will desync and will not let you boot your system.
default 0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 3

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
hiddenmenu

# Pretty colours
#color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=51e19179-96d5-404a-a6c7-abdd4d962dda ro

## Setup crashdump menu entries
## e.g. crashdump=1
# crashdump=0

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,1)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash

## should update-grub lock old automagic boot options
## e.g. lockold=false
## lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## ## End Default Options ##

title Ubuntu, kernel 2.6.20-16-386
root (hd0,1)
kernel /boot/vmlinuz-2.6.20-16-386 root=UUID=51e19179-96d5-404a-a6c7-abdd4d962dda ro quiet splash
initrd /boot/initrd.img-2.6.20-16-386
savedefault

title Ubuntu, kernel 2.6.20-16-386 (recovery mode)
root (hd0,1)
kernel /boot/vmlinuz-2.6.20-16-386 root=UUID=51e19179-96d5-404a-a6c7-abdd4d962dda ro single
initrd /boot/initrd.img-2.6.20-16-386

title Ubuntu, kernel 2.6.17-11-386
root (hd0,1)
kernel /boot/vmlinuz-2.6.17-11-386 root=UUID=51e19179-96d5-404a-a6c7-abdd4d962dda ro quiet splash
initrd /boot/initrd.img-2.6.17-11-386
savedefault

title Ubuntu, kernel 2.6.17-11-386 (recovery mode)
root (hd0,1)
kernel /boot/vmlinuz-2.6.17-11-386 root=UUID=51e19179-96d5-404a-a6c7-abdd4d962dda ro single
initrd /boot/initrd.img-2.6.17-11-386

title Ubuntu, kernel 2.6.15-28-386
root (hd0,1)
kernel /boot/vmlinuz-2.6.15-28-386 root=UUID=51e19179-96d5-404a-a6c7-abdd4d962dda ro quiet splash
initrd /boot/initrd.img-2.6.15-28-386
savedefault

title Ubuntu, kernel 2.6.15-28-386 (recovery mode)
root (hd0,1)
kernel /boot/vmlinuz-2.6.15-28-386 root=UUID=51e19179-96d5-404a-a6c7-abdd4d962dda ro single
initrd /boot/initrd.img-2.6.15-28-386

title Ubuntu, kernel 2.6.15-26-386
root (hd0,1)
kernel /boot/vmlinuz-2.6.15-26-386 root=UUID=51e19179-96d5-404a-a6c7-abdd4d962dda ro quiet splash
initrd /boot/initrd.img-2.6.15-26-386
savedefault

title Ubuntu, kernel 2.6.15-26-386 (recovery mode)
root (hd0,1)
kernel /boot/vmlinuz-2.6.15-26-386 root=UUID=51e19179-96d5-404a-a6c7-abdd4d962dda ro single
initrd /boot/initrd.img-2.6.15-26-386

title Ubuntu, memtest86+
root (hd0,1)
kernel /boot/memtest86+.bin

### END DEBIAN AUTOMAGIC KERNELS LIST

confused57
July 22nd, 2007, 08:34 PM
Post the output of:

sudo fdisk -l
-l is a small "L"

If you resized the root partition, your UUID may have changed, you can enter the command "blkid" and compare it with the UUID in your kernel line:

blkid

odin_dax
July 23rd, 2007, 12:32 AM
Post the output of:

sudo fdisk -l
-l is a small "L"

If you resized the root partition, your UUID may have changed, you can enter the command "blkid" and compare it with the UUID in your kernel line:

blkid

If I run GParted off the CD, will that work? All this started after a failed dual-boot partition. Anyway, working on the fdisk.

Also, some files are locked under my (owner) ID. Is there any way to access those under a live CD for backup?

odin_dax
July 23rd, 2007, 12:35 AM
fdisk -l

Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 12958 104077102+ 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 12959 14232 10233405 7 HPFS/NTFS
/dev/sda3 14233 14593 2899732+ 5 Extended
/dev/sda5 14233 14593 2899701 82 Linux swap / Solaris

---------------------------------
blkid

/dev/sda1: UUID="51e19179-96d5-404a-a6c7-abdd4d962dda" SEC_TYPE="ext2" TYPE="ext3"
/dev/sda2: TYPE="ntfs"
/dev/sda5: TYPE="swap" UUID="b855e3e2-29b7-4fcc-bb65-a1279a08d5db"

confused57
July 23rd, 2007, 02:05 AM
fdisk -l

Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 12958 104077102+ 83 Linux
Partition 1 does not end on cylinder boundary.
/dev/sda2 12959 14232 10233405 7 HPFS/NTFS
/dev/sda3 14233 14593 2899732+ 5 Extended
/dev/sda5 14233 14593 2899701 82 Linux swap / Solaris

---------------------------------
blkid

/dev/sda1: UUID="51e19179-96d5-404a-a6c7-abdd4d962dda" SEC_TYPE="ext2" TYPE="ext3"
/dev/sda2: TYPE="ntfs"
/dev/sda5: TYPE="swap" UUID="b855e3e2-29b7-4fcc-bb65-a1279a08d5db"

You could try highlighting your Ubuntu entry in your grub boot menu when you're booting your computer(without the live cd), press "e" to edit, highlight the line beginning with root, press "e" again, change root from (hd0,1) to (hd0,0), press "enter", then press "b" to boot...this is just a temporary change, but can be made permanent if it works.

Is the /dev/sda3 an installed Windows or just a ntfs partition?

odin_dax
July 23rd, 2007, 02:24 AM
You could try highlighting your Ubuntu entry in your grub boot menu when you're booting your computer(without the live cd), press "e" to edit, highlight the line beginning with root, press "e" again, change root from (hd0,1) to (hd0,0), press "enter", then press "b" to boot...this is just a temporary change, but can be made permanent if it works.

Is the /dev/sda3 an installed Windows or just a ntfs partition?

sda3 is a failed Windows install. The story goes, I was installing Windows XP for a dual-boot, it said it had to restart, then it locked on a blank screen after reboot, I tried rebooting manually, same result, then I got the grub errors after removing the XP CD.

After all this, I'll GPart the partition back to Ubuntu.

*********
I'll try your steps. I have to run for a party, but I'll post the results after I get back and try them.

@anybody - any methods in recovering locked personal files from a live CD?

odin_dax
July 23rd, 2007, 04:17 AM
Thank you, confused, it worked!!!!!

Once everything loaded properly, I edited the grub menu and it worked perfectly. Well, there is one screen after it says "Loading GRUB..." that says near the bottom "blah blah blah... savedefault..." that lasts about ten seconds, but the splash screen is faster, so I guess it's a trade off. I'm not too bothered, the thing works again, and I rarely turn the computer off.

Thanks again, confused!

confused57
July 23rd, 2007, 05:01 AM
Thank you, confused, it worked!!!!!

Once everything loaded properly, I edited the grub menu and it worked perfectly. Well, there is one screen after it says "Loading GRUB..." that says near the bottom "blah blah blah... savedefault..." that lasts about ten seconds, but the splash screen is faster, so I guess it's a trade off. I'm not too bothered, the thing works again, and I rarely turn the computer off.

Thanks again, confused!
Glad to help & that it worked. If you want to make the change permanent in your menu.lst:

cd /boot/grub
sudo cp menu.lst menu.lst_backup
gksudo gedit menu.lst

If you haven't already, change your root entries to (hd0,0) and be sure to change the line beginning with #groot to (hd0,0):
http://users.bigpond.net.au/hermanzone/p15.htm#groot

Then just quit & save.

lonrot
July 26th, 2007, 09:55 PM
excellent, it was quite simple.

lonrot
July 26th, 2007, 10:13 PM
Guys I need big help, I have done these steps before and they worked in the past, but now, I can't be able to see the grub at startup again, here is the terminal log.


GNU GRUB version 0.97 (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> find /boot/grub/stage1
(hd0,1)

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

grub> setup (hd0,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 (hd0,1)"... failed (this is not fatal)
Running "embed /boot/grub/e2fs_stage1_5 (hd0,1)"... failed (this is not fatal)
Running "install /boot/grub/stage1 (hd0,1) /boot/grub/stage2 p /boot/grub/menu
.lst "... succeeded
Done.

grub>

I'm using also Windows XP x64 on other parition.

ccalvinfowler@aol.com
August 3rd, 2007, 11:21 PM
All you gus are a GodSend. I would never be able to get as much help from Mcrosoft as I get from you all. I am glad that I switched to using Xubuntu. Once I get my networking issues taken care of I will probably delete the Windows OS. I will have to wait until my grlfriend gets a little more practice with Xubuntu. I am really loving it and could not be any more happier with the help that I have received from everyone on these forums.

Thank You all very very much

ccalvinfowler@aol.com
August 3rd, 2007, 11:54 PM
okay now i have done what the psots say to do and my comp boots straight to Winxp with no option of loading xubuntu n ow what

confused57
August 4th, 2007, 01:53 AM
okay now i have done what the psots say to do and my comp boots straight to Winxp with no option of loading xubuntu n ow what
If you have 2 hard drives, you might try booting first to the other hard drive.

JoJo
August 4th, 2007, 03:58 AM
I wanted to install Feisty on a blank partition, so I did. I can't get GRUB to load though. It just goes straight to Windows. I tried reinstalling GRUB as per the instructions at the beginning of this topic, but to no avail. It still goes straight to Windows, even though it says that that hard drive was recognized and the installation of GRUB was successful on the correct partition, which the partition I want it on is the partition with Ubuntu on it. It may have something to do with the version of Windows I have, which is the x64 edition. I don't know and I'm stumped. Please help!

murak
August 4th, 2007, 03:24 PM
I installed XP on my pc and after that installed Ubuntu. This resulted in XP breaking, so I installed XP agin, wich made the Grub dissapare. I installed the grub again following the guide on this forum (well one of them) Grub was up again, but I got the "error 17" when trying to boot Ubuntu. No guides have helped so far, only thing left to try is the "super grub bootcd" wich I will try later. Anyway, just now I pressed "e" while marking the Ubuntu alternative in Grub, wich let me edit some lines. I changed the value "(hd0,3)" to "(hd0,2)" and pressed "b" to boot, wich worked! Ubuntu booted fine. But the value is not saved so I guese there is some textfile somewhere where I can change the value permanently.

Hope this helps someone.

hypnos
August 6th, 2007, 04:32 PM
... I changed the value "(hd0,3)" to "(hd0,2)" and pressed "b" to boot, wich worked! Ubuntu booted fine. But the value is not saved so I guese there is some textfile somewhere where I can change the value permanently.

Hope this helps someone.

Edit the menu.lst file located in /boot/grub/ folder. At the end of file you will see exactly the same entries which you've edit while booting the machine.

murak
August 10th, 2007, 11:30 PM
Thank you Hypnos!

JoJo
August 13th, 2007, 08:08 PM
I wanted to install Feisty on a blank partition, so I did. I can't get GRUB to load though. It just goes straight to Windows. I tried reinstalling GRUB as per the instructions at the beginning of this topic, but to no avail. It still goes straight to Windows, even though it says that that hard drive was recognized and the installation of GRUB was successful on the correct partition, which the partition I want it on is the partition with Ubuntu on it. It may have something to do with the version of Windows I have, which is the x64 edition. I don't know and I'm stumped. Please help!

I still need help with this problem which I posted a week ago.

confused57
August 14th, 2007, 12:46 AM
I wanted to install Feisty on a blank partition, so I did. I can't get GRUB to load though. It just goes straight to Windows. I tried reinstalling GRUB as per the instructions at the beginning of this topic, but to no avail. It still goes straight to Windows, even though it says that that hard drive was recognized and the installation of GRUB was successful on the correct partition, which the partition I want it on is the partition with Ubuntu on it. It may have something to do with the version of Windows I have, which is the x64 edition. I don't know and I'm stumped. Please help!

I still need help with this problem which I posted a week ago.
Have you tried setting the bios to boot first to the other hard drive, if it's capable of doing this?

You might want to boot the Ubuntu live cd, open a terminal(Applications---Accessories---Terminal), post the output of:

sudo fdisk -l
-l is a lowercase "L"

You can also mount your root partition from the live cd:
http://users.bigpond.net.au/hermanzone/p10.htm#Mounting_Ubuntu_with_Dapper_Desktop_LiveCD
you might want to post the boot entries in your /boot/grub/menu.lst

Have you tried using the Super Grub Disk to boot Ubuntu?:
http://users.bigpond.net.au/hermanzone/SuperGrubDiskPage.html

Another thing you could do is install grub to the root partition, using the live cd, then try a GAG floppy or cd to boot Ubuntu:
http://users.bigpond.net.au/hermanzone/p12.htm

ofrexo
August 18th, 2007, 12:49 PM
I have tried various ways to fix the grub (error 21)
Could someone help me?.

My fdisk.


ubuntu@ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 23564 189277798+ 83 Linux
/dev/sda2 23565 24321 6080602+ 5 Extended
/dev/sda5 23565 24321 6080571 82 Linux swap / Solaris

confused57
August 18th, 2007, 08:36 PM
I have tried various ways to fix the grub (error 21)
Could someone help me?.

My fdisk.


ubuntu@ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 23564 189277798+ 83 Linux
/dev/sda2 23565 24321 6080602+ 5 Extended
/dev/sda5 23565 24321 6080571 82 Linux swap / Solaris

Here are some possible solutions for grub error 21:
http://users.bigpond.net.au/hermanzone/SuperGrubDiskPage.html#21

You might want to try using the Super Grub Disk to boot Ubuntu:
http://users.bigpond.net.au/hermanzone/SuperGrubDiskPage.html
I would try SGD to see if it confirms the error 21, if it's not able to boot your system.

Also, you probably don't need more than 2 Gb of swap...if you have 1 Gb memory, 1 Gb swap should be sufficient.

gardara
August 23rd, 2007, 09:32 PM
Great tutorial. Helped me after my grub screwed up after ghosting.

4partee
September 4th, 2007, 02:08 PM
Vista is owning the MBR.

I am setting up a dual-boot notebook, Compaq F572US.

When I start Vista from the grub menu, I am forced to do a system recovery by Vista. When I recover and reboot, the grub menu is gone and the notebook boots directly into Vista. Those dirty cork soakers!

I believe what I need is to create a DVD or flash/usb that can be used to boot into Ubuntu. How to do that?

John

I installed grub to a usb/flash per http://users.bigpond.net.au/hermanzone/p15.htm#How_to_add_Grub_to_your_USB_thumb_drive. and now I get error 22:.

mahasmb
September 6th, 2007, 02:04 AM
I just re-installed Windows XP. After doing so, GRUB didn't show up. Windows just booted up by itself.

So I followed this HOWTO. Now GRUB shows up and Ubuntu boots... but I can't get Windows to boot up. I've tried changing from root (hd0,0) to root (hd0,0) with GRUB, but nothing loads up Windows.

EDIT:
I went here (http://users.bigpond.net.au/hermanzone/p10.htm#Mounting_Ubuntu_with_Dapper_Desktop_LiveCD ) and after mounting my disk and changing my menu.lst file, Windows booted!

mahasmb
September 11th, 2007, 03:26 AM
When I reboot my laptop, and GRUB boots up, I get a "GRUB error 17". The GRUB menu won't come up.

I tried this How To, and it says it's installed GRUB again and even written to menu.lst, but when I reboot, nothing changes. I still get the same error.

What should I do?

confused57
September 11th, 2007, 04:11 AM
When I reboot my laptop, and GRUB boots up, I get a "GRUB error 17". The GRUB menu won't come up.

I tried this How To, and it says it's installed GRUB again and even written to menu.lst, but when I reboot, nothing changes. I still get the same error.

What should I do?

Here are some possible solutions for grub error 17:
http://users.bigpond.net.au/hermanzone/p15.htm#17

Check out the link to the thread by American Yellow.

mahasmb
September 11th, 2007, 10:08 AM
Thanks, but it's still not fixing my problem. I even tried Super Grub Disk.

One thing I have to note is that I always get the following error whenever I try to mount my Ubuntu partition


mount -t ext3 /dev/hda3 /mnt/ubuntu
mount: wrong fs type, bad option, bad superblock on /dev/hda3,
missing codepage or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

Campingman
September 14th, 2007, 10:32 PM
Thanks catlett,

Ended a couple of hours of messing about for me, nice one

I was returning an error 15, used the supergrub CD to boot into Xubuntu and did the repair from the OS I wanted to boot. Worked a treat!

:):):):):):)

applegrew
September 16th, 2007, 08:12 PM
Hey thanks for the great and simple post. Nice trick. Anyway I thought that this process will reset my menu.lst (which I had modded a little), but it didn't, so that was good for me, but also it gave me a little surprise. I could now reach to Grub menu but I could no longer boot. Grub complained that the partition was not found.......

Anyway I had figured it out. Initially my partitons were (hd0,2), but after I deleted a partiton it became (hd0,1). All I had to do was edit my menu.lst at /boot/grub.

For those who face such problem and are thinking of going back to the Live CD and boot and edit the menu.lst. Here is an easier way.
Just highlight the entry in Grub and press 'e' then highlight the line to edit and press 'e' again. Edit that and press Enter. Now press 'b' to boot. :D

orangenick
September 18th, 2007, 09:07 PM
[delete this comment]

Chymera
September 21st, 2007, 08:07 PM
I tried doing what you said but i still get the same problem (bootloader does not boot my ubuntu entry, after a sabayon install)

any ideas as to how i can fix it?

murak
September 21st, 2007, 08:12 PM
What kind of error message do you get? maby you just have to edit the .list? If not, ignore my post.

Chymera
September 21st, 2007, 08:15 PM
you may be right, but i have no idea what to edit, message is as follows

rootnoverif (hd0,1)
chainloader +1
Error 13: Invalid or unsupported executable format

sgtbob
September 22nd, 2007, 12:15 AM
I realize this is an old message - but I want to thank the author - it saved my having to do a lot of re-installing to recoup my grub file. I wish I had found it before i had to reformat a second PC and start all over. Many thanks.:)http://ubuntuforums.org/images/smilies/new_popcornsmiley.gif

Chymera
September 22nd, 2007, 07:41 PM
solved, if anyone else runs into similar trouble, look here http://ubuntuforums.org/showthread.php?t=556610

g4ry.l33
September 30th, 2007, 03:28 PM
Thanks for the post! The first part is all I needed. Ubuntu is GREAT &
this place ROCKS! :guitar:

74nK5 !

w0utje
October 24th, 2007, 01:46 PM
thnx this helped for me. i had ubuntu 6.06 LTS and then installed vista..
so my grub was gone from MBR. so then I could't load ubuntu. a little time after i installed vista i deleted it and installed XP. but i couldn't get on ubuntu here either. so i searched and found this article. it was fixed in no time! thanks!:)

tech9
October 24th, 2007, 03:12 PM
This will restore grub if you already had grub installed but lost it to a windows install or some other occurence that erased/changed your MBR so that grub no longer appears at start up or it returns an error.

(This how to is written for Ubuntu but should work on other systems. The only thing to take note of, when you see "sudo" that will mean to you that the following command should be entered at a root terminal.)

Boot into the live Ubuntu cd. This can be the live installer cd or the older live session Ubuntu cds.

When you get to the desktop open a terminal and enter. (I am going to give you the commands and then I will explain them later)


sudo grub

This will get you a "grub>" prompt (i.e. the grub shell). At grub>. enter these commands


find /boot/grub/stage1

This will return a location. If you have more than one, select the installation that you want to provide the grub files.
Next, THIS IS IMPORTANT, whatever was returned for the find command use it in the next line (you are still at grub>. when you enter the next 3 commands)


root (hd?,?)
Again use the value from the find command i.e. if find returned (hd0,1) then you would enter root (hd0,1)

Next enter the command to install grub to the mbr


setup (hd0)

Finally exit the grub shell

quit

That is it. Grub will be installed to the mbr.
When you reboot, you will have the grub menu at startup.

Now the explanation.
Sudo grub gets you the grub shell.
Find /boot/grub/stage1 has grub locate the file stage1. What this does is tell us where grub's files are. Only a small part of grub is located on the mbr, the rest of grub is in your boot folder. Grub needs those files to run the setup. So you find the files and then you tell grub where to locate the files it will need for setup.
So root (hd?,?) tells grub it's files are on that partition.
Finally setup (hd0) tells grub to setup on hd0. When you give grub the parameter hd0 with no following value for a partition, grub will use the mbr. hd0 is the grub label for the first drive's mbr.
Quit will exit you from the grub shell.



THIS IS AN EDIT. 5-HT MADE A GOOD POINT AND I AM JUST GOING TO COPY/PASTE IT HERE



THIS IS ANOTHER EDIT. TOSK POSTED A WAY TO MOUNT PROC AND UDEV. THIS WAS NEEDED BECAUSE GRUB WASN'T RECOGNISING THE DRIVE. I THOUGHT IT WAS A VALUABLE COMMENT AND DECIDED TO PUT IT IN THE ORIGINAL POST SO PEOPLE WILL SEE IT AT THE TOP. IT MAY BE MISSED AS JUST A REPLY POST DOWN THE PAGE.
ALL KNOWLEDGE IS WELCOME!





**This set of instruction is a combination of 2 guides I saw before. One was a Mepis grub how to but I never found it again. The other is the grub manual. It's section explained the find, root, setup process but never mentioned it could be done from a live session.

This is the grub link http://www.gnu.org/software/grub/manual/html_node/Installing-GRUB-natively.html#Installing-GRUB-natively

Post script;
Just to post as much information as possible, this is an older how to for resoring grub to the mbr. The original post is directions for using the install cd and then there are replies that mention the method I posted here, as well as the chroot method mlind mentioned. If this method fails, you may want to try this http://ubuntuforums.org/showthread.php?t=24113

very nice tutorial!

JJL79
October 25th, 2007, 04:21 PM
I was going to remove a hdd from system but removed wrong one. I noticed this when i tried to boot so i installed the hdd again but now i got

Error 15

Have tried the live cd and Sudo Grub thing which seems to work ok and also supergrub but i still get Error 15. I am using install cd to boot from first hdd to get system running.

Any ideas what to do next?

meierfra
October 25th, 2007, 04:51 PM
Probably the boot order of your hard drives has changed and now grub is looking for ubuntu on the wrong hard drive. You might be able change the boot order in the bios to fix the problem.
If that does not work you will have to edit "menu.lst.

JJL79
October 25th, 2007, 07:18 PM
Probably the boot order of your hard drives has changed and now grub is looking for ubuntu on the wrong hard drive. You might be able change the boot order in the bios to fix the problem.
If that does not work you will have to edit "menu.lst.

When i connected the disk again everything was back to how it was when it worked. Is it still possible that boot order changed?

JJL79
October 25th, 2007, 07:59 PM
I have tried to edit menu.lst by changing hd(0,0) to other like 1.0 0.1 and such but then i cannot even use "boot from first disk" in install cd

yourtvlies
October 26th, 2007, 07:44 AM
This thread just saved me hours of work. Thank you, thank you, thank you.

eddie_gordo
October 28th, 2007, 08:19 PM
Guys, I'm about to try this "How to" on how to restore grub in my laptop... But I have a question:


When I'm supposed to write


setup (hd0)

isn't this referring to the partition on my laptop that has all the recovery system from Asus? Should I write:


setup(hd0,1)

instead? Or better, shouldn't I write setup(hd0,X), where X is the partition where Ubuntu is installed? Or in any case it will always be setup(hd0)?

Thanks in advance...

meierfra
October 28th, 2007, 09:44 PM
setup (hd0)
isn't this referring to the partition on my laptop that has all the recovery system from Asus?

No, (hd0) will put grub on the first sector of the hard drive. Your recovery partition is (hd0,0) (not (hd0))

Bernie01
October 29th, 2007, 10:56 AM
I have tried following the steps outlined here and I still cannot get GRUB working.

Here the results of what I have done so far:--

[ 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> find /boot/grub/stage1

(hd1,1)

(hd1,2) Would this be a reason for my problems?



grub> root (hd1,1)



grub> setup (hd1)

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 (hd1)"... 17 sectors are embedded.

succeeded

Running "install /boot/grub/stage1 (hd1) (hd1)1+17 p (hd1,1)/boot/grub/stage2

/boot/grub/menu.lst"... succeeded

Done.



grub>



ubuntu@ubuntu:~$ sudo mkdir /mnt/root

ubuntu@ubuntu:~$ sudo mount -t ext3 /dev/sdb2 /mnt/root

ubuntu@ubuntu:~$ sudo mount -t proc none /mnt/root/proc

ubuntu@ubuntu:~$ sudo mount -o bind /dev /mnt/root/dev

ubuntu@ubuntu:~$ sudo chroot /mnt/root /bin/bash

root@ubuntu:/#


root@ubuntu:/# sudo fdisk -l



Disk /dev/sda: 40.0 GB, 40060403712 bytes

255 heads, 63 sectors/track, 4870 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk identifier: 0x019f019f



Device Boot Start End Blocks Id System

/dev/sda1 * 1 3205 25744131 c W95 FAT32 (LBA)

/dev/sda2 3206 4870 13374112+ c W95 FAT32 (LBA)



Disk /dev/sdb: 250.0 GB, 250059350016 bytes

255 heads, 63 sectors/track, 30401 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk identifier: 0x11a611a5



Device Boot Start End Blocks Id System

/dev/sdb1 * 1 7649 61440561 7 HPFS/NTFS

/dev/sdb2 7650 11297 29302560 83 Linux

/dev/sdb3 11298 14944 29294527+ 83 Linux



Disk /dev/sdc: 250.0 GB, 250059350016 bytes

255 heads, 63 sectors/track, 30401 cylinders

Units = cylinders of 16065 * 512 = 8225280 bytes

Disk identifier: 0xc72a52db



Device Boot Start End Blocks Id System

/dev/sdc1 * 1 12748 102398278+ b W95 FAT32

/dev/sdc2 12749 25496 102398310 b W95 FAT32

/dev/sdc3 25497 26006 4096575 82 Linux swap / Solaris

root@ubuntu:/#


root@ubuntu:/# gedit /boot/grub/menu.lst

cannot open display:

Run 'gedit --help' to see a full list of available command line options.

root@ubuntu:/#


I located menu.lst using Nautilus

# menu.lst - See: grub(8), info grub, update-grub(8)

# grub-install(8), grub-floppy(8),

# grub-md5-crypt, /usr/share/doc/grub

# and /usr/share/doc/grub-doc/.



## default num

# Set the default entry to the entry number NUM. Numbering starts from 0, and

# the entry number 0 is the default if the command is not used.

#

# You can specify 'saved' instead of a number. In this case, the default entry

# is the entry saved with the command 'savedefault'.

# WARNING: If you are using dmraid do not use 'savedefault' or your

# array will desync and will not let you boot your system.

default 0



## timeout sec

# Set a timeout, in SEC seconds, before automatically booting the default entry

# (normally the first entry defined).

timeout 10



## hiddenmenu

# Hides the menu by default (press ESC to see the menu)

#hiddenmenu



# Pretty colours

#color cyan/blue white/blue



## password ['--md5'] passwd

# If used in the first section of a menu file, disable all interactive editing

# control (menu entry editor and command-line) and entries protected by the

# command 'lock'

# e.g. password topsecret

# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/

# password topsecret



#

# examples

#

# title Windows 95/98/NT/2000

# root (hd0,0)

# makeactive

# chainloader +1

#

# title Linux

# root (hd0,1)

# kernel /vmlinuz root=/dev/hda2 ro

#



#

# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST



### BEGIN AUTOMAGIC KERNELS LIST

## lines between the AUTOMAGIC KERNELS LIST markers will be modified

## by the debian update-grub script except for the default options below



## DO NOT UNCOMMENT THEM, Just edit them to your needs



## ## Start Default Options ##

## default kernel options

## default kernel options for automagic boot options

## If you want special options for specific kernels use kopt_x_y_z

## where x.y.z is kernel version. Minor versions can be omitted.

## e.g. kopt=root=/dev/hda1 ro

## kopt_2_6_8=root=/dev/hdc1 ro

## kopt_2_6_8_2_686=root=/dev/hdc2 ro

# kopt=root=UUID=bbc09990-36cd-404e-9fb1-cebc214a9873 ro



## Setup crashdump menu entries

## e.g. crashdump=1

# crashdump=0



## default grub root device

## e.g. groot=(hd0,0)

# groot=(hd1,1)



## should update-grub create alternative automagic boot options

## e.g. alternative=true

## alternative=false

# alternative=true



## should update-grub lock alternative automagic boot options

## e.g. lockalternative=true

## lockalternative=false

# lockalternative=false



## additional options to use with the default boot option, but not with the

## alternatives

## e.g. defoptions=vga=791 resume=/dev/hda5

# defoptions=quiet splash



## should update-grub lock old automagic boot options

## e.g. lockold=false

## lockold=true

# lockold=false



## Xen hypervisor options to use with the default Xen boot option

# xenhopt=



## Xen Linux kernel options to use with the default Xen boot option

# xenkopt=console=tty0



## altoption boot targets option

## multiple altoptions lines are allowed

## e.g. altoptions=(extra menu suffix) extra boot options

## altoptions=(recovery) single

# altoptions=(recovery mode) single



## controls how many kernels should be put into the menu.lst

## only counts the first occurence of a kernel, not the

## alternative kernel options

## e.g. howmany=all

## howmany=7

# howmany=all



## should update-grub create memtest86 boot option

## e.g. memtest86=true

## memtest86=false

# memtest86=true



## should update-grub adjust the value of the default booted system

## can be true or false

# updatedefaultentry=false



## should update-grub add savedefault to the default options

## can be true or false

# savedefault=false



## ## End Default Options ##



title Ubuntu 7.10, kernel 2.6.22-14-generic

root (hd1,1)

kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=bbc09990-36cd-404e-9fb1-cebc214a9873 ro quiet splash

initrd /boot/initrd.img-2.6.22-14-generic

quiet



title Ubuntu 7.10, kernel 2.6.22-14-generic (recovery mode)

root (hd1,1)

kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=bbc09990-36cd-404e-9fb1-cebc214a9873 ro single

initrd /boot/initrd.img-2.6.22-14-generic



title Ubuntu 7.10, memtest86+

root (hd1,1)

kernel /boot/memtest86+.bin

quiet



### END DEBIAN AUTOMAGIC KERNELS LIST



# This is a divider, added to separate the menu items below from the Debian

# ones.

title Other operating systems:

root





# This entry automatically added by the Debian installer for a non-linux OS

# on /dev/sdb1

title Microsoft Windows XP Home Edition

root (hd1,0)

savedefault

makeactive

map (hd0) (hd1)

map (hd1) (hd0)

chainloader +1





# This entry automatically added by the Debian installer for an existing

# linux installation on /dev/sdb3.

title Ubuntu 7.10, kernel 2.6.22-14-generic (on /dev/sdb3)

root (hd1,2)

kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=d903c486-d0ca-4d71-837b-b8d535c7d808 ro quiet splash

initrd /boot/initrd.img-2.6.22-14-generic

savedefault

boot





# This entry automatically added by the Debian installer for an existing

# linux installation on /dev/sdb3.

title Ubuntu 7.10, kernel 2.6.22-14-generic (recovery mode) (on /dev/sdb3)

root (hd1,2)

kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=d903c486-d0ca-4d71-837b-b8d535c7d808 ro single

initrd /boot/initrd.img-2.6.22-14-generic

savedefault

boot





# This entry automatically added by the Debian installer for an existing

# linux installation on /dev/sdb3.

title Ubuntu 7.10, memtest86+ (on /dev/sdb3)

root (hd1,2)

kernel /boot/memtest86+.bin

savedefault

boot

I hope somebody can help me with this mystery

Cheers, Bernie

meierfra
October 29th, 2007, 02:33 PM
grub> find /boot/grub/stage1

(hd1,1)

(hd1,2) Would this be a reason for my problems?

No. That's just because you to have two versions of linux on your computer. Shouldn't cause any problems



grub> root (hd1,1)
grub> setup (hd1)

Replace "setup (hd1)" by "setup (hd0)". So just do



sudo grub

grub> root (hd1,1)

grub> setup (hd0)

grub> quit


in a terminal in the Live CD. Reboot and you should be all set.

Bernie01
October 30th, 2007, 12:57 AM
Thanks for the reply meierfra. I am away for the next couple of days and will try it when I return home.

CeeDub
October 31st, 2007, 02:10 AM
Oh please help me. I went through the walkthrough and everything seems to have gone fine. When I reboot into grub and try to boot into Ubuntu, it says error 17. Windows will boot ok. I've searched through this thread and someone said that they need to edit their menu.lst. I am pretty sure that's what I need to do, but I don't know what to edit. I can't even get any of my partitions mounted correctly. HELP!

meierfra
October 31st, 2007, 05:24 AM
CeeDub: Please post the output of


gksudo gedit /boot/grub/menu.lst

and


sudo fdisk -l
(all l are lower case L)

Bernie01
October 31st, 2007, 10:25 PM
No. That's just because you to have two versions of linux on your computer. Shouldn't cause any problems



Replace "setup (hd1)" by "setup (hd0)". So just do



sudo grub

grub> root (hd1,1)

grub> setup (hd0)

grub> quit


in a terminal in the Live CD. Reboot and you should be all set.

Hi meierfra,

Back home now and tried your suggestion with no luck. I still receive 'Error 15 File does not exist'

Here is the screen from Terminal while I was entering the commands:-

grub> root (hd1,1)



grub> setup (hd0)

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 (hd0)"... 17 sectors are embedded.

succeeded

Running "install /boot/grub/stage1 d (hd0) (hd0)1+17 p (hd1,1)/boot/grub/stage

2 /boot/grub/menu.lst"... succeeded

Done.



grub>

If you can see anything in this or suggest something that will help I would greatly appreciate it.

Cheers, Bernie

meierfra
October 31st, 2007, 11:07 PM
I still receive 'Error 15 File does not exist'

Bernie01: Do you get this error after selecting ubuntu in the grub menu? Or does the grub menu not even appear at boot up?

Bernie01
October 31st, 2007, 11:10 PM
THe error message appears after selecting Ubuntu from the GRUB menu

confused57
November 1st, 2007, 02:26 AM
THe error message appears after selecting Ubuntu from the GRUB menu
Have you tried setting your bios to boot your sda drive as the first hard drive in the boot priority?

Bernie01
November 1st, 2007, 03:39 AM
Have you tried setting your bios to boot your sda drive as the first hard drive in the boot priority?


No, I didn't think of that. I will try it when I get home from work tonight. Thanks

meierfra
November 1st, 2007, 03:53 AM
Changing your booting order might work, But you would also have to change all (hd1,1) in your menu.lst to (hd0,1). ) ( Edit: I'm No longer sure about this. Maybe It would work even editing menu.lst)

You might also try either of these:

1) At the grub menu press "c".
type "find /boot/grub/stage1" and press enter.
This will return (hdx,y). If this isn't (hd1,1), then press "Esc", You should be back to the grub menu. Select ubuntu (but don't press enter)
Press "e" and again "e". Change "root (hd1,1)" to "root (hdx,y)". Press enter and then "b". If this boots you into ubuntu, change (hd1,1) in menu.lst to (hdx,y) and everything should be fine.

You might also try to replace (hd1,1) but some random (or systematic) combinations and see what happens.

2) Get super grub:

Info on Super Grub on Hermanzone. (http://users.bigpond.net.au/hermanzone/SuperGrubDiskPage.html)

Bernie01
November 1st, 2007, 10:48 AM
Changing your booting order might work, But you would also have to change all (hd1,1) in your menu.lst to (hd0,1).

You might also try either of these:

1) At the grub menu press "c".
type "find /boot/grub/stage1" and press enter.
This will return (hdx,y). If this isn't (hd1,1), then press "Esc", You should be back to the grub menu. Select ubuntu (but don't press enter)
Press "e" and again "e". Change "root (hd1,1)" to "root (hdx,y)". Press enter and then "b". If this boots you into ubuntu, change (hd1,1) in menu.lst to (hdx,y) and everything should be fine.

You might also try to replace (hd1,1) but some random (or systematic) combinations and see what happens.

2) Get super grub:

Info on Super Grub on Hermanzone. (http://users.bigpond.net.au/hermanzone/SuperGrubDiskPage.html)


meierfra, It is finally fixed. I followed your instructions in 1) and the result was (hd0,1). It was simply a matter of editing menu.lst from there and works perfectly.

Please accept my gratitude for your patience and assistance.

Cheers, Bernie

krige
November 1st, 2007, 01:49 PM
I have recently formatted my laptop and installed Windows XP and Ubuntu 7.10 one after the other. After having finished the installation of the latter and having rebooted I got the error message "Error loading operating system". Rebooting from Ubuntu installation CD and trying with "find /boot/grub/stage1" I get the error "Error 15: File not found".

I can't mount my root partition because I don't know where exactly my Ubuntu is installed. If I run "sudo fdisk -l" I get the error "sudo: unable to execute /sbin/fdisk: Input/output error". From the live CD all the partitions are working fine: Windows is mounted on /media/disk, Ubuntu on /media/disk-1 and there is a data partition mounted on /media/disk-2

Any clues?

krige
November 1st, 2007, 03:29 PM
I have recently formatted my laptop and installed Windows XP and Ubuntu 7.10 one after the other. After having finished the installation of the latter and having rebooted I got the error message "Error loading operating system". Rebooting from Ubuntu installation CD and trying with "find /boot/grub/stage1" I get the error "Error 15: File not found".

I rebooted with the installation CD and this time "fdisk -l" magically worked: I got to know that the partition where my Ubuntu is installed is /dev/sda3 so I ran the following commands:

sudo mkdir /mnt/root
sudo mount -t ext3 /dev/sda3 /mnt/root
sudo mount -t proc none /mnt/root/proc
sudo mount -o bind /dev /mnt/root/dev
sudo chroot /mnt/root /bin/bash
sudo grub
find /boot/grub/stage1

and got again the message "Error 15: File not found".

ferossan
November 1st, 2007, 05:28 PM
Here I'm in trouble too. (Probably because I have a Sata and an IDE drive together)
I just installed ubuntu 7.10 beside XP (XP first and then Ubuntu) and Grub doesn't appear. System boot goes directly to XP without show Grub.
If I boot from the Live CD and choose "Boot from first hard disk" I'm able to boot XP or Ubuntu without problems
I'm wondering if will work something like this (I don't want to mess it up so I want to ask first) :

sudo grub
grub> root (hd1,1)
grub> setup (hd0)
grub> quit

Considering:
sudo fdisk -l
find /boot/grub/stage1
and my grub menu.lst

What I have:

fer@fer-desktop:~$ sudo fdisk -l

Disco /dev/sda: 82.3 GB, 82348277760 bytes
255 cabezas, 63 sectores/pistas, 10011 cilindros
Unidades = cilindros de 16065 * 512 = 8225280 bytes
Disk identifier: 0xa84fa84f

Disposit. Inicio Comienzo Fin Bloques Id Sistema
/dev/sda1 * 1 5543 44524116 7 HPFS/NTFS
/dev/sda2 5544 9823 34379100 83 Linux
/dev/sda3 9824 10011 1510110 5 Extendida
/dev/sda5 9824 10011 1510078+ 82 Linux swap / Solaris

Disco /dev/hdb: 40.0 GB, 40020664320 bytes
255 cabezas, 63 sectores/pistas, 4865 cilindros
Unidades = cilindros de 16065 * 512 = 8225280 bytes
Disk identifier: 0x0008cfb4

Disposit. Inicio Comienzo Fin Bloques Id Sistema
/dev/hdb1 * 1 4865 39078081 7 HPFS/NTFS
fer@fer-desktop:~$


grub> find /boot/grub/stage1
(hd1,1)

And my Grub menu.lst
# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not use 'savedefault' or your
# array will desync and will not let you boot your system.
default 0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 10

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu

# Pretty colours
#color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=e96c96f0-faf1-40be-ba44-e8ff47413070 ro

## Setup crashdump menu entries
## e.g. crashdump=1
# crashdump=0

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd1,1)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash locale=es_ES

## should update-grub lock old automagic boot options
## e.g. lockold=false
## lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

## ## End Default Options ##

title Ubuntu 7.10, kernel 2.6.22-14-generic
root (hd1,1)
kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=e96c96f0-faf1-40be-ba44-e8ff47413070 ro quiet splash locale=es_ES
initrd /boot/initrd.img-2.6.22-14-generic
quiet

title Ubuntu 7.10, kernel 2.6.22-14-generic (recovery mode)
root (hd1,1)
kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=e96c96f0-faf1-40be-ba44-e8ff47413070 ro single
initrd /boot/initrd.img-2.6.22-14-generic

title Ubuntu 7.10, memtest86+
root (hd1,1)
kernel /boot/memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title Other operating systems:
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title Microsoft Windows XP Professional
root (hd1,0)
savedefault
makeactive
map (hd0) (hd1)
map (hd1) (hd0)
chainloader +1

ferossan
November 1st, 2007, 08:15 PM
OK, I didn't wait for an answer and I proceed with:
sudo grub
grub> root (hd1,1)
grub> setup (hd0)
grub> quit

It did't work, same happens, at booting system goes directly to XP without show Grub options.
Now I have not idea what can I do. :confused:
Anyone could advice me??? please?
Thanks a lot

josephpmh
November 1st, 2007, 08:49 PM
>This will get you a "grub>" prompt (i.e. the grub shell). At grub>. enter these >commands
>
>Code:
>
>find /boot/grub/stage1
>
>This will return a location. If you have more than one, select the installation that >you want to provide the grub files.
>Next, THIS IS IMPORTANT, whatever was returned for the find command use it in >the next line (you are still at grub>. when you enter the next 3 commands)

when I run in grub "find /boot/grub/stage1" I get Error 15: File not found.

How do I get that?

Grub is not installing from the install (Live)CD; I can't start windows either. The only way I get the PC (Dell Dimension 2450) up and running si w/ the Live CD.

Any advice on how to install the grub to make the PC bootable?

ferossan
November 1st, 2007, 09:37 PM
Did you try this?
sudo find /boot/grub/stage1

meierfra
November 2nd, 2007, 01:02 AM
krige: Let's try to find /boot/grub/stage1 manually:

In the a terminal in the live cd type:



sudo mkdir /mnt/root

sudo mount -t ext3 /dev/sda3 /mnt/root

cd /mnt/root/boot

cd grub

ls

This will lists all files in /boot/grub on your ubuntu partitions.

Lets us know whether you found "stage1" in this way.

meierfra
November 2nd, 2007, 01:10 AM
ferossan:

A couple of things to try:

1) change the boot order in the bios,

If this does not give your the grub menu:

2) with the original boot order
sudo grub
grub> root (hd1,1)
grub> setup (hd1)
grub> quit

ferossan
November 2nd, 2007, 03:35 AM
SOLVED !!!
Thanks a lot meierfra. =D>
Changing the boot order in the bios did it.
Strange anyway forcing the Bios to boot the IDE drive first (which has none OS) and then the SATA one where are XP and Ubuntu.
Now let's start to play with my new OS \\:D/

meierfra
November 2nd, 2007, 04:20 AM
Strange anyway forcing the Bios to boot the IDE drive first (which has none OS) and then the SATA one where are XP and Ubuntu.

Well what happens is that ubuntu gets confused with boot order of IDE and SATA drives. Ubuntu somehow is convinced that the IDE drive is first in the boot order and sets up everything that way. Rather then changing all the wrong settings in ubuntu, it is just easier to change the boot order.

krige
November 2nd, 2007, 11:39 AM
This will lists all files in /boot/grub on your ubuntu partitions.


There is no "grub" directory in /boot/ ... I repeated the installation process and noticed that it actually stops at 94% just when it says "Installing boot loader": the installation disappears just like that, without any notification. I have made the CD check before everything so I am starting to think the problem might be due to a faulty CD drive and/or faulty hard drive.

josephpmh
November 2nd, 2007, 02:40 PM
I keep trying this but end up realizing that I have no stage1 file.

Like krige, there is not grub folder or file in the /boot.

Can someone help me with that? ta.

jw5801
November 3rd, 2007, 12:05 AM
Grub hasn't been installed at all. Can you make it into the system via the LiveCD or any other route? If you can run "sudo apt-get install grub" then try running the commands and see what happens.

Azakus
November 3rd, 2007, 01:36 AM
I had this problem as well. The fix I found was to copy all the stage1, partition stage1.5's, and stage2 from a working copy and paste it into /boot/grub. Then, run sudo grub-install /dev/sdX and sudo update-grub.

sssbbb
November 6th, 2007, 10:55 PM
Thank you sooooo much. An XP install messed up my MBR (ntldr is missing error) on a disk with both ubuntu and xubuntu previously installed... thank god for live cd's and good forums!

pure-drivel
November 7th, 2007, 04:08 PM
Hi there!

This is the first time I've installed Ubuntu at home, and I'm having some trouble.

I'm trying to dual-boot XP and Ubuntu 7.1. I installed XP first and then followed this guide (http://apcmag.com/6101/dualboot_windows_xp_and_ubuntu) to complete the install of Ubuntu.

Install went off without a hitch, but the problem is GRUB didn't take over my MBR. It just continues to boot into Windows without prompting me. When I press F8, it only shows Windows XP as a choice.

I've tried reinstalling GRUB to the MBR via the Ubuntu Live CD as described in this thread, but it still won't load GRUB. It's like Windows knows its about to be relegated to "gaming only," and it won't let that happen. What the heck is going on, and how can I fix it?

I realize from cruising this thread the problem may come from having both an IDE and a SATA drive installed. Do I have to change the boot order on my BIOS to boot the IDE first?

pablo.paez
November 9th, 2007, 03:35 PM
I have to reinstall XP so i lost grub (i was expecting this).
I have in /dev/sda5 my /boot and in my /dev/sda6 my /
So i did
grub> root (hd0,5)
grub> setup (hd0)
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 (hd0)"... 17 sectors are embedded. succeeded
Running "install /boot/grub/stage1 (hd0) (hd0)1+17 p (hd0,5)/boot/grub/stage2 /boot/grub/menu.lsd"... succeeded
Done

I though this was all right, actually i have grub back but now opens some kind of bash and i don't have any option from the menu.lst

I'm kind of lost here...

Any ideas?:confused:

mahiyar
November 9th, 2007, 05:33 PM
This might be a problem typical of my installation. I have one ide drive and one sata drive, I boot up from sata drive. I have Fiesty and Gutsy in seperate partitions in SATA drive, and windows and edgy in seperate partition in edgy drive. My MBR is dictated by the grub in SATA of fiesty. Now when I installed Gutsy I did not install the grub and used links in the fiesty's grub for gutsy. Now I want the grub to point to the gutsy partition. Can anyone one guide me as to how to about it.

meierfra
November 10th, 2007, 03:37 AM
Do I have to change the boot order on my BIOS to boot the IDE first?

That might indeed solve your problem. If it didn't, check out this post:


http://ubuntuforums.org/showthread.php?t=442945#9

If that didn't help either, post your menu.lst and the output of "sudo fdisk -l"

meierfra
November 10th, 2007, 03:49 AM
I have to reinstall XP so i lost grub (i was expecting this).
I have in /dev/sda5 my /boot and in my /dev/sda6 my /
So i did
grub> root (hd0,5)
grub> setup (hd0)
(hd0,5)/boot/grub/stage2 /boot/grub/menu.lsd"... succeeded
Done



Strange. /dev/sda5 is (hd0,4) . So you need to do "root (hd0,4) setup (hd0).

But since your setup was succesful, I would guess that /boot really is on /dev/sda6.

Could you post your fdisk, menu.lst and fstab?

(Boot from the live cd, mount your ubuntu partion to say /media/ubuntu (let me know if you need help with that) and post the output of

sudo fdisk -l

cat /media/ubuntu/boot/grub/menu.lst

and

cat /media/ubuntu/etc/fstab
)

meierfra
November 10th, 2007, 04:03 AM
Now I want the grub to point to the gutsy partition. Can anyone one guide me as to how to about it.

I assume that you read the howto at the begining of this thread. So I will be brief (feel free to ask if you need more details)

First of all you will need to reinstall grub via

sudo grub
root (hdx,y)
root (hd0)
quit

where (hdx,y) is the gutsy partition.

Next you will need to add the other operating systems to the gutsy menu.lst. There are several ways to do this, I will suggest two:

1) add the following to the end of the gutsy menu.lst:

title Feisty
configfile (hdz,u)\boot\grub\menu.lst

where (hdz,u) is your feisty partition. If you click on this item in the grub menu you will be directed to the feisty grub menu.

2) Copy and paste all relevant items from the feisty menu.lst to the gutsy menu.lst

mahiyar
November 10th, 2007, 10:49 AM
Thanks meierfra. After doing all of the above can I just copy verbatim the feisty's menu.lst file to gutsy?

meierfra
November 10th, 2007, 05:13 PM
Don't copy the whole file, just the various titles:

So things which looks like this:


title Ubuntu 7.10, kernel 2.6.22-14-generic
root (hd0,3)
kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=d019e9bb-9990-4203-89cf-aed5e7802c74 ro quiet splash
initrd /boot/initrd.img-2.6.22-14-generic
quiet


or

title Ubuntu 7.10, kernel 2.6.22-14-generic (recovery mode)
root (hd0,3)
kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=d019e9bb-9990-4203-89cf-aed5e7802c74 ro single
initrd /boot/initrd.img-2.6.22-14-generic


or

title Microsoft Windows XP Professional
root (hd0,1)
makeactive
chainloader +1

No need to copy :

title Ubuntu 7.10, memtest86+
root (hd0,3)
kernel /boot/memtest86+.bin
quiet

since you already have a memtest on the gutsy menu.lst


Put all these titles at the end of the gusty menu.lst.

mahiyar
November 10th, 2007, 05:29 PM
Thanks will keep you posted on my progress.

BLTicklemonster
November 11th, 2007, 05:58 AM
Does this work if I want to hook a different hard drive up and check it out? I'm in the process of installing a new hard drive and remove two, but in order to install, I had to leave one of them out of the loop. I have all I want from one of them, now I need to disconnect it, and hook up the one that is sitting idle. Of course I can't just do that because unlike windows, linux doesn't just outright find stuff (wish it did).

And wouldn't I have to redo fstab, also?

*edit: to make matters worse, it's a hard drive with five partitions.

XP ntfs
storage ntfs
gutsy tribe reiserfs
swap
swap
(for some reason there's two swaps)

So probably I can just get the grub and fstab info from it, edit what I have on this one, turn off the machine, hook up the drive, and go from there? Or not, because it will no longer be in the order it was before... hmmmm. It was hda, perhaps I can just edit its info with hdb because it's going to be my slave on ide1 at this point?

**Edit again:

Heh heh, I worry too much.

find stage1

root to it

setup

quit

bam. Muahahaha.

charles_316
November 12th, 2007, 07:10 AM
thanks... extremely useful tutorial

jase21
November 12th, 2007, 10:30 PM
Thanks buddy

dave37
November 16th, 2007, 03:14 PM
Thanks so much, this howto was a life saver!
:KS

theproc64
November 21st, 2007, 09:38 PM
Thanks so much! This worked perfectly when grub wasn't working!

Gotit
December 2nd, 2007, 10:21 PM
Aaaahhh...

I have pretty much read this whole thread (and a bunch of others) and still have a problem getting Grub to recognize my /boot/grub/menu.lst from my internal drive.

Here's my set-up:
hda = XP
hdb = Ubuntu 7.10 (bootable 40GB int.)
sda = Ubuntu 7.10 (bootable 120GB ext.)

I was running fine with just hda and hdb. When I would boot, Grub would allow me to select Ubuntu or Windows. Then, I installed sda and was attempting to get to a point where I could transfer everything from hdb to sda and then retire hdb.

I ended up installing Ubuntu 7.10 on sda and made it bootable, that's when the trouble began. Now I find I must have sda connected at boot, or when Grub runs I get, “Error 21”.

It seems to me my MBR is pointing to sda at boot time and reading sda's /boot/grub/menu.lst because that's the text I see on the screen. But what I really want is for it to point to hdb.

I have tried to “fix” my MBR with:

sudo grub
find /boot/grub/stage1
root (hd1,0)
setup (hd1)
quit

but no good, I still need to have sda connected or I get the dreaded “Error 21”.

Any suggestions?

meierfra
December 2nd, 2007, 10:56 PM
Do you get "error 21" after selecting ubuntu at the grub-menu at boot-up?

Probably you just need to edit "menu.lst". Post the output of


cat /boot/grub/menu.lst
and


sudo fdisk -l

meierfra
December 2nd, 2007, 10:59 PM
reading sda's /boot/grub/menu.lst because that's the text I see on the screen.

Are you saying that you can see the sda's "menu.lst" when the external drive is unplugged?

deantn
December 3rd, 2007, 12:31 AM
Thanks for tutorial.
Had problem with Winblows and had to reinstall, nothing new for MS but forgot to save grub files and this save my Ubuntu OS that is on another drive, thankgoodness.
Followed the first thread and got Ubuntu back first try. Read through mostof the threads before doing anything but the first thread worked just finefor my XP and Ubuntu 7/04 dual boot setup.
Thanks again for all the people on Ubuntu forums for all the help they give to everyone and anyone, all the time spent onFree software isn't a waste of time as far as I'm concerned.
I'm still learning linux and all the command lines that can be used but it is well worth the time for me as it is getting me away from Wins a little more every day.

Gotit
December 3rd, 2007, 12:38 AM
If my ext. drive (sda) is off/un-plugged when I boot, “Grub” shows on the screen and then followed in about 10 seconds by “Error 21...”.

If my ext drive (sda) is on when I boot, Grub runs and gives me the following selections (in essence):

Ubuntu 7.10 (on the ext. drive sda)
Windows XP
Ubuntu 7.10 (on the int. drive hdb)

All selections work fine. These are the selections I see in the /boot/grub/menu.lst file on my ext. drive (sda) via the file browser.

If I look at the /boot/grub/menu.lst file on my int. drive (hdb) with the file browser I see the following selections (in essence):

Ubuntu 7.10
Windows XP

I am trying to get back to the point where when I turn off/un-plug my ext. drive (sda) my system will boot with the grub/menu.lst from my int. drive (hdb).

I hope this makes sense.

meierfra
December 3rd, 2007, 12:43 AM
Gotit: Post the output of "sudo fdisk -l" and the full content of the file "menu.lst" I need that information in order to help you.

Gotit
December 3rd, 2007, 12:53 AM
OK
fdisk -l

steve@Home-Ubuntu:~$ sudo fdisk -l
[sudo] password for steve:

Disk /dev/hda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x4b36bdea

Device Boot Start End Blocks Id System
/dev/hda1 * 579 19456 151637535 7 HPFS/NTFS
/dev/hda2 1 578 4642753+ b W95 FAT32

Partition table entries are not in disk order

Disk /dev/hdb: 40.0 GB, 40000020480 bytes
255 heads, 63 sectors/track, 4863 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xe4651a0a

Device Boot Start End Blocks Id System
/dev/hdb1 * 1 4658 37415353+ 83 Linux
/dev/hdb2 4659 4863 1646662+ 5 Extended
/dev/hdb5 4659 4863 1646631 82 Linux swap / Solaris

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x44fdfe06

Device Boot Start End Blocks Id System
/dev/sda1 * 1 19127 153637596 83 Linux
/dev/sda2 19128 19457 2650725 5 Extended
/dev/sda5 19128 19457 2650693+ 82 Linux swap / Solaris

Disk /dev/sdb: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xdf5ba12f

Device Boot Start End Blocks Id System
/dev/sdb1 1 31871 256003776 7 HPFS/NTFS
/dev/sdb2 31872 60801 232380225 7 HPFS/NTFS
steve@Home-Ubuntu:~$


Menu.lst from hdb (int. drive)

# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not change this entry to 'saved' or your
# array will desync and will not let you boot your system.
default 0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 10

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu

# Pretty colours
#color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=690770bd-42df-499b-bdda-ac27896ba1e0 ro

## Setup crashdump menu entries
## e.g. crashdump=1
# crashdump=0

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd1,0)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true



Menu.lst from sda (ext. drive)

# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not use 'savedefault' or your
# array will desync and will not let you boot your system.
default 0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 10

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu

# Pretty colours
#color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=60dcfdf6-2689-4e25-bfae-f721a8794517 ro

## Setup crashdump menu entries
## e.g. crashdump=1
# crashdump=0

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd2,0)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash

## should update-grub lock old automagic boot options
## e.g. lockold=false
## lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

## ## End Default Options ##

title Ubuntu 7.10, kernel 2.6.22-14-generic
root (hd2,0)
kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=60dcfdf6-2689-4e25-bfae-f721a8794517 ro quiet splash
initrd /boot/initrd.img-2.6.22-14-generic
quiet

title Ubuntu 7.10, kernel 2.6.22-14-generic (recovery mode)
root (hd2,0)
kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=60dcfdf6-2689-4e25-bfae-f721a8794517 ro single
initrd /boot/initrd.img-2.6.22-14-generic

title Ubuntu 7.10, memtest86+
root (hd2,0)
kernel /boot/memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title Other operating systems:
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/hda1
title Microsoft Windows XP Home Edition
root (hd0,0)
savedefault
makeactive
chainloader +1


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/hda2
title Windows NT/2000/XP
root (hd0,1)
savedefault
makeactive
chainloader +1


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/hdb1.
title Ubuntu 7.10, kernel 2.6.22-14-generic (on /dev/hdb1)
root (hd1,0)
kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=690770bd-42df-499b-bdda-ac27896ba1e0 ro quiet splash
initrd /boot/initrd.img-2.6.22-14-generic
savedefault
boot


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/hdb1.
title Ubuntu 7.10, kernel 2.6.22-14-generic (recovery mode) (on /dev/hdb1)
root (hd1,0)
kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=690770bd-42df-499b-bdda-ac27896ba1e0 ro single
initrd /boot/initrd.img-2.6.22-14-generic
savedefault
boot


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/hdb1.
title Ubuntu 7.10, kernel 2.6.20-16-generic (on /dev/hdb1)
root (hd1,0)
kernel /boot/vmlinuz-2.6.20-16-generic root=UUID=690770bd-42df-499b-bdda-ac27896ba1e0 ro quiet splash
initrd /boot/initrd.img-2.6.20-16-generic
savedefault
boot


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/hdb1.
title Ubuntu 7.10, kernel 2.6.20-16-generic (recovery mode) (on /dev/hdb1)
root (hd1,0)
kernel /boot/vmlinuz-2.6.20-16-generic root=UUID=690770bd-42df-499b-bdda-ac27896ba1e0 ro single
initrd /boot/initrd.img-2.6.20-16-generic
savedefault
boot


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/hdb1.
title Ubuntu 7.10, memtest86+ (on /dev/hdb1)
root (hd1,0)
kernel /boot/memtest86+.bin
savedefault
boot

Gotit
December 3rd, 2007, 12:57 AM
I just noticed my menu.lst from hdb is incomplete, here's the whole file:

# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not change this entry to 'saved' or your
# array will desync and will not let you boot your system.
default 0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 10

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu

# Pretty colours
#color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=690770bd-42df-499b-bdda-ac27896ba1e0 ro

## Setup crashdump menu entries
## e.g. crashdump=1
# crashdump=0

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd1,0)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash

## should update-grub lock old automagic boot options
## e.g. lockold=false
## lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

## ## End Default Options ##

title Ubuntu 7.10, kernel 2.6.22-14-generic
root (hd1,0)
kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=690770bd-42df-499b-bdda-ac27896ba1e0 ro quiet splash
initrd /boot/initrd.img-2.6.22-14-generic
quiet

title Ubuntu 7.10, kernel 2.6.22-14-generic (recovery mode)
root (hd1,0)
kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=690770bd-42df-499b-bdda-ac27896ba1e0 ro single
initrd /boot/initrd.img-2.6.22-14-generic

title Ubuntu 7.10, kernel 2.6.20-16-generic
root (hd1,0)
kernel /boot/vmlinuz-2.6.20-16-generic root=UUID=690770bd-42df-499b-bdda-ac27896ba1e0 ro quiet splash
initrd /boot/initrd.img-2.6.20-16-generic
quiet

title Ubuntu 7.10, kernel 2.6.20-16-generic (recovery mode)
root (hd1,0)
kernel /boot/vmlinuz-2.6.20-16-generic root=UUID=690770bd-42df-499b-bdda-ac27896ba1e0 ro single
initrd /boot/initrd.img-2.6.20-16-generic

title Ubuntu 7.10, memtest86+
root (hd1,0)
kernel /boot/memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title Other operating systems:
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/hda1
title Microsoft Windows XP Home Edition
root (hd0,0)
savedefault
makeactive
chainloader +1


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/hda2
title Windows NT/2000/XP
root (hd0,1)
savedefault
makeactive
chainloader +1

meierfra
December 3rd, 2007, 01:34 AM
Gotit: This should fix it:


sudo grub
root (hd1,0)
setup (hd0)
quit



also add this to menu.lst on hdb1:

title Ubuntu on sda
configfile (hd2,0)/boot/grub/menu.lst


and in menu.lst on sda1 change

"#hiddenmenu" to "hiddenmenu"

and

"timeout 10" to "timeout 1"

(I always use the "configfile" method. Then you won't have to edit menu.lst after kernel updates)

Gotit
December 3rd, 2007, 02:53 AM
Great, that did it!!

I'm not quite sure why it worked though.
I thought setup for Grub had to be on hd1 in my case.
I have no clue about the rest. Not even sure if I modified it correctly!

Really appreciate the help. Been going at this for 2 days now. At least tonight I'll be able to sleep :)

alanholpin
December 3rd, 2007, 07:36 PM
Thanks! This worked for me.

ArchCorsair
December 10th, 2007, 11:32 AM
My issue is this; I decided to remove ubuntu (x32) to install ubuntu 7.10 (x64) I had Windows Vista installed on HDD1

my laptop has 2 HDDs, i installed ubuntu on a 15GB partition on the 2nd HDD, and added 2GB swap.

When i was ready to install x64, i booted into the live CD, went into parted, DELETED the 15gb ubuntu partition and the 2GB swap partition, then resized the original NTFS partition that i used in windows for backup to max size. i reboot and i get this:

GRUB Loading stage 1.5

GRUB loading, please wait...
Error 22

I can't use your method because there are no setup files to 'recover' to rebuild GRUB. I cannot boot into vista anymore. (currently in liveCD)

please help!

My PC:
HP dv9543cl (laptop)
2.0 Ghz Core2Duo
2GB RAM
Nvidia Geforce 8600 GS
2x 160GB HDDs

Markalus
December 13th, 2007, 05:55 PM
I've been wanting to try Ubuntu 7.10 ( never messed with a form of Linux before ) and now I get to. Last night I was backing up data from my Windows XP Home laptop to an external hard drive. During the middle of that ( this is the second time this has happened ) I get the blue screen of death and when the pc is restarted I get the infamous hal.dll missing error. So, I had a 10GB C: and a 50GB D: ( this one has windows ) on the same hard drive. ( i.e. they're partitions ) I installed Ubuntu to C: with 5300 MB going to / and 5000 MB going to /swap ( pretty sure ). Install went fine, restarted and tried to get windows to fix itself. No such luck. In the course of messing with windows I ended up trashing the Unbuntu partitions ( I think ). When restarting I would get an error about an invalid partition. I was going to reinstall but now when I get into the installer where you choose the partitions ( gparted ) I have the choices of the entire drive or manual. I choose manual and then I get a program crash. ubiquity is the name. So, now I'm looking into recovering the data on the windows partition. I can do whatever I need to once that data is recovered ( as it wasn't fully backed up yet ) including starting from scratch with Ubuntu and Windows. So, using the live cd I have been trying to get the windows partition to mount so I can access the files. I can't get on the internet via Ubuntu so this is being written at work. ( Ubuntu doesn't recognize my wireless card or something ) I'll need a way to copy the files out of the windows partition so that's a concern but I'll get it to after this first hurdle. Here's a screen capture of what I tried. Any help would be appreciated! Thanks.
-M-

mrcbldn
December 14th, 2007, 07:52 PM
I installed XP over my native Vista, obviously the grup installation was covered from Windows bootloader.

Following this guide I was able to reinstall grup into linux partition (hd0,2); when I rebooted my computer I saw rightly grub menu, if I choosed Windows boot everything was ok but if I choosed Linux Partition appeared:

"Error 17: Cannot mount selected partition"

I choosed 'e' on linux entry into grup menu; the first voice appeared as root (hd0,3) but I saw that the ext2fs partition was into 2!!!
So I changed it into root(hd0,2) with 'e' option.

After the changed it i pressed 'b' (boot); then my linux starded!!!
=D>

The changes was not persistant, so after boot, I needed to permanent change the grup configuration.
I went into /boot/grub/menu.lst and I changed the entries for linux into root (hd0,2) (they where to (hd0,3) )

Now everything works well but I still does not understand how my new xp install dropped an existent partition!!
Unlikely I have not the output of previous fdisk command :-(

blooboy
December 26th, 2007, 12:55 PM
I am using quite old system, so I decided to install xubuntu on my second slave HDD. My primary HDD has M$ XP. While going through installation process, when I reached grub installation phase, it asked me to install Grub on HD0. I was afraid it might overwrite my windows bootloader on Primary HDD, so I wrote down HD1 for grub installation instead of default HD0. (Here I fu***d up) :(

Now my xubuntu gave out error message that it couldn't install GRUB. I followed the instructions in Page 1 for this thread but was not successful, coz there is just nothing in "/boot/grub" directory !

Guys, tell me the easy way out. Is there any way I can install grub in the root of my secondary HDD so that it does not overwrite XP bootloader of my primary HDD.

As far as my understanding goes, HD0 stands for root of primary hard disk !! So installing grub on HD0 is out of question :(

chewearn
December 26th, 2007, 01:10 PM
I am using quite old system, so I decided to install xubuntu on my second slave HDD. My primary HDD has M$ XP. While going through installation process, when I reached grub installation phase, it asked me to install Grub on HD0. I was afraid it might overwrite my windows bootloader on Primary HDD, so I wrote down HD1 for grub installation instead of default HD0. (Here I fu***d up) :(

Now my xubuntu gave out error message that it couldn't install GRUB. I followed the instructions in Page 1 for this thread but was not successful, coz there is just nothing in "/boot/grub" directory !

Guys, tell me the easy way out. Is there any way I can install grub in the root of my secondary HDD so that it does not overwrite XP bootloader of my primary HDD.

As far as my understanding goes, HD0 stands for root of primary hard disk !! So installing grub on HD0 is out of question :(

To be absolutely safe, you can physically disconnect your XP (hd0), and put the slave HD into primary, then do the Xubuntu installation. Once completed, you can put back Xubuntu as slave and the XP HD as primary.

Now, bear in mind, to boot into Xubuntu in this setup, you need to switch your boot device in BIOS to the slave HD every time.

blooboy
December 26th, 2007, 01:41 PM
To be absolutely safe, you can physically disconnect your XP (hd0), and put the slave HD into primary, then do the Xubuntu installation. Once completed, you can put back Xubuntu as slave and the XP HD as primary.

Now, bear in mind, to boot into Xubuntu in this setup, you need to switch your boot device in BIOS to the slave HD every time.

This is what I had in my mind since long. I was actually contemplating doing it. But just for the sake of knowledge, is there any way I can install grub in the root of secondary hdd? I know it is possible in PClinuxos as a menu item in installation options.

chewearn
December 26th, 2007, 05:03 PM
This is what I had in my mind since long. I was actually contemplating doing it. But just for the sake of knowledge, is there any way I can install grub in the root of secondary hdd? I know it is possible in PClinuxos as a menu item in installation options.

I don't think there is a menu method is ubuntu installation for that, though I could be wrong; I always install using the most straight forward method, so I have not tried what you wanted to do. But I think there is and advance button you can click somewhere during the installation (around the partitioning section), where you can select the place for grub. At least, I think I did saw it the last time.

blooboy
December 28th, 2007, 01:29 PM
I don't think there is a menu method is ubuntu installation for that, though I could be wrong; I always install using the most straight forward method, so I have not tried what you wanted to do. But I think there is and advance button you can click somewhere during the installation (around the partitioning section), where you can select the place for grub. At least, I think I did saw it the last time.

Yaa, I too saw that. 'Advanced' tab is asking whether to install grub to hd0. My question is, what should be my command to get it installed in the root of secondary HDD... (HD1,1)??

chewearn
December 28th, 2007, 04:23 PM
Yaa, I too saw that. 'Advanced' tab is asking whether to install grub to hd0. My question is, what should be my command to get it installed in the root of secondary HDD... (HD1,1)??


It should be (hd1) for secondary hd.

mgaskell
December 28th, 2007, 09:41 PM
After reinstalling Windows and loosing Grub, I tried everything above with no success. Grub appeared on boot but I kept getting an "error 17: cannot mount" when I tried to get into Ubuntu. My Ubuntu load is in my second partition (sda2) and my Windows load is in sda1. All of the steps above do nothing to change the /boot/grub/menu.lst file.

I did a sudo gedit /boot/grub/menu.lst and found that every boot line for Ubuntu was referencing hd0,0 and the boot line for Windows was referencing hd0,1. That is opposite of my configuration. I edited the boot entries for Ubuntu to hd0,1 and the Windows line to hd0,0 and everything works fine now.

I hope this saves somebody else the day it took me to figure this out.

Cheers

antisocialist
January 2nd, 2008, 10:01 PM
SWEEEEET, now i dont have to reinstall ubuntu :p
also, +1 thanks to you

darchmitt
January 4th, 2008, 05:17 AM
thanks catlet!!
works great now!!!! from the external usb hdd!!!!

perixx
January 4th, 2008, 04:53 PM
Hi!
I don't know if somebody else had the problem when trying to manually install/recover grub via live-CD:

sudo grub
find /boot/grub/stage1 >> not found
root (hdx,y) >> manually specifying the root for Grub
setup (hdx,y) >> manually installing Grub into specified drive/partition

>> result: 'running "embed /boot/grub/e2fs_stage1_5 (hdx,y)"... failed (this is not fatal)'
>> booting non-functional

For me, it only worked when running the following command in a terminal from a live-CD:

sudo grub-install --root-directory=/media/[MWG] /dev/[MWG]
where '[MWG==mounted wannabe Grub partition]' is, e.g., /hda5 for the first extended partition on my PATA-drive. I needed this after deleting an extended partition in front of my current Xubuntu installation (and resizing partition) that was the chainloader-target of the nt-bootloader. There was still need for replacing the old 'bootsect.lnx' in the C:\ drive of XP, though, as described here:
http://ubuntuforums.org/showpost.php?p=1229036&postcount=9

All that was left to do, was editing Grub's bootmenu /boot/grub/menu.lst accordingly.

perixx

gr33nis
January 22nd, 2008, 02:38 AM
Since the I cannot get the Ubuntu installation process to proceed beyond 94% when it fails due to errors (unexplained) installing grub, I've used the advanced option to install without it in the hope that following the original post here I could install manually. When I follow these instruction and get to the part where I try to 'sudo grub', it tells me it can't find it but tells me how to install (apt etc.etc.). This seems to be successful (I can find the stage 1 file in the /usr/lib/grub/i386_PC directory), however, grub cannont be found in the /boot directory. What am I doing wrong?

I'm ultimately trying to fix things so that I can dual boot with XP pro via the WinGRUB utility. Ubuntu root is installed on the second partition of the second (slave) hard disk (if this is important).

Many thanks for your help.

jw5801
January 22nd, 2008, 10:24 AM
Since the I cannot get the Ubuntu installation process to proceed beyond 94% when it fails due to errors (unexplained) installing grub, I've used the advanced option to install without it in the hope that following the original post here I could install manually. When I follow these instruction and get to the part where I try to 'sudo grub', it tells me it can't find it but tells me how to install (apt etc.etc.). This seems to be successful (I can find the stage 1 file in the /usr/lib/grub/i386_PC directory), however, grub cannont be found in the /boot directory. What am I doing wrong?

I'm ultimately trying to fix things so that I can dual boot with XP pro via the WinGRUB utility. Ubuntu root is installed on the second partition of the second (slave) hard disk (if this is important).

Many thanks for your help.

I'd be more inclined to try getting the actual install to work first. Did you try checking the integrity of the CD after you burned it? Your download may have corrupted, which would explain why it always fails at the same point of the install.

coc_21
January 23rd, 2008, 02:14 PM
I tried this using a Ubuntu 7.10 live cd and it didn't work, However when I used a Mandriva 2008 live cd it worked

[QUOTE=catlett;1308395]This will restore grub if you already had grub installed but lost it to a windows install or some other occurence that erased/changed your MBR so that grub no longer appears at start up or it returns an error.

(This how to is written for Ubuntu but should work on other systems. The only thing to take note of, when you see "sudo" that will mean to you that the following command should be entered at a root terminal.)

Boot into the live Ubuntu cd. This can be the live installer cd or the older live session Ubuntu cds.

When you get to the desktop open a terminal and enter. (I am going to give you the commands and then I will explain them later)


sudo grub

This will get you a "grub>" prompt (i.e. the grub shell). At grub>. enter these commands


find /boot/grub/stage1

This will return a location. If you have more than one, select the installation that you want to provide the grub files.
Next, THIS IS IMPORTANT, whatever was returned for the find command use it in the next line (you are still at grub>. when you enter the next 3 commands)


root (hd?,?)
Again use the value from the find command i.e. if find returned (hd0,1) then you would enter root (hd0,1)

Next enter the command to install grub to the mbr


setup (hd0)

Finally exit the grub shell

quit

That is it. Grub will be installed to the mbr.
When you reboot, you will have the grub menu at startup.

Now the explanation.
Sudo grub gets you the grub shell.
Find /boot/grub/stage1 has grub locate the file stage1. What this does is tell us where grub's files are. Only a small part of grub is located on the mbr, the rest of grub is in your boot folder. Grub needs those files to run the setup. So you find the files and then you tell grub where to locate the files it will need for setup.
So root (hd?,?) tells grub it's files are on that partition.
Finally setup (hd0) tells grub to setup on hd0. When you give grub the parameter hd0 with no following value for a partition, grub will use the mbr. hd0 is the grub label for the first drive's mbr.
Quit will exit you from the grub shell.

bharadwaj
January 28th, 2008, 05:42 PM
i have bookmarked it thanx for nice post

junki
February 15th, 2008, 07:24 PM
Thank for your posts and really good informations.

Baconfatty
February 29th, 2008, 11:08 AM
i don't know if anyone noticed but when it goes into the dell media center partition you can just hit the home button and it returns you to normal boot mode, its way easier then reinstalling grub.

tollboy
March 2nd, 2008, 12:22 AM
i have a diffrent case of all above
i installed ubuntu 7.10 without installing its grub on a partition of ma laptop with vista.
at that time vista directly boot. n then i installed kubuntu on other partition which makes me to boot into all the 3 OS,s.
but after this when i installed fedora 8 replacing kubuntu. then i got a problem that i am unable to boot into the ubuntu....
i just want to taste other distro of linux bt donnt want to leave that ubuntu. so please help me to boot to ubuntu.
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You do not have a /boot partition. This means that
# all kernel and initrd paths are relative to /, eg.
# root (hd0,6)
# kernel /boot/vmlinuz-version ro root=/dev/sda7
# initrd /boot/initrd-version.img
#boot=/dev/sda
default=1
timeout=5
splashimage=(hd0,6)/boot/grub/splash.xpm.gz
hiddenmenu
title Fedora (2.6.23.1-42.fc8)
root (hd0,6)
kernel /boot/vmlinuz-2.6.23.1-42.fc8 ro root=LABEL=/ rhgb quiet
initrd /boot/initrd-2.6.23.1-42.fc8.img
title Ubuntu 7.10
rootnoverify (hd0,3)
chainloader +1
title Windows Vista
rootnoverify (hd0,0)
chainloader +1
this is the output of my menu.lst
please help
thankx alot

jw5801
March 2nd, 2008, 03:01 AM
Don't use rootnoverify and chainloader. The Ubuntu section should look similar to the Fedora section.

title Ubuntu 7.10
root (hd0,3)
kernel /boot/vmlinuz-2.6.22-14-generic ro root=LABEL=/
initrd /boot/initrd.img-2.6.22-14-generic

tollboy
March 2nd, 2008, 09:19 AM
its start booting it text mode bt booting is nt completed
i tried it many times
the last few lines r

mount: mounting /sys on /root/sys failed: no such file or diorectory
mount: mounting /proc on /root/sys failed: no such file or directory
target filesystem doesn't have /sbin/init


BusyBox v1.1.3 (debian 1:1.1.3-5ubuntu7) Built-in shell (ash)

dont know wat is this cn n body help
bt when i bowsed to sbin directory of ma ubuntu filesystem from fedora
the file is there

jw5801
March 2nd, 2008, 01:26 PM
Did you try it with the menu.lst entry I suggested? It appears like it's trying to mount everything on /root rather than on /. Can you post the /etc/fstab from your Ubuntu partition?

gallup
March 3rd, 2008, 06:16 AM
Catlett, Great advice. Thanks so much as it worked first try for this rookie. Had a problem with xp on dual boot...lost grub. So glad it is back with my gutsy. And to find my answer on the front page of this thread in simple to follow instructions, Just Great.
thanks again

ZERO_SHIFT
March 4th, 2008, 07:00 AM
Thanks MAn

StorM_GmA
March 5th, 2008, 03:13 PM
Hello! I tried this guide to install GRUB in my ubuntu 7.10 and as coc_21 said, it didn't work. here's the data from the terminal



grub> find /boot/grub/stage1
(hd1,3)

grub> root (hd1,3)

grub> setup (hd0)
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 (hd0)"... 17 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 d (hd0) (hd0)1+17 p (hd1,3)/boot/grub/stage
2 /boot/grub/menu.lst"... succeeded
Done.


but when I restart, it goes straight to WinXP without any OS selection screen... does anyone know how to fix it?

mmadhukarbhat
March 5th, 2008, 04:43 PM
catlett, Thank you!
Your How To made my day.

jw5801
March 5th, 2008, 09:48 PM
Hello! I tried this guide to install GRUB in my ubuntu 7.10 and as coc_21 said, it didn't work. here's the data from the terminal



grub> find /boot/grub/stage1
(hd1,3)

grub> root (hd1,3)

grub> setup (hd0)
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 (hd0)"... 17 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 d (hd0) (hd0)1+17 p (hd1,3)/boot/grub/stage
2 /boot/grub/menu.lst"... succeeded
Done.


but when I restart, it goes straight to WinXP without any OS selection screen... does anyone know how to fix it?

You might notice a screen during bootup that says something about grub loading and asks you to press "Esc" for alternate choices. Pressing Esc then will show you grub. You can also change the following part of /boot/grub/menu.lst:

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
hiddenmenu
All you need to do is comment out the hiddenmenu line:

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu

Then run "update-grub" once again, and it should show you the screen by default.

StorM_GmA
March 7th, 2008, 02:45 AM
thanks for the reply jw5801 but can you help me on how to edit the /boot/grub/menu.lst ? I'm new in linux :confused:

I tried to check if there is any screen at boot about "ESC" for the GRUB but I didn't see anything...maybe it passes very fast or something... that's why I want to edit the file you told me!

StorM_GmA
March 7th, 2008, 02:52 AM
I found the way to edit that file with the command sudo gedit /boot/grub/menu.lst

don't know if it's the correct one but it opened something like an editor but it's blank! There's nothing in it! I have to mention that I'm running ubuntu from live CD...I have installed it but can't run the installed app!

Gawler
March 7th, 2008, 03:55 AM
Hi, I'm having problems with the Grub installation.
I loaded Ubanto and had Grub installed to the MBR (I would have preferred it in the Linux partition but was not given a choice). After installation the machine booted OK and I was able to access Win98. On the next boot and everytime afterwards I got a error 17. Particularly frustrating as I couldn't access the net from the live Ubanto disk. Not being able to resolve the error 17 problem I reinstalled Windows and Boot Magic.
As predicted the Linux option on Boot Magic failed to load Ubantu so I have just followed instuctions and loaded Grub to (hd0,5). I presume this is the correct partition as Ubantu is on hda6. Installation went OK as per messages.
Unfortunately Ubanto still doesn't boot from Boot Magic. So have I put Grub in the wrong place or is the error 17 still the problem? I notice that Boot Magic lists Linux as Primary Partition 4, Partition Magic has it as the 6th listed (logical) partition, and the partition table in Ubantu has hda4 as an empty ext2 Linux partition and Linux as ext3 hda6.
Any ideas? This is my first attempt at Linux so please don't assume I have prior knowledge.
Thanks

jw5801
March 7th, 2008, 04:07 AM
I found the way to edit that file with the command sudo gedit /boot/grub/menu.lst

don't know if it's the correct one but it opened something like an editor but it's blank! There's nothing in it! I have to mention that I'm running ubuntu from live CD...I have installed it but can't run the installed app!

If you're running from the LiveCD then the file "/boot/grub/menu.lst" will be the LiveCD's file. Which doesn't exist, hence you getting an empty file. The file you want is the one on your Ubuntu partition. So you'll need to work out where your Ubuntu partition is mounted to, and then run the command you did, but with the mountpoint of the partition as well, so something like:

gksudo gedit /media/disk/boot/grub/menu.lst

But you'll have to work out what the first two directories are supposed to be!

BOMBkangaroo
March 13th, 2008, 12:45 AM
Okay, so I tried this, but when I get to grub all I get is the GRUB_> prompt.

Checking Fdisk it sees my partitions correctly.
I have Ubuntu installed on HD0, which is seen as either SDA or SDB, but always HD0. (HD1 has my XP installation on it, and I use the F11 boot menu on startup to select the boot device)

My Ubuntu installation looks like this:
SDA1 (0,0) 10GB - / (ext3)
SDA2 (0,1) 88GB - /home (ext3)
SDA3 (0,2) 2GB - swap
~400GB unused.

/boot/grub/stage1 is found on (hd0,0), and I'm doing "setup grub (hd0)".

I'll admit I'm a newbie, but for the life of me I can't work out what's going wrong.

The problem stems from telling Ubuntu to install GRUB to HD1 during the initial installation, having assumed that it would see the drives in the same order my BIOS does. (silly me)

Please give me a reason to slap my forehead. (okay, another reason to do it)

EDIT: Nevemind, I reinstalled Ubuntu and it's working fine now.

contents
March 13th, 2008, 11:44 PM
Thanks, catlett! That was a huge help.

madjr
March 22nd, 2008, 12:36 AM
we got wingrub now

http://sourceforge.net/projects/grub4dos

no need to mess with the live-cd

amrith
March 22nd, 2008, 03:17 PM
I repartitioned one of the FAT32 to ext3 using Gparted and got GRUB Error 15 and later 22 .Hence I deleted this partition and tried but no help.
So I re-wrote the MBR( I guess) using TestDisk .Now I am able to boot my Windows XP and I beleive I lost my ubuntu.
I tried doing the ones which were starting of this thread but got these errors:
-----
grub> find /boot/grub/stage1

Error 15: File not found

grub>
-----
Please tell me how to progress and re install the GRUB ?
You may refer to this thread from where I have re-directed
http://ubuntuforums.org/showthread.php?t=46330&page=3

Please .I dont want to re-install ubuntu !

rectec794613
April 4th, 2008, 12:19 AM
Thank You Soooooooooo Much! A million thanks. you deserve a reward! (that I dont have)

Patb
April 10th, 2008, 01:22 PM
Catlett, thank you. Your clear instructions got me out of a sticky situation.

Cheers, Pat.

nomikal
April 11th, 2008, 06:09 AM
another thing to consider is multiple drives. Make sure your boot drive is the drive with Grub on the MBR as it can be on multiple drives...

Drone4four
April 24th, 2008, 01:49 AM
I just installed Windows XP which overrides the Grub loader and MBR. I want Grub back. So I am using the initial post in this thread as a guide. I get stuck, however:
grub> find /boot/grub/stage1
(hd0,5)

grub> root (hd0,5)

grub> setup (hd0,5)
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 (hd0,5)"... failed (this is not fatal)
Running "embed /boot/grub/e2fs_stage1_5 (hd0,5)"... failed (this is not fatal)
Running "install /boot/grub/stage1 (hd0,5) /boot/grub/stage2 p /boot/grub/menu
.lst "... failed

Error 12: Invalid device requested

grub> What does this mean? Does this mean my sda ubuntu partition isn't loaded? I tried mounting it as the intial poster recommended but I failed. Here are the commands I tried:

ubuntu@ubuntu:~$ sudo grub
Probing devices to guess BIOS drives. This may take a long time.
ubuntu@ubuntu:~$ sudo mkdir /ubuntu
ubuntu@ubuntu:~$ sudo mount -t reiserfs /dev/sda
sda sda1 sda2 sda3 sda4 sda5 sda6 sda7
ubuntu@ubuntu:~$ sudo mount -t reiserfs /dev/sda2 /ubuntu
mount: wrong fs type, bad option, bad superblock on /dev/sda2,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

ubuntu@ubuntu:~$ dmesg | tail
[ 121.332000] Bluetooth: L2CAP ver 2.8
[ 121.332000] Bluetooth: L2CAP socket layer initialized
[ 121.368000] Bluetooth: RFCOMM socket layer initialized
[ 121.368000] Bluetooth: RFCOMM TTY layer initialized
[ 121.368000] Bluetooth: RFCOMM ver 1.8
[ 123.864000] NET: Registered protocol family 17
[ 132.592000] NET: Registered protocol family 10
[ 132.592000] lo: Disabled Privacy Extensions
[ 142.596000] eth0: no IPv6 routers present
[ 1618.584000] ReiserFS: sda2: warning: sh-2021: reiserfs_fill_super: can not find reiserfs on sda2
ubuntu@ubuntu:~$ sudo mount -t reiserfs /dev/sda3 /ubuntu
mount: wrong fs type, bad option, bad superblock on /dev/sda3,
missing codepage or helper program, or other error
(aren't you trying to mount an extended partition,
instead of some logical partition inside?)
In some cases useful info is found in syslog - try
dmesg | tail or so

ubuntu@ubuntu:~$ sudo mount -t reiserfs /dev/sda5 /ubuntu
mount: wrong fs type, bad option, bad superblock on /dev/sda5,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

ubuntu@ubuntu:~$ dmesg | tail
[ 142.596000] eth0: no IPv6 routers present
[ 1618.584000] ReiserFS: sda2: warning: sh-2021: reiserfs_fill_super: can not find reiserfs on sda2
[ 1669.936000] attempt to access beyond end of device
[ 1669.936000] sda3: rw=0, want=18, limit=2
[ 1669.936000] ReiserFS: sda3: warning: sh-2006: read_super_block: bread failed (dev sda3, block 8, size 1024)
[ 1669.936000] attempt to access beyond end of device
[ 1669.936000] sda3: rw=0, want=130, limit=2
[ 1669.936000] ReiserFS: sda3: warning: sh-2006: read_super_block: bread failed (dev sda3, block 64, size 1024)
[ 1669.936000] ReiserFS: sda3: warning: sh-2021: reiserfs_fill_super: can not find reiserfs on sda3
[ 1680.216000] ReiserFS: sda5: warning: sh-2021: reiserfs_fill_super: can not find reiserfs on sda5
ubuntu@ubuntu:~$ gedit /etc/fstab
ubuntu@ubuntu:~$



Oh yeah, these are the contents of my fstab:
unionfs / unionfs rw 0 0
tmpfs /tmp tmpfs nosuid,nodev 0 0
/dev/sda6 swap swap defaults 0 0

confused57
April 24th, 2008, 04:37 AM
If you want to install grub to the mbr, then "setup (hd0)"..."setup (hd0,5)" installs grub to the root partition.

(hd0,5) is the way grub recognizes /dev/sda6...if your root partition is indeed reiserfs, then:

sudo mount -t reiserfs /dev/sda6 /ubuntu
or if its ext3:

sudo mount -t ext3 /dev/sda6 /ubuntu

The fstab you've posted is from the live cd, not from your installed Ubuntu. If you're able to mount your root partition, this will show your fstab:

gedit /ubuntu/etc/fstab

jw5801
April 24th, 2008, 05:16 AM
I just installed Windows XP which overrides the Grub loader and MBR. I want Grub back. So I am using the initial post in this thread as a guide. I get stuck, however:
grub> find /boot/grub/stage1
(hd0,5)

grub> root (hd0,5)

grub> setup (hd0,5)
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 (hd0,5)"... failed (this is not fatal)
Running "embed /boot/grub/e2fs_stage1_5 (hd0,5)"... failed (this is not fatal)
Running "install /boot/grub/stage1 (hd0,5) /boot/grub/stage2 p /boot/grub/menu
.lst "... failed

Error 12: Invalid device requested

grub> What does this mean? Does this mean my sda ubuntu partition isn't loaded? I tried mounting it as the intial poster recommended but I failed. Here are the commands I tried:

ubuntu@ubuntu:~$ sudo grub
Probing devices to guess BIOS drives. This may take a long time.
ubuntu@ubuntu:~$ sudo mkdir /ubuntu
ubuntu@ubuntu:~$ sudo mount -t reiserfs /dev/sda
sda sda1 sda2 sda3 sda4 sda5 sda6 sda7
ubuntu@ubuntu:~$ sudo mount -t reiserfs /dev/sda2 /ubuntu
mount: wrong fs type, bad option, bad superblock on /dev/sda2,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

ubuntu@ubuntu:~$ dmesg | tail
[ 121.332000] Bluetooth: L2CAP ver 2.8
[ 121.332000] Bluetooth: L2CAP socket layer initialized
[ 121.368000] Bluetooth: RFCOMM socket layer initialized
[ 121.368000] Bluetooth: RFCOMM TTY layer initialized
[ 121.368000] Bluetooth: RFCOMM ver 1.8
[ 123.864000] NET: Registered protocol family 17
[ 132.592000] NET: Registered protocol family 10
[ 132.592000] lo: Disabled Privacy Extensions
[ 142.596000] eth0: no IPv6 routers present
[ 1618.584000] ReiserFS: sda2: warning: sh-2021: reiserfs_fill_super: can not find reiserfs on sda2
ubuntu@ubuntu:~$ sudo mount -t reiserfs /dev/sda3 /ubuntu
mount: wrong fs type, bad option, bad superblock on /dev/sda3,
missing codepage or helper program, or other error
(aren't you trying to mount an extended partition,
instead of some logical partition inside?)
In some cases useful info is found in syslog - try
dmesg | tail or so

ubuntu@ubuntu:~$ sudo mount -t reiserfs /dev/sda5 /ubuntu
mount: wrong fs type, bad option, bad superblock on /dev/sda5,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

ubuntu@ubuntu:~$ dmesg | tail
[ 142.596000] eth0: no IPv6 routers present
[ 1618.584000] ReiserFS: sda2: warning: sh-2021: reiserfs_fill_super: can not find reiserfs on sda2
[ 1669.936000] attempt to access beyond end of device
[ 1669.936000] sda3: rw=0, want=18, limit=2
[ 1669.936000] ReiserFS: sda3: warning: sh-2006: read_super_block: bread failed (dev sda3, block 8, size 1024)
[ 1669.936000] attempt to access beyond end of device
[ 1669.936000] sda3: rw=0, want=130, limit=2
[ 1669.936000] ReiserFS: sda3: warning: sh-2006: read_super_block: bread failed (dev sda3, block 64, size 1024)
[ 1669.936000] ReiserFS: sda3: warning: sh-2021: reiserfs_fill_super: can not find reiserfs on sda3
[ 1680.216000] ReiserFS: sda5: warning: sh-2021: reiserfs_fill_super: can not find reiserfs on sda5
ubuntu@ubuntu:~$ gedit /etc/fstab
ubuntu@ubuntu:~$



Oh yeah, these are the contents of my fstab:
unionfs / unionfs rw 0 0
tmpfs /tmp tmpfs nosuid,nodev 0 0
/dev/sda6 swap swap defaults 0 0


You don't want to setup (hd0,5) unless you want to install grub only to that partition, which doesn't really make much sense. It should just be
sudo grub
root (hd0,5)
setup (hd0)
exit

Drone4four
April 24th, 2008, 05:26 AM
You don't want to setup (hd0,5) unless you want to install grub only to that partition, which doesn't really make much sense. It should just be
sudo grub
root (hd0,5)
setup (hd0)
exit

setup (hd0) doesn't work either:

grub> root (hd0,5)

grub> setup (hd0)
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 (hd0)"... 17 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd0) (hd0)1+17 p (hd0,5)/boot/grub/stage2
/boot/grub/menu.lst"... failed

Error 12: Invalid device requested

grub>

Drone4four
April 24th, 2008, 05:30 AM
If you want to install grub to the mbr, then "setup (hd0)"..."setup (hd0,5)" installs grub to the root partition.

(hd0,5) is the way grub recognizes /dev/sda6...if your root partition is indeed reiserfs, then:

sudo mount -t reiserfs /dev/sda6 /ubuntu
or if its ext3:

sudo mount -t ext3 /dev/sda6 /ubuntu

The fstab you've posted is from the live cd, not from your installed Ubuntu. If you're able to mount your root partition, this will show your fstab:

gedit /ubuntu/etc/fstab
I changed the dir from /ubuntu to /u666 (don't ask):


ubuntu@ubuntu:/$ sudo mount -t reiserfs /dev/sda6 /u666
mount: /dev/sda6 already mounted or /u666 busy
ubuntu@ubuntu:/$ sudo mount /dev/sda6 /ubuntu6
/dev/sda6 looks like swapspace - not mounted
mount: you must specify the filesystem type

Drone4four
April 24th, 2008, 05:35 AM
btw, just in case, here is some more essential information:


ubuntu@ubuntu:/$ cd / && ls
bin boot cdrom dev etc home initrd initrd.img lib media mnt opt proc rofs root sbin srv sys tmp u666 ubuntu ubuntu2 ubuntu3 ubuntu6 usr var vmlinuz

The contents of mtab:

proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
varrun /var/run tmpfs rw,noexec,nosuid,nodev,mode=0755 0 0
udev /dev tmpfs rw,mode=0755 0 0
devpts /dev/pts devpts rw,gid=5,mode=620 0 0
tmpfs /tmp tmpfs rw,nosuid,nodev 0 0

And finally:

ubuntu@ubuntu:/$ lsof | grep /ubuntu
lsof: WARNING: can't stat() tmpfs file system /cow
Output information may be incomplete.
bash 7322 ubuntu cwd DIR 0,19 820 267 /home/ubuntu
bash 7323 ubuntu cwd DIR 0,19 820 267 /home/ubuntu
bash 7324 ubuntu cwd DIR 0,19 820 267 /home/ubuntu
bash 7325 ubuntu cwd DIR 0,19 820 267 /home/ubuntu
bash 7326 ubuntu cwd DIR 0,19 820 267 /home/ubuntu
bash 7327 ubuntu cwd DIR 0,19 820 267 /home/ubuntu
x-session 9196 ubuntu cwd DIR 0,19 820 267 /home/ubuntu
gnome-key 9238 ubuntu cwd DIR 0,19 820 267 /home/ubuntu
metacity 9248 ubuntu cwd DIR 0,19 820 267 /home/ubuntu
metacity 9248 ubuntu mem REG 0,18 26522 /cow/home/ubuntu/.fontconfig/e13b20fdb08344e0e664864cc2ede53d-x86.cache-2 (stat: No such file or directory)
gnome-pan 9252 ubuntu cwd DIR 0,19 820 267 /home/ubuntu
nautilus 9255 ubuntu cwd DIR 0,19 820 267 /home/ubuntu
nautilus 9255 ubuntu mem REG 0,18 26522 /cow/home/ubuntu/.fontconfig/e13b20fdb08344e0e664864cc2ede53d-x86.cache-2 (stat: No such file or directory)
vino-sess 9278 ubuntu cwd DIR 0,19 820 267 /home/ubuntu
bluetooth 9281 ubuntu cwd DIR 0,19 820 267 /home/ubuntu
update-no 9285 ubuntu cwd DIR 0,19 820 267 /home/ubuntu
evolution 9291 ubuntu cwd DIR 0,19 820 267 /home/ubuntu
python 9296 ubuntu cwd DIR 0,19 820 267 /home/ubuntu
nm-applet 9298 ubuntu cwd DIR 0,19 820 267 /home/ubuntu
fast-user 9380 ubuntu mem REG 0,18 26522 /cow/home/ubuntu/.fontconfig/e13b20fdb08344e0e664864cc2ede53d-x86.cache-2 (stat: No such file or directory)
deskbar-a 9382 ubuntu cwd DIR 0,19 820 267 /home/ubuntu
mixer_app 9384 ubuntu mem REG 0,18 26522 /cow/home/ubuntu/.fontconfig/e13b20fdb08344e0e664864cc2ede53d-x86.cache-2 (stat: No such file or directory)
firefox 9392 ubuntu cwd DIR 0,19 820 267 /home/ubuntu
run-mozil 9404 ubuntu cwd DIR 0,19 820 267 /home/ubuntu
firefox-b 9408 ubuntu cwd DIR 0,19 820 267 /home/ubuntu
firefox-b 9408 ubuntu mem REG 0,18 26522 /cow/home/ubuntu/.fontconfig/e13b20fdb08344e0e664864cc2ede53d-x86.cache-2 (stat: No such file or directory)
firefox-b 9408 ubuntu 4wW REG 0,19 0 9344 /home/ubuntu/.mozilla/firefox/uztqt7bt.default/.parentlock
firefox-b 9408 ubuntu 10wW REG 0,19 0 9344 /home/ubuntu/.mozilla/firefox/uztqt7bt.default/.parentlock
firefox-b 9408 ubuntu 21u REG 0,19 1977344 9483 /home/ubuntu/.mozilla/firefox/uztqt7bt.default/urlclassifier2.sqlite
firefox-b 9408 ubuntu 34u REG 0,19 2048 9463 /home/ubuntu/.mozilla/firefox/uztqt7bt.default/search.sqlite
firefox-b 9408 ubuntu 36u REG 0,19 18656 9475 /home/ubuntu/.mozilla/firefox/uztqt7bt.default/history.dat
firefox-b 9408 ubuntu 39u REG 0,19 65536 9445 /home/ubuntu/.mozilla/firefox/uztqt7bt.default/cert8.db
firefox-b 9408 ubuntu 40u REG 0,19 16384 9446 /home/ubuntu/.mozilla/firefox/uztqt7bt.default/key3.db
firefox-b 9408 ubuntu 41u REG 0,19 2048 9463 /home/ubuntu/.mozilla/firefox/uztqt7bt.default/search.sqlite
firefox-b 9408 ubuntu 42u REG 0,19 276 9471 /home/ubuntu/.mozilla/firefox/uztqt7bt.default/Cache/_CACHE_MAP_
firefox-b 9408 ubuntu 43u REG 0,19 1779712 9472 /home/ubuntu/.mozilla/firefox/uztqt7bt.default/Cache/_CACHE_001_
firefox-b 9408 ubuntu 44u REG 0,19 621568 9473 /home/ubuntu/.mozilla/firefox/uztqt7bt.default/Cache/_CACHE_002_
firefox-b 9408 ubuntu 45u REG 0,19 897024 9474 /home/ubuntu/.mozilla/firefox/uztqt7bt.default/Cache/_CACHE_003_
firefox-b 9408 ubuntu 46u REG 0,19 227 9501 /home/ubuntu/.mozilla/firefox/uztqt7bt.default/formhistory.dat
firefox-b 9408 ubuntu 48u REG 0,19 1977344 9483 /home/ubuntu/.mozilla/firefox/uztqt7bt.default/urlclassifier2.sqlite
xchat-gno 9693 ubuntu cwd DIR 0,19 820 267 /home/ubuntu
ubuntu@ubuntu:/$ lsof | grep u666
lsof: WARNING: can't stat() tmpfs file system /cow
Output information may be incomplete.
ubuntu@ubuntu:/$

confused57
April 24th, 2008, 06:39 AM
You might want to post the output of:

sudo fdisk -l
-l is a lowercase "L"

Drone4four
April 24th, 2008, 07:05 AM
Yes! fdisk was the command I was looking for:
ubuntu@ubuntu:/$ sudo fdisk -l
omitting empty partition (5)

Disk /dev/sda: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0574c76c

Device Boot Start End Blocks Id System
/dev/sda1 1 41 329301 83 Linux
/dev/sda2 * 42 5013 39937590 7 HPFS/NTFS
/dev/sda3 5014 38913 272301750 f W95 Ext'd (LBA)
/dev/sda4 10242 15348 41021946 83 Linux
/dev/sda5 5014 10241 41993847 83 Linux
/dev/sda6 15349 15603 2048256 82 Linux swap / Solaris
/dev/sda7 15604 38913 187237543+ b W95 FAT32

confused57
April 24th, 2008, 07:25 AM
You may want to use Grub's CLI to investigate your computer:
http://users.bigpond.net.au/hermanzone/p15.htm#cli

Is /dev/sda1 a separate /boot partition & your root partition sda4 or sda5?

Drone4four
April 24th, 2008, 07:45 AM
@confused57:

I haven't yet investigated the Grub CLI link, but I will do that in a moment. I have just a quick note to make. I forget if sda1 is a partition for /boot. My theory is that sda1 is not a /boot part because this is what Grub says:



grub> root (hd0,0)

grub> setup (hd0,0)
Checking if "/boot/grub/stage1" exists... no
Checking if "/grub/stage1" exists... no

Error 15: File not found


Grub is saying there are no grub files on sda1. The only setup that detects stage1 is (hd0,5):

grub> root (hd0,5)

grub> setup (hd0,5)
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 (hd0,5)"... failed (this is not fatal)
Running "embed /boot/grub/e2fs_stage1_5 (hd0,5)"... failed (this is not fatal)
Running "install /boot/grub/stage1 (hd0,5) /boot/grub/stage2 p /boot/grub/menu
.lst "... failed

Error 12: Invalid device requested



btw, sda4 is Ubuntu and sda5 is Slamd64 11 (not 12 yet).

Drone4four
April 24th, 2008, 08:06 AM
I've now read through the CLI guide to Grub prescribed by confused57. Here is some interesting information about my hd. While interesting, I don't see how this stuff helps me get Grub working again:



grub> find /vmlinuz
(hd0,5)

grub> find /sbin/init
(hd0,3)
(hd0,5)

There is no menu.lst in hd0,3:

grub> cat (hd0,3)/boot/grub/menu.lst

Error 15: File not found


But there is a menu.lst in hd0,5:


grub> cat (hd0,5)/boot/grub/menu.lst
# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not use 'savedefault' or your
# array will desync and will not let you boot your system.
default 0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 10

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu

# Pretty colours
#color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=1af6a3e7-c8fe-477e-ace9-144b584414ad ro
## Setup crashdump menu entries
## e.g. crashdump=1
# crashdump=0

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,7)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash

## should update-grub lock old automagic boot options
## e.g. lockold=false
## lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

## ## End Default Options ##

title Ubuntu 7.10, kernel 2.6.22-14-generic
root (hd0,7)
kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=1af6a3e7-c8fe-477
e-ace9-144b584414ad ro quiet splash
title Ubuntu 7.10, kernel 2.6.22-14-generic (recovery mode)
root (hd0,7)
kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=1af6a3e7-c8fe-477
e-ace9-144b584414ad ro single
initrd /boot/initrd.img-2.6.22-14-generic

title Ubuntu 7.10, memtest86+
root (hd0,7)
kernel /boot/memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title Other operating systems:
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda2
title Microsoft Windows XP Professional
root (hd0,1)
savedefault
makeactive
chainloader +1


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/sda5.
title Linux (on /dev/sda5)
root (hd0,4)
kernel /boot/vmlinuz root=/dev/sda5 ro vga = 773
savedefault
boot


grub>

talsemgeest
April 24th, 2008, 09:22 AM
@confused57:

I haven't yet investigated the Grub CLI link, but I will do that in a moment. I have just a quick note to make. I forget if sda1 is a partition for /boot. My theory is that sda1 is not a /boot part because this is what Grub says:



grub> root (hd0,0)

grub> setup (hd0,0)
Checking if "/boot/grub/stage1" exists... no
Checking if "/grub/stage1" exists... no

Error 15: File not found


Grub is saying there are no grub files on sda1. The only setup that detects stage1 is (hd0,5):

grub> root (hd0,5)

grub> setup (hd0,5)
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 (hd0,5)"... failed (this is not fatal)
Running "embed /boot/grub/e2fs_stage1_5 (hd0,5)"... failed (this is not fatal)
Running "install /boot/grub/stage1 (hd0,5) /boot/grub/stage2 p /boot/grub/menu
.lst "... failed

Error 12: Invalid device requested



btw, sda4 is Ubuntu and sda5 is Slamd64 11 (not 12 yet).
If you want sda4 as the root, you do the following:
sudo grub
root (hd0,3)
setup (hd0)
quit

confused57
April 24th, 2008, 02:48 PM
I would recommend trying Super Grub Disk to boot your Ubuntu partition:
http://users.bigpond.net.au/hermanzone/SuperGrubDiskPage.html

Drone4four
April 24th, 2008, 05:10 PM
@confused57: I donlwoaded and burned the super grub iso. I booted it. there were lots of options. Here are the intructions I followed:


I reinstalled Windows and Linux no longer boots.

1. boot your SGD floppy disk, USB disk or CD-ROM
2. English Super Grub Disk
3. Gnu/Linux
4. Fix Boot of Gnu/Linux (GRUB)
5. select your Linux partition
6. see message, 'SGD has succeeded'
7. you're done! reboot


It all went smoothly until I got to step 5. The only partition I saw was sda6 -- my swap part. I selected it, SGD said it "succeeded". I reboot and I have a Grub loader, but when I select Ubuntu, it says "Error 15." I get error 15 for the other Linux installation, Slamd64. The mem test doesn't work either. Should I just install Hardy? I suppose I could, but that is kinda like giving up.

@talsemgeest: At setup (hd0), I get this error: Error 15: File not found

confused57
April 24th, 2008, 06:36 PM
Try this with SGD(excerpt from Herman's grub page):

If you have only one Linux or a standard dual boot with one Linux and one Windows install 'English Super Grub Disk'-->'Gnu/Linux'-->'Boot Gnu/Linux Directly' will bypass those corrupted files and boot your operating system. (Even if they are not there at all)!

Asobi
April 24th, 2008, 11:37 PM
um.. thread title says how to install grub but then it explain how to restore it, for which it already has to be installed. bummer

i get the 'cant execute install-grub" error at 94% during installation. next i installed ubuntu 8.04 without installing a bootloader and then the installation finished without any problems.

but now i got no bootloader installed. if i browse the ubunutu installation (on hda1, hda0 has win xp) with the live cd the /boot dir doesnt have anything grub related. neither does -find /boot/grub/stage1- give any results.

ive been able to install ubuntu and windows in a duel boot on the same harddrive and same partions setup without any probs before. but there doesnt seem to be a proper answer to the error during grub installation error at 94% in posts going all the way back to 2005 on various boards/forums. i might just format the whole drive, repartition it and cross my fingers and install windows and ubuntu. actually i could have done that twice in the time ive been busy figuring out how to install grub on itself.

jw5801
April 25th, 2008, 01:32 AM
um.. thread title says how to install grub but then it explain how to restore it, for which it already has to be installed. bummer

i get the 'cant execute install-grub" error at 94% during installation. next i installed ubuntu 8.04 without installing a bootloader and then the installation finished without any problems.

but now i got no bootloader installed. if i browse the ubunutu installation (on hda1, hda0 has win xp) with the live cd the /boot dir doesnt have anything grub related. neither does -find /boot/grub/stage1- give any results.

ive been able to install ubuntu and windows in a duel boot on the same harddrive and same partions setup without any probs before. but there doesnt seem to be a proper answer to the error during grub installation error at 94% in posts going all the way back to 2005 on various boards/forums. i might just format the whole drive, repartition it and cross my fingers and install windows and ubuntu. actually i could have done that twice in the time ive been busy figuring out how to install grub on itself.

If you can boot into the installation (via the livecd or supergrub disc), then you can run
sudo apt-get install grub

After that you may need to follow this how-to, but I'm not sure. Most likely not.

Drone4four
April 25th, 2008, 07:31 AM
Try this with SGD(excerpt from Herman's grub page):

In the Boot Gnu/Linux Directly option, I choose sda4 (Ubuntu resierfs partition), and then have to make another selection, this time sda6 (swap partition) is the only option....then something boots (it doesn't really look like Ubuntu) and then it halts. This is the error message in part:


...
FATAL: Could not open /lib/modules/2.6.16.29/modules.dep.temp
...
...
Begin: Waiting for root file system...


I'm gonna try this guide on my Ubuntu LiveCD: http://www.arsgeek.com/?p=3340

Drone4four
April 25th, 2008, 08:15 AM
Here are the commands I used on the LiveCD based on that guide I posted moments ago:


ubuntu@ubuntu:~$ sudo apt-get install ms-sys
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
ms-sys
0 upgraded, 1 newly installed, 0 to remove and 200 not upgraded.
Need to get 20.4kB of archives.
After unpacking 131kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com gutsy/universe ms-sys 2.1.0-1 [20.4kB]
Fetched 20.4kB in 1m2s (324B/s)
Selecting previously deselected package ms-sys.
(Reading database ... 92049 files and directories currently installed.)
Unpacking ms-sys (from .../ms-sys_2.1.0-1_i386.deb) ...
Setting up ms-sys (2.1.0-1) ...
ubuntu@ubuntu:~$ fdisk -l
ubuntu@ubuntu:~$ sudo fdisk -l
omitting empty partition (5)

Disk /dev/sda: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0574c76c

Device Boot Start End Blocks Id System
/dev/sda1 1 41 329301 83 Linux
/dev/sda2 * 42 5013 39937590 7 HPFS/NTFS
/dev/sda3 5014 38913 272301750 f W95 Ext'd (LBA)
/dev/sda4 10242 15348 41021946 83 Linux
/dev/sda5 5014 10241 41993847 83 Linux
/dev/sda6 15349 15603 2048256 82 Linux swap / Solaris
/dev/sda7 15604 38913 187237543+ b W95 FAT32
ubuntu@ubuntu:~$ sudo ms-sys -m /dev/sda
Windows 2000/XP/2003 master boot record successfully written to /dev/sda
ubuntu@ubuntu:~$ sudo ms-sys -m /dev/sda4
/dev/sda4 seems to be a disk partition device,
use the switch -f to force writing of a master boot record
ubuntu@ubuntu:~$ sudo ms-sys -mf /dev/sda4
Windows 2000/XP/2003 master boot record successfully written to /dev/sda4
ubuntu@ubuntu:~$

at the first ms-sys command, it says that the master boot record was sucessfully written to /dev/sda. However, I thought to myself, I am trying to write the MBR to the Ubuntu partition, so I added a 4 to sda. WHen I added 4, it says that I should use f, so I applied it. But then I realized that it says "Windows 2000/XP/2003," meaning: should I revert back to the intial ms-sys command? I am confused.

*Sigh*

I'll re-enter the intial ms-sys command:


ubuntu@ubuntu:~$ sudo ms-sys -m /dev/sda
Windows 2000/XP/2003 master boot record successfully written to /dev/sda
ubuntu@ubuntu:~$


I'll reboot, hopefully to report back using my sda4 Ubuntu part....

Drone4four
April 25th, 2008, 08:20 AM
I am reporting back on my win32 part. No Grub loaded at boot. I'm all outta ideas. Anyone know what else I could try?

Asobi
April 25th, 2008, 08:22 AM
If you can boot into the installation (via the livecd or supergrub disc), then you can run
sudo apt-get install grub

After that you may need to follow this how-to, but I'm not sure. Most likely not.

tnx for the reply but no luck. though the ubuntu installation (on hda1) did have grub files under /boot/grub now while the directory wasnt present at first, browsing it from the live CD. -find /boot/grub/stage1- still gave no results neither did grub load at boot up.

edit: neither did i manage to identify the stage1 file myself

surely its possible, probable very simple but i just repartitioned the whole drive from scratch and reinstalled both win and linux, hoping for the best of luck while packing my bags for the weekend.

edit2: installation failed again, installations dont come much cleaner then this. stupidest thing is it has always worked fine, both 7.10 and 8.04 fail now

talsemgeest
April 25th, 2008, 08:55 AM
I am reporting back on my win32 part. No Grub loaded at boot. I'm all outta ideas. Anyone know what else I could try?
There is always the last resort: backup and reinstall. It is even more useful now that hardy has been released.

Asobi
April 25th, 2008, 10:36 AM
tnx for the reply but no luck. though the ubuntu installation (on hda1) did have grub files under /boot/grub now while the directory wasnt present at first, browsing it from the live CD. -find /boot/grub/stage1- still gave no results neither did grub load at boot up.

edit: neither did i manage to identify the stage1 file myself

surely its possible, probable very simple but i just repartitioned the whole drive from scratch and reinstalled both win and linux, hoping for the best of luck while packing my bags for the weekend.

edit2: installation failed again, installations dont come much cleaner then this. stupidest thing is it has always worked fine, both 7.10 and 8.04 fail now

i managed to get the dual-boot done.

i normally use partitionmagic (bootable) to edit my partitions, has always workded flawless. this time though i gave it a try making partition using the windows installer. made 3 partitions for 3 OS, installed windows on the first, ubuntu as normal on the second and no errors. perfectly working dual-boot now with the thirde partition free (unformatted)

i think though the problem got solved before i tried the above when i did an single boot installation of ubuntu during which i cleared the partition table of the drive from ubuntu and grub installed fine.

so i might have been something to do with the partition table and grub.

Drone4four
April 25th, 2008, 10:41 AM
Surprise! 8.04 doesn't recognize any of my other partitions, including WindowsXP. Here is my new thread with a full description of my problem: http://ubuntuforums.org/showthread.php?p=4788460#post4788460

confused57
April 25th, 2008, 01:42 PM
The only other thing I can think of for you to try is Testdisk:
http://www.users.bigpond.net.au/hermanzone/p21.html
it may be able to restore your partition table &/or filesystem(s).

Added: Parted Magic has Testdisk, Parted, etc:
http://partedmagic.com/wiki/PartedMagic.php

Drone4four
April 25th, 2008, 03:00 PM
confused57: Someone else in my thread directed me to TestDisk. In great detail I report about the feedback TestDisk gives me: http://ubuntuforums.org/showthread.php?p=4788460#post4788460

confused57: I might be able to use your advice there. =D

ubestim
April 30th, 2008, 05:26 PM
You may don't need the live CD at all ,
Install grub4dos on windows
when booting ,choose the grub entry
and then choose the:
find and load linux with menu.lst installed

This way you can load Ubuntu
It works fine for me.

stanz
May 16th, 2008, 06:22 PM
I just went thru all this myself ~ dual-booting, needing to re-install m$, loosing grub.
I found having Gutsy -- using older versions of Ubuntu cd's -- grub wouldn't re-install.
I used the Gutsy Alternate Install cd -- choose "rescue installed system" at boot screen.
Once through the choices to re-install grub, I added the drive "(hd0)" ~ for my system...
and returned to the selection screen -- ticked "reboot system" and sure enough, I was greeted with my modified grub menu!
This worked for me, after trying without joy--the other method.
I hope its a help!!

neilevan814
May 17th, 2008, 03:31 AM
I have just installed Ubuntu 8.04 to my slave drive sdb and I really didn't want to risk screwing up windows xp's MBR with grub, so I thought I would install grub to dev/sdb1. Then when I boot my system I would just change the boot order of master and slave so slave would boot first and i would be able to access my ubuntu install. When I booted the process got hung at grub with a blinking cursor and that was that. Is there a way to set my whole installation up on my slave drive so that I can access it the way I want? I am afraid of grub in hd0 MBR because I have read that it installs before the ntldr in xp and then even if given the option to boot into either OS..you can only really get into linux...Neil

aquaxbat
May 17th, 2008, 04:56 AM
No idea if someone has already asked this or not and I don't feel like reading 32 pages of this thread so here goes:

I had ubuntu installed on another hard drive that was partitioned (one was Xp the other ubuntu). I decided to grab my old HD (160gb) out of my old computer that had linux on it. I upgraded it to 8.04 with no problem. Well I decided to take the other HD (one with partitioned XP and 8.04 on it) and turn it into an XP drive. When I did this I could no longer access my 160gb HD, no grub or anything. My question is, can I some how get grub onto this 160gb HD so I can get things back up and running?? I am thinking that somehow grub was setup on the dual partitioned drive and was never installed onto the 160gb HD. help please!! I can't do anything with livecd because the 160gb HD says "System Volume Information" and then some .log file but no way to access anything on that drive.

Make things simple, I have ubuntu on a hard drive that won't boot but I know the HD is good. How do I get grub installed onto it or just get it to boot period...

stanz
May 21st, 2008, 06:00 AM
I have just installed Ubuntu 8.04 to my slave drive sdb and I really didn't want to risk screwing up windows xp's MBR with grub, so I thought I would install grub to dev/sdb1. Then when I boot my system I would just change the boot order of master and slave so slave would boot first and i would be able to access my ubuntu install. When I booted the process got hung at grub with a blinking cursor and that was that. Is there a way to set my whole installation up on my slave drive so that I can access it the way I want? I am afraid of grub in hd0 MBR because I have read that it installs before the ntldr in xp and then even if given the option to boot into either OS..you can only really get into linux...Neil
Geez Neil, Where'd you get the thought that grub would 'screw up' xp's mbr?
It ain't xp's anyways...it's Your PC!
Anyway...you may need to use the install mentioned in this post, or use what I did. You aren't screwing anything up - nor - breaking anything. It sounds like you need a different 'path' to your disk and partition, from which to boot from.
Don't fear...let grub install to the mbr - as it already recognized xp being there. You will be prompted 'who' will bootup.
Grub let me brake and repair it ~ a ba-zillion times...on different pc's/laptops...without 'grub' ever screwing up things.
My opinion...my experience..
Rock on and post your drives, if ya have more questions.


:guitar:

stanz
May 21st, 2008, 06:08 AM
No idea if someone has already asked this or not and I don't feel like reading 32 pages of this thread so here goes:

I had ubuntu installed on another hard drive that was partitioned (one was Xp the other ubuntu). I decided to grab my old HD (160gb) out of my old computer that had linux on it. I upgraded it to 8.04 with no problem. Well I decided to take the other HD (one with partitioned XP and 8.04 on it) and turn it into an XP drive.

How did you turn that drive into an xp drive?
...xp re-install?
...You had 'grub' handling the boot process..."how" did you change that?
I ask this because grub my still be there, with no 'directions' on how to access it. So knowing 'what' you did...and how ~ is important, to try to help ya out.
Don't worry...grub is stronger then ya think...Lol


:guitar:

praveenpious
May 23rd, 2008, 07:12 AM
I have tried the steps mentioned in the initial post, but i am still unable to set the grub boot screen. The steps done by me are listed in here :

grub> find /boot/grub/stage1
(hd1,6)

grub> root (hd1,6)

grub> setup (hd1)
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 (hd1)"... 16 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd1) (hd1)1+16 p (hd1,6)/boot/grub/stage2
/boot/grub/menu.lst"... succeeded
Done.

Yet when i reboot, the pc just boots into windows xp.

Help me out guys...

talsemgeest
May 23rd, 2008, 07:54 AM
Are you booting off the right hard drive?

unutbu
May 23rd, 2008, 01:36 PM
praveenpious, try:



grub> root (hd1,6) # Tells GRUB where menu.lst is
grub> setup (hd0) # Write to MBR of first HD


The problem is your computer is reading the MBR on your first HD (hd0), not your second (hd1). The MBR on the first HD is probably the usual Windows MBR, so you are currently being booted directly into Windows.

Note that the setup (hd0) command will overwrite your Windows MBR. To boot Windows, you'll need a stanza in your menu.lst that looks something like this:



title Windows 95/98/NT/2000
root (hd0,0)
makeactive
chainloader +1
(hd0,0) is just a guess -- it depends on your system.

BlueToast
May 27th, 2008, 06:13 PM
Thanks to this thread, my problem at http://ubuntuforums.org/showthread.php?p=4995813 was solved!

Saghaulor
May 27th, 2008, 08:37 PM
Here's where I'm at.

I had 64Studio and Hardy Heron installed, both were recognized in grub, both booted.

Today I installed Winxp because gparted couldn't do the work I needed it to do with a ntfs partition, so I was resorting to using Windows and Paragon Partition Manager.

After installing Windows and Paragon, I labeled my partitions using Paragon because I kept getting confused as to which partition was which.

Obviously Windows writes over the MBR, so I had to reinstall grub.

I used this tutorial to reinstall grub.

It recognized two grubs, (hd0,1) and (hd0,2).

The first was my good old grub before Windows, namely, it recognized 64studio and Hardy, however, it did not see Windows.

The second was 64studio and Windows.

I'd like my grub to list all installed operating systems. I'm not sure how to do that. So please point me in the right direction.

But here is the bigger problem, now when I try to boot either of my Linux installations I receive errors. I'm not sure what the problem is.

I thought maybe labeling the partition had something to do with it, so I went back into Windows and removed the partition label from Hardy, and then tried to boot back into Hardy, however, I received the exact same error.

I'd like to be able to fix whatever broke so that I can boot any of my three os's, and not just Windows. Hopefully I don't have to reinstall Hardy and 64studio in order to get them working. Please help.

Here is the messages that I receive when I try to boot either one of my Linux partitions.

64studio: Error 15: file not found
Hardy: Error 17: Cannot mount selected partition

A recap of what I need to do; what I need help doing.
1] Fix grub so that it lists all installed operating systems.
2] Fix the Linux not booting errors problem.
3] Thank you in advance.

unutbu
May 27th, 2008, 09:15 PM
Hello Saghaulor,
Perhaps the easiest thing to do is to burn yourself a Super Grub Disk from http://supergrub.forjamari.linex.org/.

Try the instructions here: Restore grub in 3 steps (http://supergrub.forjamari.linex.org/?section=documentation#grub_restore)

People who know a lot more than me say this is the "go-to" tool for grub booting problems, so it is a nice rescue cd for any GRUB user to possess. Since you can boot into Windows, you can burn it from there.

If that does not work, or if you prefer not burning a CD or prefer rolling up your sleeves and getting your hands dirty, post and I'll try to help you through the steps manually.

talsemgeest
May 28th, 2008, 05:41 AM
For the XP problem, I would suggest using your old grub, and adding windows to the bottom of your menu.lst.

However for the other problem, I have no idea...

Saghaulor
May 28th, 2008, 02:15 PM
Hello Saghaulor,
Perhaps the easiest thing to do is to burn yourself a Super Grub Disk from http://supergrub.forjamari.linex.org/.

Try the instructions here: Restore grub in 3 steps (http://supergrub.forjamari.linex.org/?section=documentation#grub_restore)

People who know a lot more than me say this is the "go-to" tool for grub booting problems, so it is a nice rescue cd for any GRUB user to possess. Since you can boot into Windows, you can burn it from there.

If that does not work, or if you prefer not burning a CD or prefer rolling up your sleeves and getting your hands dirty, post and I'll try to help you through the steps manually.

I still encounter the same errors when I try to boot my Linux partitions.

I'm not sure if I am correct, but I think some kind of reference or partition type got screwed up, so Linux won't boot. Please help.

unutbu
May 28th, 2008, 02:52 PM
Hello Saghaulor, let's try fixing GRUB manually.
Boot the machine from the Hardy LiveCD. Open a terminal. Post the output of


sudo fdisk -l

Saghaulor
May 28th, 2008, 04:39 PM
Hello Saghaulor, let's try fixing GRUB manually.
Boot the machine from the Hardy LiveCD. Open a terminal. Post the output of


sudo fdisk -l

ubuntu@ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 100.0 GB, 100030242816 bytes
255 heads, 63 sectors/track, 12161 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x72fb72fb

Device Boot Start End Blocks Id System
/dev/sda1 1 1305 10482381 c W95 FAT32 (LBA)
/dev/sda2 4196 6262 16603177+ 83 Linux
/dev/sda3 * 6263 7113 6835657+ 83 Linux
/dev/sda4 7114 12161 40548060 5 Extended
/dev/sda5 7114 7328 1726956 82 Linux swap / Solaris
/dev/sda6 7329 12161 38821041 83 Linux
ubuntu@ubuntu:~$

Here is the data that you requested unutbu.

For clarification:
sda2 is my Hardy partition
sda3 is my 64Studio partition
sda6 is my data partition for 64studio
sda5 is my swap partition
sda4 is labeled extended
sda1 is my windows partition
and there is 22.14gig of unallocated space between sda1 and sda2

Where do we go from here?

By the way, thank you for the help.

unutbu
May 28th, 2008, 05:38 PM
Boot from the LiveCD. Run the following commands:


sudo mkdir /Hardy
sudo mount /dev/sda2 /Hardy
cat /Hardy/boot/grub/menu.lst

Post the output here.

Saghaulor
May 28th, 2008, 05:46 PM
Boot from the LiveCD. Run the following commands:


sudo mkdir /Hardy
sudo mount /dev/sda2 /Hardy
cat /Hardy/boot/grub/menu.lst

Post the output here.

ubuntu@ubuntu:~$ sudo mkdir /Hardy
ubuntu@ubuntu:~$ sudo mount /dev/sda2 /Hardy
ubuntu@ubuntu:~$ cat /Hardy/boot/grub/menu.lst
default 0
timeout 10

title Ubuntu 8.04, kernel 2.6.24-16-generic
root (hd0,3)
kernel /boot/vmlinuz-2.6.24-16-generic root=UUID=06992fa4-28cd-4ca5-9ae1-cf053d9626e5 ro quiet splash
initrd /boot/initrd.img-2.6.24-16-generic
quiet

title Ubuntu 8.04, kernel 2.6.24-16-generic (recovery mode)
root (hd0,3)
kernel /boot/vmlinuz-2.6.24-16-generic root=UUID=06992fa4-28cd-4ca5-9ae1-cf053d9626e5 ro single
initrd /boot/initrd.img-2.6.24-16-generic

title Ubuntu 8.04, memtest86+
root (hd0,3)
kernel /boot/memtest86+.bin
quiet

title Other operating systems:
root

title 64 Studio, kernel 2.6.21-1-multimedia-amd64 (on /dev/sda2)
root (hd0,1)
kernel /boot/vmlinuz-2.6.21-1-multimedia-amd64 root=/dev/sda2 ro acpi=on vga=791 splash=silent
initrd /boot/initrd.img-2.6.21-1-multimedia-amd64
savedefault

title 64 Studio, kernel 2.6.21-1-multimedia-amd64 (single-user mode) (on /dev/sda2)
root (hd0,1)
kernel /boot/vmlinuz-2.6.21-1-multimedia-amd64 root=/dev/sda2 ro acpi=on vga=791 splash=silent single
initrd /boot/initrd.img-2.6.21-1-multimedia-amd64
savedefault
ubuntu@ubuntu:~$

unutbu
May 28th, 2008, 05:58 PM
gksu gedit /Hardy/boot/grub/menu.lst
Find/Replace (hd0,1) --> (hd0,2)
Find/Replace (hd0,3) --> (hd0,1)

Add a boot stanza for Windows (see below). Place it at the end, below the line that says


### END DEBIAN AUTOMAGIC KERNELS LIST

Add:


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

Save and exit. Reboot.

unutbu
May 28th, 2008, 06:02 PM
Hold on...

After you edit menu.lst, go to the terminal and run


sudo grub

grub> root (hd0,1)
grub> setup (hd0)
grub> quit

Now reboot.

Saghaulor
May 28th, 2008, 06:24 PM
You know what, once you had me post the outputs I thought that the incorrect (hd0) references might have been the culprit.

Thank you so much for getting me back to normal.

unutbu
May 28th, 2008, 06:32 PM
I'm happy to have helped!

piotrv
May 28th, 2008, 08:46 PM
I'm happy to have helped!

Thanks so much from me as well.

I had been juggling with partitions using partedmagic and couldn't get de grub loader working anymore. Supergrub didn't work.

It all makes sense now following your step by step approach and if this happens again I do not feel lost :-)
It makes you appreciate Linux again....

_sleeper
May 28th, 2008, 11:13 PM
yet i face another problem guys. i did install grub in the hd0 drive, but the thing is that my winXp are installed in hd1 (/dev/sdb), thus windows' bootlaoder is there. i tried to do setup(hd1), but it gave me an error that /dev/sdb couldn't be mounted, but it actually was. any suggestions?

unutbu
May 29th, 2008, 02:06 AM
piotrv, thanks for the kind words.

_sleeper, with GRUB installed on (hd0), GRUB will read /boot/grub/menu.lst on your Ubuntu partition and from there it can boot your windows OS if you edit menu.lst to contain a boot stanza that looks like this:


title Windows XP
root (hd1,0)
savedefault
makeactive
map (hd0) (hd1)
map (hd1) (hd0)
chainloader +1

See http://users.bigpond.net.au/hermanzone/p15.htm#Chainloading_Windows_using_map_commands

_sleeper
May 29th, 2008, 08:17 AM
yeah, i know what you mean and the thing is that the menu.lst is exactly like this. but, for some reason it seems to refer to hd1 for the bootloader and bypasses hd0 and grub. strange, eh?

meierfra.
May 29th, 2008, 08:33 AM
_sleeper: Please tell us exactly what is happening. It sounds like you are booting directly into Windows. Is that true? In this case I suggest to change the boot order in the bios.


If that does not help, post the output of


sudo fdisk -l
( l is a lower case L)

(if you can't boot into Ubuntu, you need to use the LiveCD for that)

_sleeper
May 29th, 2008, 08:53 AM
this is exactly what is happening! my pc boots directly into windows. yes, a change in the bios would be right, but i don't think that it gives the option to choose between hard drives, it just says : cdrom, hd, etc. a solution could be to change the cables, so that hd1 would become primary and vice versa.

anyway i'm late for work, so i'll get back for some feedback later!

thanx alot for the help guys.

unutbu
May 29th, 2008, 11:57 AM
(Edited to correct some errors pointed out by meierfra below)

_sleeper, I think you are right -- swapping the cables to the hard drives is probably the easiest way to get the BIOS hard drive order and GRUB hard drive order to agree.

But if you'd like to try to find a software solution, I would suggest trying mbwardle's method (http://ubuntuforums.org/showpost.php?p=3518911&postcount=9).

Below, I'm assuming /dev/sda1 contains the boot files for your Ubuntu OS and /dev/sdb1 contains the boot files for your Windows OS. If that assumption is not true, stop, post the output of `sudo fdisk -l`, and we'll discuss what to do. Alternatively, if you understand the method I'm describing below and understand GRUB's numbering system (http://www.gnu.org/software/grub/manual/grub.html#Naming-convention), then you can modify the instructions below on your own.

Boot from the LiveCD.



cd /
sudo mkdir /Windows
mount /dev/sdb1 /Windows # Change sdb1 to whatever is appropriate
gedit /Windows/notes.txt # Leave it open so you can cut and paste the rest of the terminal commands and output into the file.

sudo fdisk -l

cd /
sudo mkdir /Ubuntu
mount /dev/sda1 /Ubuntu
cd /Ubuntu/boot/grub
sudo cp device.map device.map-orig
gksu gedit device.map
Edit the /Ubuntu/boot/grub/device.map so it looks like this:


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


Save and exit.


sudo grub --device-map=device.map
grub> root (hd1,0) # With the new device.map, Linux is now the second HD
grub> setup (hd0) # hd0 is now the hard drive containing Windows
grub> quit

Hopefully you won't get the same '/dev/sdb couldn't be mounted error'. (By the way, this error is -- to my understanding -- quite strange, because it is partitions like /dev/sdb1 that get mounted, not whole hard drives like /dev/sdb.) If you do, then this method did not work and swapping cables is likely the way to go. (If it does not work, sudo mv device.map-orig device.map).

Assuming it did work, save a copy of menu.lst just in case we need to revert our changes later:


sudo cp /Ubuntu/boot/grub/menu.lst /Ubuntu/boot/grub/menu.lst-beforedevicemap
gksu gedit /Ubuntu/boot/grub/menu.lst
Change all boot stanzas associated with Ubuntu to



root (hd1,0)


and the boot stanzas associated with Windows to



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

Copy all terminal output to notes.txt.
Reboot.

If it doesn't work, post notes.txt here.

meierfra.
May 29th, 2008, 07:08 PM
Just a couple of comments on the previous post:


sudo grub --device.map=device.map

Needs to be


sudo grub --device-map=device.map
(this typo is already in mbwardle's original post)




and all boot stanzas associated with Windows to

You also need to remove the two map lines.


I would like mention that unutbu's post is based on the assumption that ubuntu is on "/dev/sda" and windows on "/dev/sdb" (which seems to be true according to _sleepers first post, although that post doesn't really say where Ubuntu is located).

_sleeper
May 30th, 2008, 12:34 AM
yeah, i should clear this out for good!

my ubuntu is on hd0 (or hda if you wish) and my xp on hd1.

anyway, the solution was simple. i swapped the cables of my 2 hard drives and the problem was sorted out. now i have hd0 as primary, as it should, and grub works great and boots both ubuntu and xp.

a huge thanx for all the help guys.

freefrags
June 1st, 2008, 11:46 AM
hi
i see you guys are pretty good at solving problems with grub if anybody has a little time could they please help me out with my problem here
http://ubuntuforums.org/showthread.php?p=5090621#post5090621

thanks in advance

grx20jb
June 2nd, 2008, 08:42 AM
Sorry if someone answered this question within the 36 pages of replies already! If so, could you please direct me?

I installed ubuntu 8.04 on a fresh HDD, in a partition, and also allocated a swap.

I then installed windows on the empty space.

Windows, being gay, over-rode everything and made the computer boot straight to windows.

I followed your initial instructions on re-installing the grub boot-loader, but there's only the linux option... the windows option isn't there!

I have another laptop which runs a dual boot, but on that laptop i loaded windows, then linux! Not the other way around, and it works fine.

Since i've spent time and downloads updating and configuring, can you tell me how to configure GRUB to recognise the windows XP OS?

Thanks for your time!

meierfra.
June 2nd, 2008, 09:22 AM
You need to edit menu.lst:


gksudo gedit /boot/grub/menu.lst

Change "timeout 3" to "timeout 10"

and

"hiddenmenu" to "#hiddenmenu"

Add something like this to the very end of "menu.lst"

title Windows XP
root (hd0,1)
chainloader +1


Grubs starts counting at 0. So you have to use (hd0,1) if XP is on the second partition of the first hard drive. (If you have more than one hard drive, and XP is not on the drive you are booting from, this needs to modified a little bit, just asked)

TheDriller
June 2nd, 2008, 05:08 PM
hi,
now that i have re-installed grub, my machine wont allow me to boot into my windows XP partition, here is the whole story:

-I had Ubuntu Studio intalled but wanted to dualboot XP

-I used GParted Live CD to resize and create a partition for windows

-I insalled XP on this new partition, at this time, the machine would only boot into XP for me.

-I then did this "Re-Install GRUB" thing ( with the hd number coming up as hd0,0)

-Now my machine only boots into Ubuntu Studio

i want to have a choice at startup between the two operating systems

how can i fix this??

grub menu looks like this:::

# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not use 'savedefault' or your
# array will desync and will not let you boot your system.
default 0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 3

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
hiddenmenu

# Pretty colours
#color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=77c188a4-a9ef-460e-ac55-8b00c0290d94 ro

## Setup crashdump menu entries
## e.g. crashdump=1
# crashdump=0

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,0)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash

## should update-grub lock old automagic boot options
## e.g. lockold=false
## lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

## ## End Default Options ##

title Ubuntu 8.04, kernel 2.6.24-16-rt
root (hd0,0)
kernel /boot/vmlinuz-2.6.24-16-rt root=UUID=77c188a4-a9ef-460e-ac55-8b00c0290d94 ro quiet splash
initrd /boot/initrd.img-2.6.24-16-rt
quiet

title Ubuntu 8.04, kernel 2.6.24-16-rt (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.24-16-rt root=UUID=77c188a4-a9ef-460e-ac55-8b00c0290d94 ro single
initrd /boot/initrd.img-2.6.24-16-rt

title Ubuntu 8.04, memtest86+
root (hd0,0)
kernel /boot/memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST

meierfra.
June 2nd, 2008, 05:29 PM
TheDriller: You have the exact same problem as grx20jb. See post 361 (the one before yours) for a solution.

TheDriller
June 2nd, 2008, 09:51 PM
TheDriller: You have the exact same problem as grx20jb. See post 361 (the one before yours) for a solution.


i did, still not working

here is my grublist:

# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not use 'savedefault' or your
# array will desync and will not let you boot your system.
default 0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 60

#hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu

# Pretty colours
#color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=77c188a4-a9ef-460e-ac55-8b00c0290d94 ro

## Setup crashdump menu entries
## e.g. crashdump=1
# crashdump=0

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,0)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash

## should update-grub lock old automagic boot options
## e.g. lockold=false
## lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

## ## End Default Options ##

title Ubuntu 8.04, kernel 2.6.24-16-rt
root (hd0,0)
kernel /boot/vmlinuz-2.6.24-16-rt root=UUID=77c188a4-a9ef-460e-ac55-8b00c0290d94 ro quiet splash
initrd /boot/initrd.img-2.6.24-16-rt
quiet

title Windows XP
root (hd0,1)
chainloader +1

title Ubuntu 8.04, kernel 2.6.24-16-rt (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.24-16-rt root=UUID=77c188a4-a9ef-460e-ac55-8b00c0290d94 ro single
initrd /boot/initrd.img-2.6.24-16-rt

title Ubuntu 8.04, memtest86+
root (hd0,0)
kernel /boot/memtest86+.bin
quiet



### END DEBIAN AUTOMAGIC KERNELS LIST

unutbu
June 2nd, 2008, 10:12 PM
TheDriller, please post


sudo fdisk -l
Also, please tell us of any error messages that you see when trying to boot Windows. Can you describe what happens?

talsemgeest
June 3rd, 2008, 02:47 AM
Also would you mind putting your menu.lst in code tags from now on? It is very irritating to have to scroll all the way through it...

meierfra.
June 3rd, 2008, 03:46 AM
TheDriller: In addition to what unutbu said, you need to move

"title Windows XP
root (hd0,1)
chainloader +1"

to the very end of the file, after the line

### END DEBIAN AUTOMAGIC KERNELS LIST

(This won't solve your current booting problem, but otherwise your Windows item will be deleted during the next kernel update)

mapes12
June 3rd, 2008, 04:49 PM
Just wanted to say thanks!

I messed up Grub. Ubuntu failed to start properly. I followed your HOWTO at post #1 Everything works again :)

TheDriller
June 3rd, 2008, 07:56 PM
TheDriller, please post


sudo fdisk -l
Also, please tell us of any error messages that you see when trying to boot Windows. Can you describe what happens?

ok, "sudo fdisk -l" returns this:


Disk /dev/hda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x7dc84fe9

Device Boot Start End Blocks Id System
/dev/hda1 1 4102 32949283+ 83 Linux
/dev/hda2 * 4103 9327 41969812+ 7 HPFS/NTFS
/dev/hda3 9328 9729 3229065 5 Extended
/dev/hda5 9328 9729 3229033+ 82 Linux swap / Solaris



when i select Windows XP it just goes back to the "Loading Grubstage2" screen for a second and then back to the menu i chose XP from, no error messages at all.

my menu.lst currently looks like :



# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not use 'savedefault' or your
# array will desync and will not let you boot your system.
default 0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 60

#hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu

# Pretty colours
#color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=77c188a4-a9ef-460e-ac55-8b00c0290d94 ro

## Setup crashdump menu entries
## e.g. crashdump=1
# crashdump=0

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,0)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash

## should update-grub lock old automagic boot options
## e.g. lockold=false
## lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery) single
# altoptions=(recovery mode) single


## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

## ## End Default Options ##

title Ubuntu 8.04, kernel 2.6.24-16-rt
root (hd0,0)
kernel /boot/vmlinuz-2.6.24-16-rt root=UUID=77c188a4-a9ef-460e-ac55-8b00c0290d94 ro quiet splash
initrd /boot/initrd.img-2.6.24-16-rt
quiet


title Ubuntu 8.04, kernel 2.6.24-16-rt (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.24-16-rt root=UUID=77c188a4-a9ef-460e-ac55-8b00c0290d94 ro single
initrd /boot/initrd.img-2.6.24-16-rt

title Ubuntu 8.04, memtest86+
root (hd0,0)
kernel /boot/memtest86+.bin
quiet



### END DEBIAN AUTOMAGIC KERNELS LIST

title Windows XP
root (hd0,1)
chainloader +1

what really galls me about this is that first i had a fully working Ubuntu, then i partitioned and had a fully working Windows, but not able to boot into Ubuntu, then i re-installed GRUB and now have a working Ubuntu again but not able to boot Windows!!!! :)

unutbu
June 3rd, 2008, 09:29 PM
This is just a guess.

When GRUB tries to boot Windows XP, Windows expects to be on the first partition of your hard drive, and searches for itself on (hd0,0). There it gets confused , unable to find itself, and aborts, sending you back to the GRUB menu.lst.

Try:



title Windows XP
root (hd1,0)
savedefault
makeactive
map (hd0) (hd1)
map (hd1) (hd0)
chainloader +1


This tells GRUB that Windows is on (hd1,0), but before booting, it swaps the meaning of (hd0) and (hd1) in an attempt to placate Windows.

meierfra.
June 3rd, 2008, 09:44 PM
TheDriller: Your menu.lst looks fine, so don't change it.


when i select Windows XP it just goes back to the "Loading Grubstage2" screen for a second and then back to the menu i chose XP from,

this sound like you installed grub to the XP boot sector. Did you use "setup (hd0,1)" or "grub-install /dev/sda2" to reinstall grub?

If you have a WindowsCD, boot from the CD, type "r" to enter the recovery console. Type

fixmbr

fixboot

exit

You should now boot directly into XP, So you need to reinstall Grub one more time:


sudo grub
root (hd0,0)
setup (hd0)
quit

TheDriller
June 3rd, 2008, 09:51 PM
This is just a guess.

When GRUB tries to boot Windows XP, Windows expects to be on the first partition of your hard drive, and searches for itself on (hd0,0). There it gets confused , unable to find itself, and aborts, sending you back to the GRUB menu.lst.

Try:



title Windows XP
root (hd1,0)
savedefault
makeactive
map (hd0) (hd1)
map (hd1) (hd0)
chainloader +1


This tells GRUB that Windows is on (hd1,0), but before booting, it swaps the meaning of (hd0) and (hd1) in an attempt to placate Windows.

nope, this doesn't work,
it returns "Disk I/O error" and then "Operating System Not Found"... or something like that,

thanks anyway.

jw5801
June 4th, 2008, 03:27 AM
This is just a guess.

When GRUB tries to boot Windows XP, Windows expects to be on the first partition of your hard drive, and searches for itself on (hd0,0). There it gets confused , unable to find itself, and aborts, sending you back to the GRUB menu.lst.

Try:



title Windows XP
root (hd1,0)
savedefault
makeactive
map (hd0) (hd1)
map (hd1) (hd0)
chainloader +1


This tells GRUB that Windows is on (hd1,0), but before booting, it swaps the meaning of (hd0) and (hd1) in an attempt to placate Windows.

Well... Windows isn't on (hd1), so that's not really going to help. You just need the makeactive line as well:

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

unutbu
June 4th, 2008, 03:39 AM
Oops. What a fiasco on my part. Sorry.

meierfra.
June 4th, 2008, 03:41 AM
Well... Windows isn't on (hd1), so that's not really going to help. You just need the makeactive line as well:

"makeactive" will not help either. The XP partition already has a boot flag (and the boot flag isn't even needed for booting)

jw5801
June 4th, 2008, 09:16 AM
"makeactive" will not help either. The XP partition already has a boot flag (and the boot flag isn't even needed for booting)

Ah, ok. In that case, yes it very much does sound like you've overwritten the Windows MBR on (hd0,1), so you'll need to restore that as suggested earlier.

bartos
June 4th, 2008, 06:44 PM
Is there a command or gui way to list how the hard drives are seen so they show up as (0,0) XP or (1,0) Ubuntu? Wouls make it easier to add to grub.

Thanks

P.S. If I missed the post ,just redirect me.

unutbu
June 4th, 2008, 07:42 PM
[Edit: After a conversation with meierfra in posts #406--408 I have learned that the method below is more complicated than necessary. The bottom line is that the GRUB partition number y in (hdx,y) is always one less than the device number as reported by "sudo fdisk -l". So if a partition is called /dev/sda3 by fdisk, then the partition is called (hd0,2) by GRUB. Simple!]

Here is an example of how to find the pair of numbers (x,y) which map (hdx,y) to a particular partition:



% sudo fdisk -l
Disk /dev/sda: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x48000000

Device Boot Start End Blocks Id System
/dev/sda1 1 7 56196 de Dell Utility
/dev/sda2 8 660 5245222+ b W95 FAT32
/dev/sda3 * 661 38536 304238970 83 Linux
/dev/sda4 38537 38913 3028252+ 5 Extended
/dev/sda5 38537 38913 3028221 82 Linux swap / Solaris


% sudo grub
grub> geometry (hd0,<TAB>
Possible partitions are:
Partition num: 0, Filesystem type unknown, partition type 0xde
Partition num: 1, Filesystem type is fat, partition type 0xb
Partition num: 2, Filesystem type is ext2fs, partition type 0x83
Partition num: 4, Filesystem type unknown, partition type 0x82

Now use backspace to erase what you've typed and quit GRUB:

grub> quit

By matching up the partition ids and types (highlighted in blue) in the output of fdisk and grub's geometry command, you can then read off the partition numbers (highlighted in red above).

So in the above example,

/dev/sda1 <--> (hd0,0)
/dev/sda2 <--> (hd0,1)
/dev/sda3 <--> (hd0,2)
/dev/sda4 <--> (hd0,3)
/dev/sda5 <--> (hd0,4)

Notice that the GRUB number for the partition is usually one less than the device number. For example, (hd0,4) is the same as /dev/sda5, and 4 is one less than 5. This pattern usually holds, but I am unwilling to declare that it is always true, so if in doubt, the above method will settle all questions.

TheDriller
June 4th, 2008, 10:33 PM
TheDriller: Your menu.lst looks fine, so don't change it.



this sound like you installed grub to the XP boot sector. Did you use "setup (hd0,1)" or "grub-install /dev/sda2" to reinstall grub?

If you have a WindowsCD, boot from the CD, type "r" to enter the recovery console. Type

fixmbr

fixboot

exit

You should now boot directly into XP, So you need to reinstall Grub one more time:


sudo grub
root (hd0,0)
setup (hd0)
quit

This worked!!!!!!!!!!
Yay!

You Win!!!:lolflag:

talsemgeest
June 5th, 2008, 05:04 AM
Here is an example of how to find the pair of numbers (x,y) which map (hdx,y) to a particular partition:



% sudo fdisk -l
Disk /dev/sda: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x48000000

Device Boot Start End Blocks Id System
/dev/sda1 1 7 56196 de Dell Utility
/dev/sda2 8 660 5245222+ b W95 FAT32
/dev/sda3 * 661 38536 304238970 83 Linux
/dev/sda4 38537 38913 3028252+ 5 Extended
/dev/sda5 38537 38913 3028221 82 Linux swap / Solaris


% sudo grub
grub> geometry (hd0,<TAB>
Possible partitions are:
Partition num: 0, Filesystem type unknown, partition type 0xde
Partition num: 1, Filesystem type is fat, partition type 0xb
Partition num: 2, Filesystem type is ext2fs, partition type 0x83
Partition num: 4, Filesystem type unknown, partition type 0x82Now use backspace to erase what you've typed and quit GRUB:

grub> quitBy matching up the filesystem ids and types (highlighted in blue) in the output of fdisk and grub's geometry command, you can then read off the partition numbers (highlighted in red above).

So in the above example,

/dev/sda1 <--> (hd0,0)
/dev/sda2 <--> (hd0,1)
/dev/sda3 <--> (hd0,2)
/dev/sda4 has no number because it is an extended partition -- a container for other partitions.
/dev/sda5 <--> (hd0,4)Notice that the GRUB number for the partition is usually one less than the device number. For example , (hd0,4) is the same as /dev/sda5, and 4 is one less than 5. This pattern usually holds, but I am unwilling to declare that it is always true, so if in doubt, the above method will settle all questions.That is brilliant. Thanks for that post.

Sec Expert
June 7th, 2008, 05:15 AM
hello,
I have dual boot:Win XP and Ubuntu but now I have just faced a strange problem,when I click on XP I get this message:error 23: error while parsing number.I don't know what I have done.please help me.I do not know how to install grub again:confused::lolflag:

jw5801
June 7th, 2008, 10:55 AM
hello,
I have dual boot:Win XP and Ubuntu but now I have just faced a strange problem,when I click on XP I get this message:error 23: error while parsing number.I don't know what I have done.please help me.I do not know how to install grub again:confused::lolflag:

Can you boot into Ubuntu? Please post the output from:

sudo fdisk -l
cat /boot/grub/menu.lst

ACR1221
June 8th, 2008, 06:39 AM
Hi,

I am using just using 7.10 on a 200gb hd.

I was just using vlc to listen to music and the program froze on me and the system locked up so, I rebooted and it froze up on me. I turned off the computer and turned it back on and Grub error 17 was given so I booted my live cd and ran fsck and fixed all the errors and when I restarted I was given grub error 15. So after some googleing and searching this forum I found this thread. I tried to reinstall the grub but it gives me the same error 15.
So.

ubuntu@ubuntu:~$ sudo fdisk -l
Disk /dev/hda: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xb92d6277

Device Boot Start End Blocks Id System
/dev/hda1 * 1 23754 190803973+ 83 Linux
/dev/hda2 23755 24321 4554427+ 5 Extended
/dev/hda5 23755 24321 4554396 82 Linux swap / Solaris

"
grub> find /boot/grub/stage1

Error 15: File not foundgrub> root (hd0,0)

grub> setup (hd0)
Checking if "/boot/grub/stage1" exists... no
Checking if "/grub/stage1" exists... no

Error 15: File not found
"

so I tried the other instructions
"
ubuntu@ubuntu:~$ sudo mkdir /mnt/root
ubuntu@ubuntu:~$ sudo mount -t ext3 /dev/hda1 /mnt/root
ubuntu@ubuntu:~$ sudo mount -t proc none /mnt/root/proc
mount: mount point /mnt/root/proc does not exist
"
Any help would be great. I'm stumped.

unutbu
June 8th, 2008, 12:52 PM
According to http://www.gnu.org/software/grub/manual/grub.html#Troubleshooting
Error 15 means:


15 : File not found
This error is returned if the specified file name cannot be found, but everything else (like the disk/partition info) is OK.

So let's see if we can find the files manually. Boot the LiveCD.

sudo mkdir /mnt/root
sudo mount -t ext3 /dev/hda1 /mnt/root
cd /mnt/root/boot

If the last command fails, post

ls -l /mnt/root
otherwise, type

cd /mnt/root/boot/grub
If this command fails, post

ls -l /mnt/root/boot
otherwise, type and post the output of

ls -l /mnt/root/boot/grub
cat /mnt/root/boot/grub/menu.lst

By the way, next time your machine freezes, instead of doing a hard reboot, try this sequence of keypresses instead:


Alt-SysRq-R turns off keyboard raw mode and sets it to XLATE
Alt-SysRq-E send a SIGTERM to all processes, except for init.
Alt-SysRq-I send a SIGKILL to all processes, except for init.
Alt-SysRq-S attempt to sync all mounted filesystems.
Alt-SysRq-U attempt to remount all mounted filesystems read-only.
Alt-SysRq-B immediately reboot the system without syncing or unmounting

Wait a few seconds (5--10?) between each key combination, to give the machine time to terminate processes, sync filesystems, etc. Rebooting this way may save you from having this problem in the future.

ACR1221
June 8th, 2008, 01:55 PM
This is what it returned.

ubuntu@ubuntu:~$ sudo mkdir /mnt/root
ubuntu@ubuntu:~$ sudo mount -t ext3 /dev/hda1 /mnt/root
ubuntu@ubuntu:~$ cd /mnt/root/boot
bash: cd: /mnt/root/boot: No such file or directory
ubuntu@ubuntu:~$ ls -l /mnt/root
total 20
drwx------ 178 root root 20480 2008-06-08 03:32 lost+found
ubuntu@ubuntu:~$ cd /mnt/root/boot/grub
bash: cd: /mnt/root/boot/grub: No such file or directory
ubuntu@ubuntu:~$ ls -l /mnt/root/boot
ls: /mnt/root/boot: No such file or directory
ubuntu@ubuntu:~$ ls -l /mnt/root/boot/grub
ls: /mnt/root/boot/grub: No such file or directory
ubuntu@ubuntu:~$ cat /mnt/root/boot/grub/menu.lst
cat: /mnt/root/boot/grub/menu.lst: No such file or directory

Thanks for the tip on how to reboot. I tried to force quit the application and switch to terminal but it didn't.

unutbu
June 8th, 2008, 03:20 PM
I'm sorry to say, this may be a very serious problem:


ubuntu@ubuntu:~$ ls -l /mnt/root
total 20
drwx------ 178 root root 20480 2008-06-08 03:32 lost+found
I think it means fsck was not able to recover the majority of your filesystem.

If you


cd /mnt/root/lost+found
ls -la

what do you see?

Also, please post


dumpe2fs /dev/hda1 | grep -i superblock

ACR1221
June 8th, 2008, 04:39 PM
ubuntu@ubuntu:~$ cd /mnt/root/lost+found
bash: cd: /mnt/root/lost+found: Permission denied
ubuntu@ubuntu:~$ ls -la
total 44
drwxr-xr-x 21 ubuntu ubuntu 760 2008-06-08 13:20 .
drwxr-xr-x 3 root root 60 2008-06-08 08:40 ..
-rw------- 1 ubuntu ubuntu 256 2008-06-08 13:20 .bash_history
-rw-r--r-- 1 ubuntu ubuntu 220 2008-06-08 08:40 .bash_logout
-rw-r--r-- 1 ubuntu ubuntu 2298 2008-06-08 08:40 .bashrc
drwxr-xr-x 3 ubuntu ubuntu 120 2008-06-08 12:39 .config
drwxr-xr-x 2 ubuntu ubuntu 100 2008-06-08 08:40 Desktop
-rw------- 1 ubuntu ubuntu 2 2008-06-08 08:41 .dmrc
drwxr-xr-x 2 ubuntu ubuntu 60 2008-06-08 08:41 Documents
-rw------- 1 ubuntu ubuntu 16 2008-06-08 12:39 .esd_auth
drwxr-xr-x 2 ubuntu ubuntu 340 2008-06-08 12:39 .fontconfig
drwx------ 4 ubuntu ubuntu 120 2008-06-08 12:38 .gconf
drwx------ 2 ubuntu ubuntu 100 2008-06-08 13:54 .gconfd
drwxr-xr-x 3 ubuntu ubuntu 80 2008-06-08 12:39 .gnome
drwx------ 7 ubuntu ubuntu 160 2008-06-08 12:39 .gnome2
drwx------ 2 ubuntu ubuntu 60 2008-06-08 12:38 .gnome2_private
drwxr-xr-x 2 ubuntu ubuntu 80 2008-06-08 12:39 .gstreamer-0.10
-rw-r--r-- 1 ubuntu ubuntu 112 2008-06-08 12:39 .gtk-bookmarks
-rw-r--r-- 1 ubuntu ubuntu 88 2008-06-08 12:38 .gtkrc-1.2-gnome2
-rw------- 1 ubuntu ubuntu 159 2008-06-08 12:38 .ICEauthority
drwx------ 3 ubuntu ubuntu 80 2008-06-08 12:42 .mozilla
drwxr-xr-x 2 ubuntu ubuntu 60 2008-06-08 08:41 Music
drwxr-xr-x 3 ubuntu ubuntu 80 2008-06-08 12:39 .nautilus
drwxr-xr-x 2 ubuntu ubuntu 60 2008-06-08 08:41 Pictures
-rw-r--r-- 1 ubuntu ubuntu 566 2008-06-08 08:40 .profile
drwxr-xr-x 2 ubuntu ubuntu 60 2008-06-08 08:41 Public
-rw-r--r-- 1 ubuntu ubuntu 0 2008-06-08 12:44 .sudo_as_admin_successful
drwxr-xr-x 2 ubuntu ubuntu 60 2008-06-08 08:41 Templates
drwx------ 2 ubuntu ubuntu 60 2008-06-08 12:39 .Trash
drwx------ 2 ubuntu ubuntu 60 2008-06-08 12:39 .update-notifier
drwxr-xr-x 2 ubuntu ubuntu 60 2008-06-08 08:41 Videos
-rw------- 1 ubuntu ubuntu 117 2008-06-08 08:41 .Xauthority
-rw-r--r-- 1 ubuntu ubuntu 2544 2008-06-08 13:54 .xsession-errors


ubuntu@ubuntu:~$ dumpe2fs /dev/hda1 | grep -i superblock
dumpe2fs 1.40.2 (12-Jul-2007)
dumpe2fs: Permission denied while trying to open /dev/hda1
Couldn't find valid filesystem superblock.


ubuntu@ubuntu:~$ sudo dumpe2fs /dev/hda1 | grep -i superblock
dumpe2fs 1.40.2 (12-Jul-2007)
Primary superblock at 0, Group descriptors at 1-12
Backup superblock at 32768, Group descriptors at 32769-32780
Backup superblock at 98304, Group descriptors at 98305-98316
Backup superblock at 163840, Group descriptors at 163841-163852
Backup superblock at 229376, Group descriptors at 229377-229388
Backup superblock at 294912, Group descriptors at 294913-294924
Backup superblock at 819200, Group descriptors at 819201-819212
Backup superblock at 884736, Group descriptors at 884737-884748
Backup superblock at 1605632, Group descriptors at 1605633-1605644
Backup superblock at 2654208, Group descriptors at 2654209-2654220
Backup superblock at 4096000, Group descriptors at 4096001-4096012
Backup superblock at 7962624, Group descriptors at 7962625-7962636
Backup superblock at 11239424, Group descriptors at 11239425-11239436
Backup superblock at 20480000, Group descriptors at 20480001-20480012
Backup superblock at 23887872, Group descriptors at 23887873-23887884

unutbu
June 8th, 2008, 05:03 PM
Try


sudo -s
cd /mnt/root/lost+found
ls -la
The above will show us what fsck has been able to recover.

ACR1221
June 8th, 2008, 05:13 PM
There is a lot of red at the beginning and some at the end with some green and blue mixed in. Is there anything specific i should look for.


lrwxrwxrwx 1 root root 17 2007-11-10 20:48 #3801657 -> /usr/bin/vim.tiny
lrwxrwxrwx 1 root root 23 2007-11-10 20:48 #3801658 -> /usr/bin/gserialver-4.2
lrwxrwxrwx 1 root root 39 2007-11-10 20:48 #3801659 -> /usr/share/man/man1/gserialver-4.2.1.gz
lrwxrwxrwx 1 root root 14 2008-04-30 15:24 #3801660 -> /usr/bin/opera
lrwxrwxrwx 1 root root 22 2007-11-10 20:48 #3801662 -> /usr/bin/telnet.netkit
lrwxrwxrwx 1 root root 38 2007-11-10 20:48 #3801663 -> /usr/share/man/man1/telnet.netkit.1.gz
lrwxrwxrwx 1 root root 28 2007-11-10 20:48 #3801664 -> /usr/bin/traceroute6.iputils
lrwxrwxrwx 1 root root 44 2007-11-10 20:48 #3801665 -> /usr/share/man/man8/traceroute6.iputils.8.gz
lrwxrwxrwx 1 root root 40 2007-11-10 20:48 #3801666 -> /usr/lib/usplash/usplash-theme-ubuntu.so
lrwxrwxrwx 1 root root 17 2007-11-10 20:48 #3801667 -> /usr/bin/vim.tiny
lrwxrwxrwx 1 root root 28 2007-11-10 20:48 #3801668 -> /usr/share/man/man1/vim.1.gz
lrwxrwxrwx 1 root root 31 2007-11-10 20:48 #3801669 -> /usr/share/man/fr/man1/vim.1.gz
lrwxrwxrwx 1 root root 41 2007-11-10 20:48 #3801670 -> /usr/share/man/fr.ISO8859-1/man1/vim.1.gz
lrwxrwxrwx 1 root root 37 2007-11-10 20:48 #3801671 -> /usr/share/man/fr.UTF-8/man1/vim.1.gz
lrwxrwxrwx 1 root root 31 2007-11-10 20:48 #3801672 -> /usr/share/man/it/man1/vim.1.gz
lrwxrwxrwx 1 root root 41 2007-11-10 20:48 #3801673 -> /usr/share/man/it.ISO8859-1/man1/vim.1.gz
lrwxrwxrwx 1 root root 37 2007-11-10 20:48 #3801674 -> /usr/share/man/it.UTF-8/man1/vim.1.gz
lrwxrwxrwx 1 root root 31 2007-11-10 20:48 #3801675 -> /usr/share/man/pl/man1/vim.1.gz
lrwxrwxrwx 1 root root 41 2007-11-10 20:48 #3801676 -> /usr/share/man/pl.ISO8859-2/man1/vim.1.gz
lrwxrwxrwx 1 root root 37 2007-11-10 20:48 #3801677 -> /usr/share/man/pl.UTF-8/man1/vim.1.gz
lrwxrwxrwx 1 root root 31 2007-11-10 20:48 #3801678 -> /usr/share/man/ru/man1/vim.1.gz
lrwxrwxrwx 1 root root 17 2007-11-10 20:48 #3801679 -> /usr/bin/vim.tiny
lrwxrwxrwx 1 root root 28 2007-11-10 20:48 #3801680 -> /usr/share/man/man1/vim.1.gz
lrwxrwxrwx 1 root root 31 2007-11-10 20:48 #3801681 -> /usr/share/man/fr/man1/vim.1.gz
lrwxrwxrwx 1 root root 41 2007-11-10 20:48 #3801682 -> /usr/share/man/fr.ISO8859-1/man1/vim.1.gz
lrwxrwxrwx 1 root root 37 2007-11-10 20:48 #3801683 -> /usr/share/man/fr.UTF-8/man1/vim.1.gz
lrwxrwxrwx 1 root root 31 2007-11-10 20:48 #3801684 -> /usr/share/man/it/man1/vim.1.gz
lrwxrwxrwx 1 root root 41 2007-11-10 20:48 #3801685 -> /usr/share/man/it.ISO8859-1/man1/vim.1.gz
lrwxrwxrwx 1 root root 37 2007-11-10 20:48 #3801686 -> /usr/share/man/it.UTF-8/man1/vim.1.gz
lrwxrwxrwx 1 root root 31 2007-11-10 20:48 #3801687 -> /usr/share/man/pl/man1/vim.1.gz
lrwxrwxrwx 1 root root 41 2007-11-10 20:48 #3801688 -> /usr/share/man/pl.ISO8859-2/man1/vim.1.gz
lrwxrwxrwx 1 root root 37 2007-11-10 20:48 #3801689 -> /usr/share/man/pl.UTF-8/man1/vim.1.gz
lrwxrwxrwx 1 root root 31 2007-11-10 20:48 #3801690 -> /usr/share/man/ru/man1/vim.1.gz
lrwxrwxrwx 1 root root 17 2007-11-10 20:48 #3801691 -> /usr/bin/vim.tiny
lrwxrwxrwx 1 root root 17 2007-11-10 20:48 #3801692 -> /usr/bin/vim.tiny
lrwxrwxrwx 1 root root 20 2007-11-10 20:48 #3801693 -> /usr/bin/xvnc4viewer
lrwxrwxrwx 1 root root 36 2007-11-10 20:48 #3801694 -> /usr/share/man/man1/xvnc4viewer.1.gz
lrwxrwxrwx 1 root root 17 2007-11-10 20:48 #3801695 -> /usr/bin/w.procps
lrwxrwxrwx 1 root root 33 2007-11-10 20:48 #3801696 -> /usr/share/man/man1/w.procps.1.gz
lrwxrwxrwx 1 root root 18 2007-11-10 20:48 #3801697 -> /usr/bin/bsd-write
lrwxrwxrwx 1 root root 34 2007-11-10 20:48 #3801698 -> /usr/share/man/man1/bsd-write.1.gz
lrwxrwxrwx 1 root root 12 2007-11-10 20:48 #3801699 -> /usr/bin/w3m
lrwxrwxrwx 1 root root 28 2007-11-10 20:48 #3801700 -> /usr/share/man/man1/w3m.1.gz
lrwxrwxrwx 1 root root 39 2007-11-10 20:48 #3801701 -> /usr/share/icons/DMZ-White/cursor.theme
lrwxrwxrwx 1 root root 38 2007-11-16 15:00 #3801702 -> /usr/share/man/man1/gnome-session.1.gz
-rw-r--r-- 1 root root 15 2007-10-04 20:57 #3801703
lrwxrwxrwx 1 root root 31 2007-11-10 20:48 #3801704 -> /usr/bin/gnome-terminal.wrapper
lrwxrwxrwx 1 root root 39 2007-11-10 20:48 #3801705 -> /usr/share/man/man1/gnome-terminal.1.gz
lrwxrwxrwx 1 root root 17 2007-11-10 20:48 #3801706 -> /usr/bin/metacity
lrwxrwxrwx 1 root root 33 2007-11-10 20:48 #3801707 -> /usr/share/man/man1/metacity.1.gz
lrwxrwxrwx 1 root root 46 2008-04-10 18:10 #3801708 -> /usr/lib/flashplugin-nonfree/libflashplayer.so
lrwxrwxrwx 1 root root 13 2007-12-05 14:13 #3801709 -> /usr/bin/mono
lrwxrwxrwx 1 root root 28 2007-11-10 20:48 #3801710 -> /etc/X11/xinit/xinput.d/scim
lrwxrwxrwx 1 root root 28 2007-11-10 20:48 #3801711 -> /etc/X11/xinit/xinput.d/scim
lrwxrwxrwx 1 root root 28 2007-11-10 20:48 #3801712 -> /etc/X11/xinit/xinput.d/scim
lrwxrwxrwx 1 root root 28 2007-11-10 20:48 #3801713 -> /etc/X11/xinit/xinput.d/scim
lrwxrwxrwx 1 root root 28 2007-11-10 20:48 #3801714 -> /etc/X11/xinit/xinput.d/scim
lrwxrwxrwx 1 root root 28 2007-11-10 20:48 #3801715 -> /etc/X11/xinit/xinput.d/scim
lrwxrwxrwx 1 root root 28 2007-11-10 20:48 #3801716 -> /etc/X11/xinit/xinput.d/scim
lrwxrwxrwx 1 root root 20 2007-11-10 20:48 #3801717 -> /usr/bin/xvnc4viewer
lrwxrwxrwx 1 root root 36 2007-11-10 20:48 #3801718 -> /usr/share/man/man1/xvnc4viewer.1.gz
drwxr-xr-x 2 root root 4096 2007-10-15 23:28 #3801719
drwxr-xr-x 2 root root 4096 2007-05-23 12:59 #3801720
drwxr-xr-x 2 root root 4096 2007-10-15 23:28 #3801721
drwxr-xr-x 2 root root 4096 2007-10-15 23:28 #3801722
drwxr-xr-x 2 root root 4096 2007-10-15 23:28 #3801723
-rwxr-xr-x 1 root root 3849 2007-05-23 12:59 #3801724
lrwxrwxrwx 1 root root 19 2007-11-10 20:49 #3801735 -> libenchant.so.1.3.0
-rw-r--r-- 1 root root 23356 2007-05-23 17:12 #3801736
lrwxrwxrwx 1 root root 16 2007-11-10 20:49 #3801737 -> libesd.so.0.2.38
-rw-r--r-- 1 root root 41000 2007-10-05 13:33 #3801738
lrwxrwxrwx 1 root root 19 2007-11-10 20:49 #3801739 -> libespeak.so.1.1.29
-rw-r--r-- 1 root root 173700 2007-10-14 08:07 #3801740
lrwxrwxrwx 1 root root 28 2007-11-16 14:59 #3801741 -> libgnome-desktop-2.so.2.3.14
-rw-r--r-- 1 root root 792 2008-03-07 04:35 #3801742
lrwxrwxrwx 1 root root 17 2007-11-10 20:49 #3801743 -> libexif.so.12.2.0
-rw-r--r-- 1 root root 165848 2007-06-22 10:54 #3801744
lrwxrwxrwx 1 root root 13 2007-11-10 20:49 #3801745 -> libexpat.so.1
lrwxrwxrwx 1 root root 17 2007-11-10 20:49 #3801746 -> libexpat.so.1.0.0
-rw-r--r-- 1 root root 130364 2007-09-24 14:38 #3801747
lrwxrwxrwx 1 root root 18 2007-11-10 20:49 #3801748 -> libexslt.so.0.8.13
-rw-r--r-- 1 root root 65292 2007-08-09 14:45 #3801749
lrwxrwxrwx 1 root root 15 2007-11-10 20:49 #3801750 -> libfam.so.0.0.0
-rw-r--r-- 1 root root 27844 2007-05-25 11:54 #3801751
lrwxrwxrwx 1 root root 22 2007-11-10 20:49 #3801752 -> libfontconfig.so.1.2.0
-rw-r--r-- 1 root root 176144 2007-10-05 17:13 #3801753
lrwxrwxrwx 1 root root 19 2007-11-10 20:49 #3801754 -> libfontenc.so.1.0.0
-rw-r--r-- 1 root root 20116 2007-04-27 16:35 #3801755
lrwxrwxrwx 1 root root 14 2007-11-10 20:49 #3801756 -> libform.so.5.6
-rw-r--r-- 1 root root 48536 2007-10-08 10:07 #3801757
lrwxrwxrwx 1 root root 15 2007-11-10 20:49 #3801758 -> libformw.so.5.6
-rw-r--r-- 1 root root 52728 2007-10-08 10:07 #3801759
lrwxrwxrwx 1 root root 21 2007-11-10 20:49 #3801760 -> libfreetype.so.6.3.16
-rw-r--r-- 1 root root 573 2007-10-14 09:49 #3801761
-rw-r--r-- 1 root root 220 2007-10-14 09:49 #3801762
-rw-r--r-- 1 root root 93 2007-10-14 09:49 #3801763
-rw-r--r-- 1 root root 707 2007-10-14 09:49 #3801764
-rw-r--r-- 1 root root 866 2007-10-14 09:49 #3801765
-rw-r--r-- 1 root root 1156 2007-10-14 09:49 #3801766
-rw-r--r-- 1 root root 1314 2007-10-14 09:49 #3801767
-rw-r--r-- 1 root root 167 2007-10-14 09:49 #3801768
-rw-r--r-- 1 root root 493 2007-10-14 09:49 #3801769
-rw-r--r-- 1 root root 1704 2007-10-14 09:49 #3801770
-rw-r--r-- 1 root root 753 2007-10-14 09:49 #3801771
-rw-r--r-- 1 root root 834 2007-10-14 09:49 #3801772
-rw-r--r-- 1 root root 882 2007-10-14 09:49 #3801773
-rw-r--r-- 1 root root 621 2007-10-14 09:49 #3801774
-rw-r--r-- 1 root root 653 2007-10-14 09:49 #3801775
-rw-r--r-- 1 root root 123 2007-10-14 09:49 #3801776
-rw-r--r-- 1 root root 678 2007-10-14 09:49 #3801777
-rw-r--r-- 1 root root 656 2007-10-14 09:49 #3801778
-rw-r--r-- 1 root root 595 2007-10-14 09:49 #3801779
-rw-r--r-- 1 root root 745 2007-10-14 09:49 #3801780
-rw-r--r-- 1 root root 579 2007-10-14 09:49 #3801781
-rw-r--r-- 1 root root 875 2007-10-14 09:49 #3801782
-rw-r--r-- 1 root root 491 2007-10-14 09:49 #3801783
drwxr-xr-x 2 root root 4096 2007-10-15 23:28 #3801784
-rw-r--r-- 1 root root 623 2007-07-14 14:59 #3801785
drwxr-xr-x 2 root root 4096 2008-04-30 15:23 #3801788
drwxr-xr-x 2 root root 4096 2008-02-28 21:04 #3801789
lrwxrwxrwx 1 root root 38 2007-11-13 13:54 #3801791 -> /usr/bin/btlaunchmanycurses.bittorrent
-rw------- 1 root root 1200 2007-11-11 02:32 #3801792
-rw-r--r-- 1 root root 3050 2007-11-11 02:32 #3801793
drwxr-xr-x 2 root root 4096 2007-10-04 15:03 #3801803
-rwxr-xr-x 1 root root 2335 2007-10-04 15:03 #3801804
-rw-r--r-- 1 root root 1612 2007-10-04 15:03 #3801805
-rw-r--r-- 1 root root 1172 2007-10-04 15:03 #3801806
-rw-r--r-- 1 root root 293 2007-10-01 12:08 #3801807
-rw-r--r-- 1 root root 5126 2007-10-15 17:13 #3801808
-rw-r--r-- 1 root root 1051 2007-10-04 19:57 #3801809
-rw-r--r-- 1 root root 23221 2006-08-04 10:47 #3801810
-rw-r--r-- 1 root root 1437 2007-09-16 12:41 #3801811
-rw-r--r-- 1 root root 107 2007-10-03 08:55 #3801812
-rw-r--r-- 1 root root 1243 2007-10-03 08:55 #3801813
-rw-r--r-- 1 root root 117 2007-10-03 08:55 #3801814
-rw-r--r-- 1 root root 128 2007-10-03 08:55 #3801815
-rw-r--r-- 1 root root 297 2007-10-03 08:55 #3801816
-rw-r--r-- 1 root root 116 2007-10-03 08:55 #3801817
-rw-r--r-- 1 root root 351 2007-09-17 19:53 #3801818
-rw-r--r-- 1 root root 4389 2007-05-18 15:48 #3801819
-rw-r--r-- 1 root root 877 2007-05-18 15:48 #3801820
-rw-r--r-- 1 root root 877 2007-05-18 15:48 #3801821
-rw-r--r-- 1 root root 407503 2007-05-18 15:48 #3801822
-rw-r--r-- 1 root root 5439 2007-05-18 15:48 #3801823
-rw-r--r-- 1 root root 1793 2007-05-18 15:48 #3801824
-rw-r--r-- 1 root root 77 2007-05-18 15:48 #3801825
-rw-r--r-- 1 root root 320 2007-05-18 15:48 #3801826
-rw-r--r-- 1 root root 6309 2007-05-18 15:48 #3801827
-rw-r--r-- 1 root root 2306 2007-05-18 15:48 #3801828
-rw-r--r-- 1 root root 12747 2007-05-18 15:48 #3801829
-rw-r--r-- 1 root root 1304 2007-05-18 15:48 #3801830
-rw-r--r-- 1 root root 1832 2007-05-18 15:48 #3801831
-rw-r--r-- 1 root root 1261 2007-05-18 15:48 #3801832
-rw-r--r-- 1 root root 3353 2007-05-18 15:48 #3801833
-rw-r--r-- 1 root root 13754 2007-05-18 15:48 #3801834
-rw-r--r-- 1 root root 862 2007-05-18 15:48 #3801835
-rw-r--r-- 1 root root 1626 2007-05-18 15:48 #3801836
-rw-r--r-- 1 root root 1510 2007-05-18 15:48 #3801837
-rw-r--r-- 1 root root 1325 2007-05-18 15:48 #3801838
-rw-r--r-- 1 root root 4431 2007-05-18 15:48 #3801839
-rw-r--r-- 1 root root 8276 2007-05-18 15:48 #3801840
-rw-r--r-- 1 root root 2133 2007-05-18 15:48 #3801841
-rw-r--r-- 1 root root 2136 2007-05-18 15:48 #3801842
-rw-r--r-- 1 root root 48416 2007-05-18 15:48 #3801843
-rw-r--r-- 1 root root 48416 2007-05-18 15:48 #3801844
-rw-r--r-- 1 root root 50029 2007-05-18 15:48 #3801845
-rw-r--r-- 1 root root 46072 2007-05-18 15:48 #3801846
-rw-r--r-- 1 root root 53060 2007-05-18 15:48 #3801847
-rw-r--r-- 1 root root 53060 2007-05-18 15:48 #3801848
-rw-r--r-- 1 root root 46538 2007-05-18 15:48 #3801849
-rw-r--r-- 1 root root 53534 2007-05-18 15:48 #3801850
-rw-r--r-- 1 root root 53060 2007-05-18 15:48 #3801851
-rw-r--r-- 1 root root 46072 2007-05-18 15:48 #3801852
-rw-r--r-- 1 root root 46072 2007-05-18 15:48 #3801853
-rw-r--r-- 1 root root 2850 2007-05-18 15:48 #3801854
-rw-r--r-- 1 root root 564811 2007-05-18 15:48 #3801855
-rw-r--r-- 1 root root 6 2007-05-18 15:48 #3801856
-rw-r--r-- 1 root root 1503 2007-05-18 15:48 #3801857
-rw-r--r-- 1 root root 14224 2007-05-18 15:48 #3801858
-rw-r--r-- 1 root root 730 2007-05-18 15:48 #3801859
-rw-r--r-- 1 root root 766 2007-05-18 15:48 #3801860
-rw-r--r-- 1 root root 6898 2007-05-18 15:48 #3801861
-rw-r--r-- 1 root root 51 2007-05-18 15:48 #3801862
-rw-r--r-- 1 root root 424 2007-05-18 15:48 #3801863
-rw-r--r-- 1 root root 45 2007-05-18 15:48 #3801864
-rw-r--r-- 1 root root 957 2007-05-18 15:48 #3801865
-rw-r--r-- 1 root root 6454 2007-05-18 15:48 #3801866
-rw-r--r-- 1 root root 24489 2007-05-18 15:48 #3801867
-rw-r--r-- 1 root root 48640 2007-05-18 15:48 #3801868
-rw-r--r-- 1 root root 4824 2007-05-18 15:48 #3801869
-rw-r--r-- 1 root root 2240 2007-05-18 15:48 #3801870
-rw-r--r-- 1 root root 11372 2007-05-18 15:48 #3801871
-rw-r--r-- 1 root root 11468 2007-05-18 15:48 #3801872
-rw-r--r-- 1 root root 11315 2007-05-18 15:48 #3801873
-rw-r--r-- 1 root root 11308 2007-05-18 15:48 #3801874
-rw-r--r-- 1 root root 11088 2007-05-18 15:48 #3801875
-rw-r--r-- 1 root root 11088 2007-05-18 15:48 #3801876
-rw-r--r-- 1 root root 11164 2007-05-18 15:48 #3801877
-rw-r--r-- 1 root root 11182 2007-05-18 15:48 #3801878
-rw-r--r-- 1 root root 11125 2007-05-18 15:48 #3801879
-rw-r--r-- 1 root root 11084 2007-05-18 15:48 #3801880
-rw-r--r-- 1 root root 11186 2007-05-18 15:48 #3801881
-rw-r--r-- 1 root root 863 2007-05-18 15:48 #3801882
-rw-r--r-- 1 root root 11089 2007-05-18 15:48 #3801883
-rw-r--r-- 1 root root 20152 2007-05-18 15:48 #3801884
-rw-r--r-- 1 root root 11102 2007-05-18 15:48 #3801885
-rw-r--r-- 1 root root 11091 2007-05-18 15:48 #3801886
-rw-r--r-- 1 root root 11373 2007-05-18 15:48 #3801887
-rw-r--r-- 1 root root 13222 2007-05-18 15:48 #3801888
-rw-r--r-- 1 root root 11092 2007-05-18 15:48 #3801889
-rw-r--r-- 1 root root 8269 2007-05-18 15:48 #3801890
-rw-r--r-- 1 root root 11081 2007-05-18 15:48 #3801891
-rw-r--r-- 1 root root 11104 2007-05-18 15:48 #3801892
-rw-r--r-- 1 root root 11098 2007-05-18 15:48 #3801893
-rw-r--r-- 1 root root 11391 2007-05-18 15:48 #3801894
-rw-r--r-- 1 root root 11092 2007-05-18 15:48 #3801895
-rw-r--r-- 1 root root 612 2007-05-15 09:47 #3801896
-rw-r--r-- 1 root root 653 2007-10-04 19:57 #3801897
-rw-r----- 1 root dip 656 2007-10-15 23:28 #3801898
-rw-r--r-- 1 root root 147 2007-10-02 17:14 #3801899
-rw-r--r-- 1 root root 4043 2007-10-15 23:18 #3801900
-rw-r--r-- 1 root root 3069 2007-11-10 20:56 #3801901
-rw-r--r-- 1 root root 34 2007-09-24 14:49 #3801902
-rw-r--r-- 1 root root 31 2007-09-24 14:49 #3801903
-rw-r--r-- 1 root root 31 2007-09-24 14:49 #3801904
-rw-r--r-- 1 root root 31 2007-09-24 14:49 #3801905
-rw-r--r-- 1 root root 41 2007-09-24 14:49 #3801906
-rw-r--r-- 1 root root 36 2007-09-24 14:49 #3801907
-rw-r--r-- 1 root root 32 2007-09-24 14:49 #3801908
-rw-r--r-- 1 root root 35 2007-09-24 14:49 #3801909
-rw-r--r-- 1 root root 4308 2007-09-24 14:49 #3801910
-rw-r--r-- 1 root root 36 2007-09-24 14:49 #3801911
-rw-r--r-- 1 root root 36 2007-09-24 14:49 #3801912
-rw-r--r-- 1 root root 4059 2007-09-24 14:49 #3801913
-rw-r--r-- 1 root root 3457 2007-09-24 14:49 #3801914
-rw-r--r-- 1 root root 3665 2007-09-24 14:49 #3801915
-rw-r--r-- 1 root root 36 2007-09-24 14:49 #3801916
-rw-r--r-- 1 root root 5860 2007-09-24 14:49 #3801917
-rw-r--r-- 1 root root 4469 2007-09-24 14:49 #3801918
-rw-r--r-- 1 root root 3357 2007-09-24 14:49 #3801919
-rw-r--r-- 1 root root 35 2007-09-24 14:49 #3801920
-rwxr-xr-x 1 root root 1942 2007-05-15 10:01 #3801953
-rwxr-xr-x 1 root root 1220 2007-09-17 20:54 #3801954
drwxr-xr-x 2 root lp 4096 2008-02-28 21:45 #3801955
drwx------ 2 root lp 4096 2007-10-15 23:19 #3801956
-rw-r--r-- 1 root root 8817 2007-10-14 09:48 #3801957
-rw-r--r-- 1 root root 2425 2007-10-15 11:13 #3801958
-rw-r--r-- 1 root root 2545 2007-10-15 11:13 #3801959
-rw-r--r-- 1 root root 4409 2007-10-15 11:13 #3801960
-rw-r--r-- 1 root root 6184 2007-10-15 11:13 #3801961
-rw-r--r-- 1 root root 242 2007-10-15 23:19 #3801962
-rw-r--r-- 1 root root 213 2007-10-15 23:19 #3801963
-rw-r--r-- 1 root root 181 2007-10-15 11:13 #3801964
drwxr-xr-x 2 root root 4096 2007-12-05 14:13 #3801967
drwxr-xr-x 2 root root 4096 2007-10-05 11:45 #3801968
drwxr-xr-x 2 root root 4096 2008-05-15 03:39 #3801969
-rw-r--r-- 1 root root 2691 2007-10-05 11:45 #3801970
-rw-r--r-- 1 root root 2280 2007-10-05 11:45 #3801971
-rw-r--r-- 1 root root 2155 2007-09-19 09:50 #3801985
-rw-r--r-- 1 root root 514 2007-08-15 14:33 #3801986
-rw-r--r-- 1 root root 638 2007-10-15 23:17 #3801987
-rw-r--r-- 1 root root 216 2007-05-23 12:59 #3801988
-rw-r--r-- 1 root root 134 2007-05-14 06:28 #3801989
-rw-r--r-- 1 root root 270 2007-10-04 15:02 #3801990
-rw-r--r-- 1 root root 2979 2007-10-03 08:54 #3801991
-rw-r--r-- 1 root root 47 2007-10-04 11:17 #3801992
-rw-r--r-- 1 root root 117 2007-10-15 23:30 #3801993
-rw-r--r-- 1 root root 1919 2007-11-10 20:46 #3801994
-rw-r--r-- 1 root root 122 2007-10-15 11:11 #3801995
-rw-r--r-- 1 root root 377 2007-10-05 11:44 #3801996
-rw-r--r-- 1 root root 92 2007-10-04 11:17 #3801997
-rw-r--r-- 1 root root 13 2007-10-08 18:46 #3801998
-rw-r--r-- 1 root root 86 2007-10-04 11:17 #3801999
-rw-r--r-- 1 root root 313 2007-09-17 20:54 #3802000
-rw-r--r-- 1 root root 869 2007-10-15 11:33 #3802001
-rw-r--r-- 1 root root 456 2007-10-04 20:57 #3802002
-rw-r--r-- 1 root root 59 2005-10-25 19:44 #3802003
-rw-r--r-- 1 root root 160 2007-09-01 15:38 #3802004
-rw-r--r-- 1 root root 46 2008-05-19 17:53 #3802005
-rw-r--r-- 1 root root 1352 2007-08-18 01:24 #3802006
-rw-r--r-- 1 root root 186 2007-09-17 20:54 #3802007
-rw-r--r-- 1 root root 289 2007-10-04 11:17 #3802008
-rw-r--r-- 1 root root 1133 2007-05-18 09:59 #3802009
drwxr-xr-x 2 root root 4096 2007-11-14 15:40 #3802010
drwxr-xr-x 2 root root 4096 2007-11-11 03:11 #3802011
-rw-r--r-- 1 root root 580 2006-06-17 15:54 #3802012
-rw-r--r-- 1 root root 1015 2007-11-11 03:11 #3802013
-rw-r--r-- 1 root root 783 2008-04-10 18:10 #3802014
-rw-r--r-- 1 root root 1261 2006-06-17 15:54 #3802015
-rw-r--r-- 1 root root 3983 2006-06-17 15:54 #3802016
-rw-r--r-- 1 root root 530 2006-06-17 15:54 #3802017
drwxr-xr-x 2 root root 4096 2007-10-15 23:29 #3802037
drwxr-xr-x 2 root root 4096 2006-10-09 13:33 #3802038
-rw------- 1 root lp 82 2008-02-28 21:45 #3802182
lrwxrwxrwx 1 root root 15 2008-05-15 03:39 #3802236 -> /usr/bin/slogin
lrwxrwxrwx 1 root root 42 2007-11-16 15:00 #3802295 -> /usr/share/pixmaps/splash/gnome-splash.png
drwxr-xr-x 3 root root 4096 2008-02-08 05:11 #3802408
lrwxrwxrwx 1 root root 46 2008-04-10 18:10 #3802493 -> /usr/lib/flashplugin-nonfree/libflashplayer.so
lrwxrwxrwx 1 root root 54 2007-11-13 13:54 #3802543 -> /usr/share/man/man1/btlaunchmanycurses.bittorrent.1.gz
drwxr-xr-x 2 root root 4096 2007-07-25 16:08 #3802634
-rw-r--r-- 1 root root 294 2006-05-08 10:56 #3802662
-rwxr-xr-x 1 root root 1154 2007-10-04 20:59 #3802705
-rw-r--r-- 1 root root 19 2007-11-10 20:55 #3802892
-rw-r--r-- 1 root root 248 2007-11-10 20:56 #3802894
lrwxrwxrwx 1 root root 49 2008-03-24 01:20 #3802895 -> /usr/share/ubuntu-artwork/home/firefox-index.html
lrwxrwxrwx 1 root root 64 2007-11-11 03:12 #3802898 -> /usr/lib/jvm/java-6-sun/jre/plugin/i386/ns7/libjavaplugin_oji.so
-rw-r--r-- 1 root root 3508 2008-01-05 00:04 #3802900
-rw-r--r-- 1 root root 7 2007-11-10 20:57 #3802901
-rw-r--r-- 1 root root 167 2007-11-10 20:58 #3802902
drwxr-xr-x 2 root root 4096 2008-01-05 00:40 #3802904
drwxr-xr-x 2 root root 4096 2008-02-08 05:18 #3802923
-rw-r--r-- 1 root root 13 2007-07-24 09:59 #3802925
drwxr-xr-x 3 root root 4096 2008-03-24 01:20 #3802932
drwxr-xr-x 4 root root 4096 2007-11-11 03:11 #3802940
-rw-r--r-- 1 root root 248 2008-02-13 12:53 #3802959
lrwxrwxrwx 1 root root 46 2008-04-10 18:10 #3802962 -> /usr/lib/flashplugin-nonfree/libflashplayer.so
lrwxrwxrwx 1 root root 16 2008-04-30 15:24 #3802963 -> /usr/bin/firefox
-rw------- 1 root lp 82 2008-02-28 21:43 #3802964
drwxr-xr-x 3 root root 4096 2007-11-11 03:11 #3802965
lrwxrwxrwx 1 root root 44 2007-11-11 03:11 #3802969 -> /usr/lib/jvm/java-6-sun/jre/bin/ControlPanel
lrwxrwxrwx 1 root root 36 2007-11-11 03:11 #3802970 -> /usr/lib/jvm/java-6-sun/jre/bin/java
lrwxrwxrwx 1 root root 38 2007-11-11 03:11 #3802971 -> /usr/lib/jvm/java-6-sun/jre/bin/javaws
lrwxrwxrwx 1 root root 48 2007-11-11 03:11 #3802972 -> /usr/lib/jvm/java-6-sun/jre/man/man1/javaws.1.gz
lrwxrwxrwx 1 root root 40 2007-11-11 03:11 #3802973 -> /usr/lib/jvm/java-6-sun/jre/bin/jcontrol
lrwxrwxrwx 1 root root 39 2007-11-11 03:11 #3802974 -> /usr/lib/jvm/java-6-sun/jre/bin/keytool
lrwxrwxrwx 1 root root 49 2007-11-11 03:11 #3802975 -> /usr/lib/jvm/java-6-sun/jre/man/man1/pack200.1.gz
lrwxrwxrwx 1 root root 42 2007-11-11 03:11 #3802976 -> /usr/lib/jvm/java-6-sun/jre/bin/policytool
lrwxrwxrwx 1 root root 52 2007-11-11 03:11 #3802977 -> /usr/lib/jvm/java-6-sun/jre/man/man1/policytool.1.gz
lrwxrwxrwx 1 root root 36 2007-11-11 03:11 #3802978 -> /usr/lib/jvm/java-6-sun/jre/bin/rmid
lrwxrwxrwx 1 root root 51 2007-11-11 03:11 #3802979 -> /usr/lib/jvm/java-6-sun/jre/man/man1/unpack200.1.gz
lrwxrwxrwx 1 root root 36 2007-11-11 03:11 #3802980 -> /usr/lib/jvm/java-6-sun/jre/bin/orbd
lrwxrwxrwx 1 root root 52 2007-11-11 03:11 #3802981 -> /usr/lib/jvm/java-6-sun/jre/man/man1/servertool.1.gz
lrwxrwxrwx 1 root root 41 2007-11-11 03:11 #3802982 -> /usr/lib/jvm/java-6-sun/jre/bin/tnameserv
lrwxrwxrwx 1 root root 51 2007-11-11 03:11 #3802983 -> /usr/lib/jvm/java-6-sun/jre/man/man1/tnameserv.1.gz
lrwxrwxrwx 1 root root 34 2007-11-13 13:54 #3802984 -> /usr/bin/btmakemetafile.bittorrent
lrwxrwxrwx 1 root root 64 2007-11-11 03:12 #3802985 -> /usr/lib/jvm/java-6-sun/jre/plugin/i386/ns7/libjavaplugin_oji.so
lrwxrwxrwx 1 root root 64 2007-11-11 03:12 #3802986 -> /usr/lib/jvm/java-6-sun/jre/plugin/i386/ns7/libjavaplugin_oji.so
lrwxrwxrwx 1 root root 64 2007-11-11 03:12 #3802987 -> /usr/lib/jvm/java-6-sun/jre/plugin/i386/ns7/libjavaplugin_oji.so
lrwxrwxrwx 1 root root 64 2007-11-11 03:12 #3802988 -> /usr/lib/jvm/java-6-sun/jre/plugin/i386/ns7/libjavaplugin_oji.so
lrwxrwxrwx 1 root root 64 2007-11-11 03:12 #3802989 -> /usr/lib/jvm/java-6-sun/jre/plugin/i386/ns7/libjavaplugin_oji.so
-rw-r----- 1 root shadow 705 2007-11-21 14:31 #3802990
lrwxrwxrwx 1 root root 50 2007-11-13 13:54 #3802991 -> /usr/share/man/man1/btmakemetafile.bittorrent.1.gz
lrwxrwxrwx 1 root root 32 2007-11-13 13:54 #3802992 -> /usr/bin/btreannounce.bittorrent
lrwxrwxrwx 1 root root 48 2007-11-13 13:54 #3802993 -> /usr/share/man/man1/btreannounce.bittorrent.1.gz
lrwxrwxrwx 1 root root 28 2007-11-13 13:54 #3802994 -> /usr/bin/btrename.bittorrent
lrwxrwxrwx 1 root root 44 2007-11-13 13:54 #3802995 -> /usr/share/man/man1/btrename.bittorrent.1.gz
lrwxrwxrwx 1 root root 34 2007-11-13 13:54 #3802996 -> /usr/bin/btshowmetainfo.bittorrent
lrwxrwxrwx 1 root root 50 2007-11-13 13:54 #3802997 -> /usr/share/man/man1/btshowmetainfo.bittorrent.1.gz
lrwxrwxrwx 1 root root 27 2007-11-13 13:54 #3802998 -> /usr/bin/bttrack.bittorrent
lrwxrwxrwx 1 root root 43 2007-11-13 13:54 #3802999 -> /usr/share/man/man1/bttrack.bittorrent.1.gz
-rw-r--r-- 1 root root 841 2007-11-21 14:31 #3803001
lrwxrwxrwx 1 root root 34 2008-05-15 03:40 #3803003 -> /usr/lib/openssh/gnome-ssh-askpass
lrwxrwxrwx 1 root root 41 2008-01-04 23:25 #3803005 -> /usr/share/ubuntustudio-look/gdm-cdd.conf
lrwxrwxrwx 1 root root 46 2008-04-10 18:10 #3803006 -> /usr/lib/flashplugin-nonfree/libflashplayer.so
-rw-r--r-- 1 root root 58 2007-10-18 07:17 #3803007
lrwxrwxrwx 1 root root 46 2008-04-10 18:10 #3803008 -> /usr/lib/flashplugin-nonfree/libflashplayer.so
-rw-r--r-- 1 root root 2379 2007-08-28 19:51 #3803009
-rw-r--r-- 1 root root 588 2007-08-28 19:51 #3803010
-rw-r--r-- 1 root root 7541 2008-01-05 00:04 #3803012
-rw-r--r-- 1 root root 6619 2008-01-04 23:38 #3803013
lrwxrwxrwx 1 root root 21 2008-01-05 00:33 #3803014 -> /usr/bin/automake-1.9
lrwxrwxrwx 1 root root 20 2008-01-05 00:33 #3803015 -> /usr/bin/aclocal-1.9
lrwxrwxrwx 1 root root 37 2008-01-05 00:33 #3803016 -> /usr/share/man/man1/automake-1.9.1.gz
lrwxrwxrwx 1 root root 36 2008-01-05 00:33 #3803017 -> /usr/share/man/man1/aclocal-1.9.1.gz
-rw-r--r-- 1 root root 4052 2008-02-28 21:04 #3803018
-rw-r--r-- 1 root root 414 2006-11-03 18:14 #3803073
drwxr-xr-x 2 root root 4096 2008-01-05 00:40 #3803074
drwxr-xr-x 3 root root 4096 2008-01-05 00:40 #3803080
lrwxrwxrwx 1 root root 20 2008-01-05 00:40 #3803085 -> /usr/bin/gconftool-1
drwxr-xr-x 2 root root 4096 2008-03-29 14:16 #3803091
-rw-r--r-- 1 root root 3347 2008-01-10 09:20 #3803095
lrwxrwxrwx 1 root root 17 2008-04-10 18:10 #3803096 -> /usr/bin/ps2pdf14
-rw-r--r-- 1 root root 462 2008-06-07 22:22 #3803098
-rwxr-xr-x 1 root root 5929 2007-10-22 10:26 #3803100
-rw-r--r-- 1 root root 1315 2008-03-24 01:15 #3803103
-rw-r----- 1 root shadow 813 2008-03-24 01:15 #3803104
drwxrwxrwt 4 root root 4096 2008-06-07 22:22 #5816321
drwxr-xr-x 3 root root 4096 2007-11-10 20:55 #8896513
drwxr-xr-x 2 root root 4096 2007-10-15 23:17 #9715713
drwxr-xr-x 2 root root 4096 2007-10-04 11:17 #9879553
drwxr-xr-x 4 root root 4096 2007-10-15 23:28 #9994241
root@ubuntu:/mnt/root/lost+found#

unutbu
June 8th, 2008, 05:44 PM
Unfortunately, what you are looking at when you list lost+found is all the files fsck was able to recover. What's there falls far short of what is needed to have a working Ubuntu system.

If you have backups of your data on hda1, the easiest way to recover from this situation is to reinstall Ubuntu.

If you have data on hda1 that you can not bear to lose, then the safest way to proceed is to
first backup your entire /dev/hda1 partition bit-for-bit to something like an external hard drive. You'll need about 200 GB. The command for doing this is


dd if=/dev/hda1 of=/dev/hdb1

assuming the backup partition is /dev/hdb1.

You are probably in a very anxious state right now. It's important to not do anything until you are calm. As Herman (http://www.users.bigpond.net.au/hermanzone/p21.html) has written,

Above all, take your time and proceed calmly, if you're feeling stressed or excited, do something else for a while and come back later.
'Lost' data can remain on a hard disk for years, there's no rush.

Once you have a backup image of your hard drive, we can try to do all recovery from the backup.

The command you would then want to run is


sudo umount /dev/hdb1
sudo fsck -b 32769 /dev/hdb1

This will run fsck again, but use the superblock found at 32768 instead of the primary superblock at 0. The hope is that the superblock at 32768 remembers the state of your system at a time prior to the hard reboot, and can using that information, reconstruct more of your system.

The files it finds will most likely end up in lost+found as well. A lot of the files will have lost their true names, and fsck will rename them #<number>. You'd then have to look inside these files to find what home data files you have recovered. It is quite laborious.

The other option you should consider is to try TestDisk http://www.cgsecurity.org/wiki/TestDisk and
PhotoRec http://www.cgsecurity.org/wiki/PhotoRec.
I don't know much about how to use these, but Herman has written a guide here: http://www.users.bigpond.net.au/hermanzone/p21.html.

Another option you may want to consider is waiting a bit longer to see if another forum reader has another recommendation. I certainly do not know everything possible about recovery.

Good luck.

ACR1221
June 8th, 2008, 06:24 PM
Thanks for your help, I'll wait till tomorrow then I'll probably just reinstall the only important stuff on there I have on back up disks (pic. and word doc). Maybe I'll upgrade to 8.04

RaderCad
June 8th, 2008, 08:37 PM
Worked for me after Vista re-install :popcorn:

pyrho
June 9th, 2008, 10:40 PM
Thank you so much !
I guess partition magic ****** up my mbr and grub wasn't loading anymore (error 17). I Just tried to delete some partitions on an external USB hard drive and I ended up with this problem !

Doing the first part of the first post solved my problem !

Really thanks a lot !

(and screw partition magic!)

meierfra.
June 9th, 2008, 10:55 PM
(and screw partition magic!)

Whenever you delete partions, you can get a Grub Error. Grub is looking for "menu.lst" on say partition 5. After you deleted a partition, "menu.lst" is now on partition 4, and grub can't find it. This is not the fault of Partition Magic.

pyrho
June 10th, 2008, 12:06 AM
Whenever you delete partions, you can get a Grub Error. Grub is looking for "menu.lst" on say partition 5. After you deleted a partition, "menu.lst" is now on partition 4, and grub can't find it. This is not the fault of Partition Magic.

Hi !

It actually IS partition magic's fault, since I only modified the partitions of my *external* HD with partition magic. And doing this screwed my *internal* HD, where I have debian and XP :(

garethsimpsonuk
June 11th, 2008, 09:38 PM
This seems like a solution that could help me as I need to boot from a SATA drive when it's not supported by BIOS. I reckon that installing grub on the MBR of my IDE drive and pointing it to my SATA drive with the kernel it would work. I've followed the guide and it's bore no fruit! Is this possible?

logos34
June 11th, 2008, 09:43 PM
This seems like a solution that could help me as I need to boot from a SATA drive when it's not supported by BIOS. I reckon that installing grub on the MBR of my IDE drive and pointing it to my SATA drive with the kernel it would work. I've followed the guide and it's bore no fruit! Is this possible?

What if any error messages do you get? Or just blank screen?

Maybe a separate /boot (~100 MB) on the ide drive would solve the problem.

What are your system specs?

TheAJKMan
June 13th, 2008, 03:31 PM
Thanks guys, now I just wish I had a printer to print that out :) I think my G7.10 Ubuntu is a LiveCD as well, if I'm not mistaken. Will try and see if I can resuscitate my 80gig hdd, cos it seems to have bombed out, hopefully it's just the mbr that is affected :)

Where can I find out more about those errors and what they specifically mean?

unutbu
June 13th, 2008, 03:56 PM
Go to http://www.gnu.org/software/grub/manual/grub.html#Troubleshooting
for info an what GRUB errors mean.

I saw your other post, so here's what Errors 17 and 21 mean:

17 : Cannot mount selected partition
This error is returned if the partition requested exists, but the filesystem type cannot be recognized by GRUB.

21 : Selected disk does not exist
This error is returned if the device part of a device- or full file name refers to a disk or BIOS device that is not present or not recognized by the BIOS in the system.
If you have more trouble, post here and we'll try to help.

Shadowmeph
June 13th, 2008, 11:45 PM
I sure wished I would have read this a week ago when I messed up Grub and ended up reinstalling lol

slimx3m
June 18th, 2008, 02:43 PM
thnx

tj.brewster
June 18th, 2008, 09:55 PM
I have a strange problem...i installed ubuntu about a week ago, dual boot with windows. I've added some packages and done some personalization and even some gaming on it. i gotta say it's way better than Windows until yesterday.
I bought a new computer case and changed out all my components into this new case....I didn't change any components just moved into a new case.
Tried to boot the computer and got Grub error "18". i've tried some of the tricks here like "sudo grub", "find /boot...." no luck.
i'm very new to linux so even basic things are somewhat above my head expecially command line stuff.
i would appreciate it if some of you gurus could help guide me to fix this mess.

Thanks in advance TJ

logos34
June 18th, 2008, 10:13 PM
I didn't change any components just moved into a new case.
Tried to boot the computer and got Grub error "18". i've tried some of the tricks here like "sudo grub", "find /boot...." no luck.


maybe you plugged the hard disk(s) into different ports/connectors on the mobo. IDE or sata?

unutbu
June 18th, 2008, 10:17 PM
According to http://www.gnu.org/software/grub/manual/grub.html#Troubleshooting
Error 18 means:


18 : Selected cylinder exceeds maximum supported by BIOS
This error is returned when a read is attempted at a linear block address beyond the end of the BIOS translated area. This generally happens if your disk is larger than the BIOS can handle (512MB for (E)IDE disks on older machines or larger than 8GB in general).

Did you change the motherboard (and hence the BIOS) along with the case?

Jayakiran
June 19th, 2008, 01:35 PM
Thank you very much for this Guide.!!!!

Saved me a lot of trouble after I deleted a the partiton containing Linux Mint 4 .I used to dual boot Ubuntu and Mint.


THank u very much.!!

meierfra.
June 22nd, 2008, 08:50 AM
/dev/sda4 has no number because it is an extended partition -- a container for other partitions.

Extended partition do have numbers. /dev/sda4 is (hd0,3). It is even possible to install Grub to an extended partition. (This can be useful if Ubuntu is on a logical partition and one does not want to override the windows MBR. Just install Grub to the extended partition and put the boot flag on the extended partition.



Notice that the GRUB number for the partition is usually one less than the device number. For example , (hd0,4) is the same as /dev/sda5, and 4 is one less than 5. This pattern usually holds,

That pattern always holds, since both grub and Linux count in the order of the partition table.

(O.K. I have seen a case where "find /boot/grub/menu.lst" returned (hd0,6) and menu.lst was on /dev/sda6. But in that case the partition table was messed up and needed to be fixed with testdisk).

unutbu
June 22nd, 2008, 12:02 PM
Thanks meierfra.! I've edited my post to correct the error regarding extended partitions. I really appreciate your comments; they're helping me learn something new.


That pattern always holds, since both grub and Linux count in the order of the partition table.

Remember morrillt's fdisk -l:
http://ohioloco.ubuntuforums.org/showpost.php?p=5225663&postcount=8


Device Boot Start End Blocks Id System
/dev/hda2 * 1 9732 78172258+ f W95 Ext'd (LBA)
/dev/hda5 638 9732 73055556 7 HPFS/NTFS
/dev/hda6 1 584 4690885+ 83 Linux
/dev/hda7 585 637 425691 82 Linux swap / Solaris

Does that mean his partitions in GRUB notation are

(hd0,1) <--> /dev/hda2
(hd0,4) <--> /dev/hda5
(hd0,5) <--> /dev/hda6
(hd0,6) <--> /dev/hda7

? If so, where are (hd0,0), (hd0,2), (hd0,3)? Does GRUB simply not assign anything those numbers?

meierfra.
June 22nd, 2008, 05:42 PM
Does that mean his partitions in GRUB notation are

(hd0,1) <--> /dev/hda2
(hd0,4) <--> /dev/hda5
(hd0,5) <--> /dev/hda6
(hd0,6) <--> /dev/hda7

Yes.


If so, where are (hd0,0), (hd0,2), (hd0,3)? Does GRUB simply not assign anything those numbers?

Yes. The partition table contains three lines of zeros corresponding corresponding to these three non existing partitions. "root (hd0,2)" at the grub prompt gives "error 22, no such partition".

gregrae
July 1st, 2008, 10:40 AM
I have Installed XP Pro, Vista, Ubuntu. Using Gag.
Ubuntu will not boot.Other OS will boot.
I have read the Install procedure for ubuntu GRUB (MBR) I do not understand how to determine what Sector I should put GRUB on.
and to determine which is Windows or Ubuntu.
Or If I have to partition a section of Ubuntu for the Grub.
If so How is Partitioning done.
Could you explain.

unutbu
July 1st, 2008, 12:20 PM
I have read the Install procedure for ubuntu GRUB (MBR) I do not understand how to determine what Sector I should put GRUB on.

GAG is installed at the beginning of your primary hard drive (the MBR). GRUB is usually installed there, but it can also be installed at the beginning of a partition.

If you install GRUB on the MBR, you will overwrite GAG:
Pros: GRUB is an excellent bootloader. It can boot all three of your OSs. You should be able to get good support for any problems you have with GRUB here.
If you choose to go this route, first follow the instructions here: http://ubuntuforums.org/showpost.php?p=1308395&postcount=1.
Cons: GRUB is not graphical like GAG. (See http://users.bigpond.net.au/hermanzone/p15.htm#gui)

If you install GRUB at the beginning of the Ubuntu partition:
Pros: You can keep GAG, and can probably direct it to hand-off to GRUB which will boot Ubuntu. If you wish to go this route, follow the instructions here: http://users.bigpond.net.au/hermanzone/p12.htm.
Cons: I don't know much about GAG. There may be some people here who can help you with GAG problems, but the number will be fewer than those who use GRUB.


and [I do not understand how] to determine which is Windows or Ubuntu.

Boot from the LiveCD. Open a terminal. Type

sudo fdisk -l

You'll get output with a table like this:


Device Boot Start End Blocks Id System
/dev/sda1 1 7 56196 de Dell Utility
/dev/sda2 8 660 5245222+ b W95 FAT32
/dev/sda3 * 661 38536 304238970 83 Linux
/dev/sda4 38537 38913 3028252+ 5 Extended
/dev/sda5 38537 38913 3028221 82 Linux swap / Solaris


Each line in the table is a partition. In Linux terminology, the name of the partition is something like /dev/sda# (also called the Device name). Ubuntu will be on the partition with System=Linux. I think XP Pro will have System=FAT32(?), and Vista will have System=NTFS.



Or If I have to partition a section of Ubuntu for the Grub.

No, that should not be necessary unless you have a very big hard drive and your BIOS can not access the Ubuntu/GRUB bootloader.

So, I suggest you follow one of the guides posted above. If you run into any further problems/questions, post and we'll try to help.

abuakel
July 1st, 2008, 10:05 PM
I'm back again from another thread that I thought I had solved.. but it was temporary.

My problem was when I turned on my computer, I got this error:

GRUB Loading stage1.5.

GRUB loading, please wait...
Error 22

I used these commands to fix it (or thought I had fixed it):

sudo mkdir /temp
mount /dev/sdaX /temp
cat /temp/boot/grub/menu.lst
replacing sdaX with sdb5 <- where my Linux partition is

The above solved the problem for a boot or two, but now, I'm back to where I started with the same error as before.

I followed the directions, even the edits.. but I still get the same error when I reboot.


grub> find /boot/grub/stage1
(hd1,4)

grub> root (hd1,4)

grub> setup (hd0)
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 (hd0)"... 16 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 d (hd0) (hd0)1+16 p (hd1,4)/boot/grub/stage
2 /boot/grub/menu.lst"... succeeded
Done.

grub>

Just in case anyone asks, here are my "sudo fdisk -l" results:

$ sudo fdisk -l

Disk /dev/sda: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xe0000000

Device Boot Start End Blocks Id System
/dev/sda1 1 5 40131 de Dell Utility
/dev/sda2 6 1311 10485760 7 HPFS/NTFS
/dev/sda3 * 1311 21063 158660608 7 HPFS/NTFS
/dev/sda4 21063 38914 143382528 f W95 Ext'd (LBA)
/dev/sda5 21063 38914 143381504 7 HPFS/NTFS

Disk /dev/sdb: 203.9 GB, 203928109056 bytes
255 heads, 63 sectors/track, 24792 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x30d3dd7e

Device Boot Start End Blocks Id System
/dev/sdb1 1 23391 187882496 7 HPFS/NTFS
/dev/sdb2 23392 24792 11253532+ 5 Extended
/dev/sdb5 23392 24727 10731388+ 83 Linux
/dev/sdb6 24728 24792 522081 82 Linux swap / Solaris

unutbu
July 1st, 2008, 10:53 PM
Boot the computer. Press ESC for the grub menu. Press 'c' to get to the GRUB command line.
Now type


geometry (hd0)

Does the output say

(Output A)

Partition num: 0, Filesystem type unknown, partition type 0xde
Partition num: 1, Filesystem type is ntfs, partition type 0x7
Partition num: 2, Filesystem type is ntfs, partition type 0x7
Partition num: 4, Filesystem type is ntfs, partition type 0x7

or does it say

(Output B)


Partition num: 0, Filesystem type is ntfs, partition type 0x7
Partition num: 4, Filesystem type is ext2fs, partition type 0x83
Partition num: 5, Filesystem type unknown, partition type 0x82

Then type


geometry (hd1)

and again note if the output is like Output A or Output B.
Post the result here.

Also, please boot from the LiveCD, and post
the output of


sudo mkdir /temp
mount /dev/sdb5 /temp
cat /temp/boot/grub/menu.lst

abuakel
July 1st, 2008, 11:01 PM
Boot the computer. Press ESC for the grub menu. Press 'c' to get to the GRUB command line.
Now type


geometry (hd0)

Does the output say

(Output A)

Partition num: 0, Filesystem type unknown, partition type 0xde
Partition num: 1, Filesystem type is ntfs, partition type 0x7
Partition num: 2, Filesystem type is ntfs, partition type 0x7
Partition num: 4, Filesystem type is ntfs, partition type 0x7

or does it say

(Output B)


Partition num: 0, Filesystem type is ntfs, partition type 0x7
Partition num: 4, Filesystem type is ext2fs, partition type 0x83
Partition num: 5, Filesystem type unknown, partition type 0x82

Then type


geometry (hd1)

and again note if the output is like Output A or Output B.
Post the result here.

Also, please boot from the LiveCD, and post
the output of


sudo mkdir /temp
mount /dev/sdb5 /temp
cat /temp/boot/grub/menu.lst


for geometry (hd0), Output A results:

drive 0x80: C/H/S = 1023/255/63, The number of sectors = 625142448, LBA
Partition num: 0, Filesystem type unknown, partition type 0xde
Partition num: 1, Filesystem type is ntfs, partition type 0x7
Partition num: 2, Filesystem type is ntfs, partition type 0x7
Partition num: 4, Filesystem type is ntfs, partition type 0x7


for geometry (hd1), Output B results:

Partition num: 0, Filesystem type is ntfs, partition type 0x7
Partition num: 4, Filesystem type is ext2fs, partition type 0x83
Partition num: 5, Filesystem type unknown, partition type 0x82

Edit:
Output of:

sudo mkdir /temp
mount /dev/sdb5 /temp
cat /temp/boot/grub/menu.lst
is

ubuntu@ubuntu:~$ sudo mkdir /temp
ubuntu@ubuntu:~$ sudo mount /dev/sdb5 /temp
ubuntu@ubuntu:~$ sudo cat /temp/boot/grub/menu.lst
# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not use 'savedefault' or your
# array will desync and will not let you boot your system.
default 0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 10

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu

# Pretty colours
#color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=ecafd647-4905-4716-ab3b-b392f969ec93 ro

## Setup crashdump menu entries
## e.g. crashdump=1
# crashdump=0

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd1,4)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash

## should update-grub lock old automagic boot options
## e.g. lockold=false
## lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

## ## End Default Options ##

title Ubuntu 8.04, kernel 2.6.24-16-generic
root (hd1,4)
kernel /boot/vmlinuz-2.6.24-16-generic root=UUID=ecafd647-4905-4716-ab3b-b392f969ec93 ro quiet splash
initrd /boot/initrd.img-2.6.24-16-generic
quiet

title Ubuntu 8.04, kernel 2.6.24-16-generic (recovery mode)
root (hd1,4)
kernel /boot/vmlinuz-2.6.24-16-generic root=UUID=ecafd647-4905-4716-ab3b-b392f969ec93 ro single
initrd /boot/initrd.img-2.6.24-16-generic

title Ubuntu 8.04, memtest86+
root (hd1,4)
kernel /boot/memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title Other operating systems:
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title Dell Utility Partition
root (hd0,0)
savedefault
makeactive
chainloader +1


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda3
title Windows Vista/Longhorn (loader)
root (hd0,2)
savedefault
makeactive
chainloader +1

Edit 2:.. it looks fine.. am I correct?
Edit 3: and it turns out it is fine.. hopefully it will stay working this time, thanks for the help :)
Edit 4: for some reason, what I'm doing is temporary, since after I rebooted from a successful boot, I'm back with the GRUB Error 22. =/

unutbu
July 2nd, 2008, 02:10 AM
abuakel, I am puzzled. Everything you've shown looks fine to me. Can you take us through the series of boots that you've been doing? For example,

Do you boot fine once, then do a hard shutdown or a soft reboot? Do you boot into Vista, and then reboot into Ubuntu? What is the sequence that leads you to GRUB Error 22? Is it repeatable? How do get back to a working boot? Do you just do a power off/power on? How many times?

abuakel
July 2nd, 2008, 02:20 AM
abuakel, I am puzzled. Everything you've shown looks fine to me. Can you take us through the series of boots that you've been doing? For example,

Do you boot fine once, then do a hard shutdown or a soft reboot? Do you boot into Vista, and then reboot into Ubuntu? What is the sequence that leads you to GRUB Error 22? Is it repeatable? How do get back to a working boot? Do you just do a power off/power on? How many times?

After I get through punching in the commands in this thread in the LiveCD, I reboot, pull the CD out, and it loads up saying stuff about RAID volumes (usually right after that is when I get the GRUB error 22). However, after I type in the commands, the boot sequence shows the same RAID information but goes to the grub screen where it lists the operating systems.. Ubuntu, another one, another one, dell, and vista/longhorn.

Each time, I've gone straight to Ubuntu.. and each time, I've gone the the quit button in the top right hand corner and clicked Restart.
The first time, it went through the boot sequence, fine and I was able to access Vista.
when I shut vista down the normal way (by click shutdown), I turned the computer on the next morning and the GRUB Error 22 popped up.
I did the same commands and got into Ubuntu again, but when I restarted (the same way as before), it came up with the same error. and It's been like this since..

unutbu
July 2nd, 2008, 02:40 AM
Boot up again, enter the BIOS menu and disable RAID.
I hope that works, if not, I'm stumped.

abuakel
July 2nd, 2008, 02:46 AM
Boot up again, enter the BIOS menu and disable RAID.
I hope that works, if not, I'm stumped.

n00b question: after I've entered the BIOS, how do I disable, let alone find RAID?
^^ and I can re-enable it right?

unutbu
July 2nd, 2008, 02:57 AM
RAID is for making multiple hard drives seem like one (for better throughput and data reliability). Given that you have Vista on one hard drive and Ubuntu on the other, you are using the two hard drives as independent devices. This disqualifies you for RAID.

If you have the option, turn it off!
Everyone's BIOS is different, so you are just going to have to hunt and peck through your BIOS menus looking for RAID. Keywords to look for are "Configuration", "Hardware", "Disk Drives". If you see an option to set your Disk Drives to auto, I would try that first, then if that doesn't work, LBA. Whatever the case, do not set it to RAID.

Hope this helps.

abuakel
July 2nd, 2008, 03:13 AM
RAID is for making multiple hard drives seem like one (for better throughput and data reliability). Given that you have Vista on one hard drive and Ubuntu on the other, you are using the two hard drives as independent devices. This disqualifies you for RAID.

If you have the option, turn it off!
Everyone's BIOS is different, so you are just going to have to hunt and peck through your BIOS menus looking for RAID. Keywords to look for are "Configuration", "Hardware", "Disk Drives". If you see an option to set your Disk Drives to auto, I would try that first, then if that doesn't work, LBA. Whatever the case, do not set it to RAID.

Hope this helps.

HUZAAAAAAAAH! It worked :popcorn:
Thank you!!
Except now, Vista just fails to boot.. and ends up restarting.. so that'll be for another thread. =/
^^ God, how I loathe Vista.

Edit: Computers are strange things.. I re-enable RAID to see if Vista would work.. and low and behold, it did!!.. along with Ubuntu.. This has given me the biggest head ache since getting USB support working in Virtualbox. lol

Edit 2: ^^ Computer's aren't strange things.. Microsoft Vista is the strange one. :D

unutbu
July 2nd, 2008, 04:16 AM
Edit: Oh good! I just read you last edit.
Feel free to ignore the rest of this post.

I'm adapting the instructions from http://ubuntuforums.org/showthread.php?p=5184182 and
http://www.besttechie.net/forums/index.php?showtopic=12691&mode=threaded:

1.Put the Windows Vista installation disc in the disc drive, and then start the computer.
2.Press a key when you are prompted.
3.Select a language, a time, a currency, a keyboard or an input method, and then click Next.
4.Click Repair your computer.
5.Click the operating system that you want to repair, and then click Next. (if no Vista operating system is listed, click Next anyway)
6.In the System Recovery Options dialog box, click Command Prompt.

7. Type


bootrec /rebuildbcd
bootrec /fixboot

8. Reboot. Test that both Vista and Ubuntu can boot.

abuakel
July 2nd, 2008, 04:18 AM
I'm adapting the instructions from http://ubuntuforums.org/showthread.php?p=5184182 and
http://www.besttechie.net/forums/index.php?showtopic=12691&mode=threaded:

1.Put the Windows Vista installation disc in the disc drive, and then start the computer.
2.Press a key when you are prompted.
3.Select a language, a time, a currency, a keyboard or an input method, and then click Next.
4.Click Repair your computer.
5.Click the operating system that you want to repair, and then click Next. (if no Vista operating system is listed, click Next anyway)
6.In the System Recovery Options dialog box, click Command Prompt.

7. Type


bootrec /rebuildbcd
bootrec /fixboot

8. Reboot. Test that both Vista and Ubuntu can boot.

I don't think you saw my edit.. but I edited my previous entry:

Edit: Computers are strange things.. I re-enable RAID to see if Vista would work.. and low and behold, it did!!.. along with Ubuntu.. This has given me the biggest head ache since getting USB support working in Virtualbox. lol

Edit 2: ^^ Computer's aren't strange things.. Microsoft Vista is the strange one.

Zargoon
July 7th, 2008, 08:55 PM
I've tried these instructions and they all run just fine but once I restart my computer grub still freezes. Any ideas? Thanks.

unutbu
July 7th, 2008, 09:08 PM
At what stage does the computer freeze?
Are you seeing a GRUB error message? If so, please post the message.

It would also be helpful to see some additional information too. Please boot from the LiveCD, open a terminal and type


sudo fdisk -l
(Note the last bit is a lower case "-L", not minus one).

You should see output that looks something like


Device Boot Start End Blocks Id System
/dev/sda1 1 7 56196 de Dell Utility
/dev/sda2 8 660 5245222+ b W95 FAT32
/dev/sda3 * 661 38536 304238970 83 Linux
/dev/sda4 38537 38913 3028252+ 5 Extended
/dev/sda5 38537 38913 3028221 82 Linux swap / Solaris
Note the device name (e.g. /dev/sda3) which corresponds to your linux partition.

Armed with the name of your linux partition, now type (changing /dev/sda3 to the name of your linux partition)


sudo mkdir /Ubuntu
mount /dev/sda3 /Ubuntu
cat /Ubuntu/boot/grub/menu.lst
Please post the output of the above commands.

Zargoon
July 7th, 2008, 09:54 PM
I am not seeing an error message it just freezes at "Grub loading.."

ubuntu@ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x000e8db2

Device Boot Start End Blocks Id System
/dev/sda1 * 1 14029 112687911 83 Linux
/dev/sda2 14030 14593 4530330 5 Extended
/dev/sda5 14030 14593 4530298+ 82 Linux swap / Solaris

sudo mkdir /Ubuntu gave no output.

sudo mount /dev/sda1 /Ubuntu also gave no output.

ubuntu@ubuntu:~$ cat /Ubuntu/boot/grub/menu.lst
# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not use 'savedefault' or your
# array will desync and will not let you boot your system.
default 0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 3

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
hiddenmenu

# Pretty colours
#color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=e4fa59fb-4258-46b7-9df8-202455d018ea ro

## Setup crashdump menu entries
## e.g. crashdump=1
# crashdump=0

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,0)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash

## should update-grub lock old automagic boot options
## e.g. lockold=false
## lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

## ## End Default Options ##

title Ubuntu 8.04.1, kernel 2.6.24-19-generic
root (hd0,0)
kernel /boot/vmlinuz-2.6.24-19-generic root=UUID=e4fa59fb-4258-46b7-9df8-202455d018ea ro quiet splash
initrd /boot/initrd.img-2.6.24-19-generic
quiet

title Ubuntu 8.04.1, kernel 2.6.24-19-generic (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.24-19-generic root=UUID=e4fa59fb-4258-46b7-9df8-202455d018ea ro single
initrd /boot/initrd.img-2.6.24-19-generic

title Ubuntu 8.04.1, kernel 2.6.24-16-generic
root (hd0,0)
kernel /boot/vmlinuz-2.6.24-16-generic root=UUID=e4fa59fb-4258-46b7-9df8-202455d018ea ro quiet splash
initrd /boot/initrd.img-2.6.24-16-generic
quiet

title Ubuntu 8.04.1, kernel 2.6.24-16-generic (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.24-16-generic root=UUID=e4fa59fb-4258-46b7-9df8-202455d018ea ro single
initrd /boot/initrd.img-2.6.24-16-generic

title Ubuntu 8.04.1, memtest86+
root (hd0,0)
kernel /boot/memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST

I hope that helps I'm really lost... thanks.

unutbu
July 8th, 2008, 03:49 AM
Zargoon, I don't know why GRUB isn't booting properly.
Perhaps if you try Catlett's instructions from post #1 again and post the complete transcript of your terminal commands, someone here might get an idea what to do.

Zargoon
July 8th, 2008, 07:27 PM
ubuntu@ubuntu:~$ sudo grub
Probing devices to guess BIOS drives. This may take a long time.

[ 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> find /boot/grub/stage1
find /boot/grub/stage1
(hd0,0)
grub> root (hd0,0)
root (hd0,0)
grub> setup (hd0)
setup (hd0)
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 (hd0)"... 16 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd0) (hd0)1+16 p (hd0,0)/boot/grub/stage2 /boot/grub/menu.lst"... succeeded
Done.
grub> quit
quit
ubuntu@ubuntu:~$

Zargoon
July 8th, 2008, 07:29 PM
The weird thing is that when I go to /boot there is not grub folder even though it says it installed there.

Look here:

ubuntu@ubuntu:/boot$ ls
abi-2.6.24-16-generic memtest86+.bin
config-2.6.24-16-generic System.map-2.6.24-16-generic
initrd.img-2.6.24-16-generic.bak vmlinuz-2.6.24-16-generic
ubuntu@ubuntu:/boot$

See? No grub folder...

unutbu
July 8th, 2008, 07:35 PM
That is actually normal.

(hd0,0)/boot/grub/stage1 refers to the /boot/grub/stage1 file in the filesystem which is in your first partition, first hard drive.

When you boot the LiveCD, a filesystem is created entirely in RAM -- not your hard disks.
The LiveCD's RAM filesystem has a /boot directory, but no /boot/grub. That's ok.

Can you give us some more context? How did this all begin? It looks like you have been using Hardy for a while, so what changed?

Zargoon
July 8th, 2008, 08:11 PM
I've never had an issue like this before. Before my hardy install grub always worked fine. Then with hardy sometimes grub would freeze like it does now, but sometimes it would work like normal on the reboot. Very weird. Now it just stopped working altogether and I can't get into my computer at all. Do you know if there is an alternative bootloader that might be simpler to use? I want to fix grub but I also really need to get back into my computer.. Thanks for all the help!

Zargoon
July 8th, 2008, 08:13 PM
Oh one more weird thing. I made a Super Grub Disk and tried to use it but it just freezes too... I tried it on a different computer and it worked great. I would think it could be a hardware issue but I recently had my computer checked up a week ago and nothing was wrong with the hardware.

unutbu
July 8th, 2008, 08:27 PM
I really don't know what is wrong. I'm grasping at straws here: How about boot from the LiveCD and do a memory check?

Also, perhaps go to the BIOS menu and make sure all the settings seem correct?

The only other thing I can think of is open the case take out the memory, disconnect the hard drive from the cable, let everything rest for 15 minutes and then reassemble.

crtlbreak
July 8th, 2008, 09:02 PM
I agree with unutbu - something must have changed in the last while to initiate the problem. Hardware change - additional software installed - even adding an external device?

thschiavo
July 12th, 2008, 08:00 AM
This worked with me perfectly. I installed PCBSD in my pc, but somehow everything got insane... I used this "tutorial" and everything was back to normal, hehehe

But I would like to know how could I add to my grub by hand a entry to my BSD? I have it installed in a partition... Is there anyway?

unutbu
July 12th, 2008, 01:16 PM
I'm have no experience with FreeBSD or PCBSD, so please read the following with all due skepticism.

First, you're going to need to know GRUB's name for the FreeBSD partition/pc slice that contains your PCBSD OS. For example "(hd0,1,a)" specifies a FreeBSD partition/pc slice. I don't know how you determine what the right numbers and letter is for your system. (See http://www.gnu.org/software/grub/manual/grub.html#Naming-convention)

Once you know the right (hdx,y,z), boot into Ubuntu.

gksu gedit /boot/grub/menu.lst
Go 60% of the way down the document to where you see something like


## ## End Default Options ##

title Ubuntu 7.10, kernel 2.6.22-14-generic
root (hd0,2)
kernel /boot/vmlinuz-2.6.22-14-generic root=UUID=03a507ee-cdac-4bd9-b438-eccd616b66ed ro
initrd /boot/initrd.img-2.6.22-14-generic
quiet

and add something like


# For booting PCBSD

title PCBSD
root (hd0,1,a) <--- You're going to have to change this
kernel /boot/loader

Above is a boot stanza. The order in which the boot stanzas appear will determine the order in which they appear in your GRUB menu.

Save and quit gedit. Reboot. Hopefully you will now be able to boot PCBSD.

I'm getting my information from here:

http://www.ubergeek.co.uk/blog/2008/05/grub-freebsd-windowsxp/
http://ubuntuforums.org/showthread.php?t=724817

Zargoon
July 12th, 2008, 06:19 PM
Well its working now. Turns out I had recenlty plugging in my webcam (which had not been plugged in before) and if I don't have it plugged in grub works just fine. Thanks for all the help. I guess the littlest thing really can make a difference.

thschiavo
July 13th, 2008, 11:32 PM
This was enough for me:

# Trying PCBSD
title PC-BSD Install
root (hd0,2)
savedefault
makeactive
chainloader +1


It's working perfectly well.

Rangeli
July 14th, 2008, 10:40 AM
Please help. I have restored my Linux partition from tar archive after mke2fs and installed grub following this tutorial. It said it was successfull, but after reboot grub outputs error 2 and stops. Distro is Mint 4.0, based on Gutsy. I used Finnix 92.0 (kernel 2.6.25) to install grub into MBR.

The drive was recognized (IDE), so I used first method.

unutbu
July 14th, 2008, 01:39 PM
Error 2 means

2 : Bad file or directory type
This error is returned if a file requested is not a regular file, but something like a symbolic link, directory, or FIFO.
(See http://www.gnu.org/software/grub/manual/grub.html#Troubleshooting)

Please boot from the LiveCD, open a terminal and
and post the output of


sudo fdisk -l # The last bit is a "minus lowercase L", not "minus one".
sudo mkdir /Ubuntu
sudo mount /dev/sda1 # change sda1 to the correct name for your Linux partition
ls -l /Ubuntu/boot
cat /Ubuntu/boot/grub/menu.lst

Rangeli
July 14th, 2008, 09:54 PM
fdisk -l

Disk /dev/hda: 40.0 GB, 40027029504 bytes
255 heads, 63 sectors/track, 4866 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xdeaddead

Device Boot Start End Blocks Id System
/dev/hda1 * 1 2040 16386268+ 83 Linux
/dev/hda2 2041 4866 22699845 f W95 Ext'd (LBA)
/dev/hda5 2041 2544 4048348+ 83 Linux
/dev/hda6 2545 2659 923706 82 Linux swap / Solaris
/dev/hda7 2660 4866 17727696 83 Linux

ls -l /mnt/hda7/boot

total 21676
-rw-r--r-- 1 root root 823535 Oct 15 2007 System.map-2.6.22-14-generic
-rw-r--r-- 1 root root 424317 Oct 15 2007 abi-2.6.22-14-generic
-rw-r--r-- 1 root root 75311 Oct 15 2007 config-2.6.22-14-generic
drwxr-xr-x 2 root root 4096 Jul 13 11:47 grub
-rw-r--r-- 1 root root 9458700 Jul 13 11:46 initrd.img-2.6.22-14-generic
-rw-r--r-- 1 root root 9471752 Oct 21 2007 initrd.img-2.6.22-14-generic.bak
-rw-r--r-- 1 root root 103204 Sep 28 2007 memtest86+.bin
-rw-r--r-- 1 root root 1764280 Oct 15 2007 vmlinuz-2.6.22-14-generic

ls -l /mnt/hda7/boot/grub

total 184
-rw-r--r-- 1 root root 197 Jul 13 11:47 default
-rw-r--r-- 1 root root 15 Jul 13 11:47 device.map
-rw-r--r-- 1 root root 7444 Jul 13 11:47 e2fs_stage1_5
-rw-r--r-- 1 root root 7268 Jul 13 11:47 fat_stage1_5
-rw-r--r-- 1 root root 6580 Jul 13 11:47 iso9660_stage1_5
-rw-r--r-- 1 root root 8064 Jul 13 11:47 jfs_stage1_5
-rw-r--r-- 1 root root 3603 Jul 13 11:47 menu.lst
-rw-r--r-- 1 root root 6740 Jul 13 11:47 minix_stage1_5
-rw-r--r-- 1 root root 9012 Jul 13 11:47 reiserfs_stage1_5
-rw-r--r-- 1 root root 512 Jul 13 11:47 stage1
-rw-r--r-- 1 root root 100948 Jul 13 11:47 stage2
-rw-r--r-- 1 root root 8700 Jul 13 11:47 xfs_stage1_5

menu.lst

# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
default 0

gfxmenu=/etc/grub/message.mint

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 10

# Pretty colours
color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=/dev/hda7 ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,6)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery mode) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true

## ## End Default Options ##

title Linux Mint, kernel 2.6.22-14-generic
root (hd0,6)
kernel /boot/vmlinuz-2.6.22-14-generic root=/dev/hda7 ro quiet splash
initrd /boot/initrd.img-2.6.22-14-generic
boot

title Linux Mint, kernel 2.6.22-14-generic (recovery mode)
root (hd0,6)
kernel /boot/vmlinuz-2.6.22-14-generic root=/dev/hda7 ro single
initrd /boot/initrd.img-2.6.22-14-generic
boot

title Linux Mint, kernel memtest86+
root (hd0,6)
kernel /boot/memtest86+.bin
boot

### END DEBIAN AUTOMAGIC KERNELS LIST

unutbu
July 14th, 2008, 10:18 PM
I believe gfxmenu is not part of standard GRUB. You need to install a special patched GRUB for gfxmenu to work. I'm guessing the version of GRUB that Finnix installed on the MBR is not the patched GRUB -- though I could be wrong; I know nothing about Finnix.

If you are using a version of GRUB that understands gfxmenu, then my second concern is that gfxmenu is set to /etc/grub/message.mint -- but GRUB couldn't possible know where /etc/grub/message.mint is, because you could have multiple partitions each with a filesystem containing an /etc directory. GRUB would have no way of choosing which /etc/grub/message.mint you meant. So if gfxmenu has a chance of working, it would have to be set with something like


gfxmenu=(hd0,6)/etc/grub/message.mint

Perhaps just to get things booting, try commenting out


# gfxmenu=/etc/grub/message.mint

in your menu.lst.

Julian Lewis
July 15th, 2008, 11:13 PM
Thankyou thankyou and again thanks. I lost my windows partition and was silly enough to think I could delete and use the partition .....
Then I had no boot no windows and no ubuntu. You saved my life, I spent a very long time setting up my system.
Recomendation .... on the Ubuntu CD a save or restore existing Ubuntu system would be a good option... lukilly I canceled the installation, got firefox running and found your post.... whew !!!

gregrae
July 15th, 2008, 11:55 PM
I am trying to install Ubuntu on a duel boot with xp.
This is what comes up when I try to Install the ubuntu CD on to the PC.(Ref to attachement).
Can you explain how to fix this boot problem.
I appoligise for the stupid questions but I would like to be able to duel boot XP and ubuntu.
Thank you for your patience.
Greg

unutbu
July 16th, 2008, 02:44 AM
(1) Read http://ubuntuforums.org/showthread.php?t=191355. It will provide you with more details about how people have solved this problem.

(2) Try to turn off IOAPIC in your BIOS.

(3) If you don't have that option, then press ESC to get to the GRUB menu. With Ubuntu
highlighted, press 'e' to edit. (See http://users.bigpond.net.au/hermanzone/p15.htm#Temporarily_Edit_the_GRUB_Menu.) Use the down arrow to highlight the "kernel" line. Press 'e' to edit the kernel line. Use the right arrow to go to the very end of the line. You'll probably so 'ro quiet splash'. Add to the end the word ' noapic'. Press return, then 'b' to boot. Hopefully this will solve your boot problem.

(4) This problem, while somewhat related to GRUB, falls outside the territory of this thread. If you encounter further problems, I think you will get better help posting to the thread listed in (1).

gregrae
July 17th, 2008, 10:27 AM
In the attachment is what comes up when I try to run the ubuntu CD.
How do I go about trying to get the CD to auto boot.
Thank for all you have doe but I am not conversant with ubuntu.
I will keep trying till I can duel boot.
Thank you Greg

unutbu
July 17th, 2008, 12:23 PM
When you turn on the computer a BIOS/Manufacturer welcome message should pop up. Sometimes it will tell you what key to press to enter the BIOS menu. Often it is F2. If not, try other function keys or maybe ESC.
Whatever the case, get to the BIOS menu.

Look for a configuration option called something like "Boot Configuration" or "Boot order". Or just poke around. Every BIOS is different.

When you get to the right place, you'll see a list such as

1. Boot from primary drive
2. Boot from secondary drive
3. Boot from CD
4. Boot from floppy
5. Boot from USB
...

This is the boot order. It usually says try booting from the primary drive first. Make "Boot from CD" the first option, then Save and Exit the BIOS menu. Your machine should then boot from the LiveCD.

Rangeli
July 17th, 2008, 07:45 PM
I believe gfxmenu is not part of standard GRUB. You need to install a special patched GRUB for gfxmenu to work. I'm guessing the version of GRUB that Finnix installed on the MBR is not the patched GRUB -- though I could be wrong; I know nothing about Finnix.

If you are using a version of GRUB that understands gfxmenu, then my second concern is that gfxmenu is set to /etc/grub/message.mint -- but GRUB couldn't possible know where /etc/grub/message.mint is, because you could have multiple partitions each with a filesystem containing an /etc directory. GRUB would have no way of choosing which /etc/grub/message.mint you meant. So if gfxmenu has a chance of working, it would have to be set with something like


gfxmenu=(hd0,6)/etc/grub/message.mint

Perhaps just to get things booting, try commenting out


# gfxmenu=/etc/grub/message.mint

in your menu.lst.

Unfortunately, this has not solved my problem. I commented out the line, but again the same error.

Also, there is one different problem. I tried to boot Mint Live CD from which I installed the system I am trying to boot, but grub could not find /boot/grub/stage1. I tried the third method in this tutorial (to mount proc and dev filesystems), but it didn't work.

unutbu
July 17th, 2008, 08:27 PM
Let's back up.

You have a working Linux distro on /dev/hda1.
You made an ext3 filesystem in /dev/hda7.
You untarred a complete Linux (Mint) distro into /dev/hda7.
You installed grub on the MBR using a Finnix liveCD
Rebooting gives you Error 2.
Booting from the Mint LiveCD, gets you to a terminal but

sudo grub
find /boot/grub/stage1
returns the error "can not find /boot/grub/stage1".

Is this correct?

psychobilly freakout
July 29th, 2008, 03:50 AM
How do i open a terminal?

(sorry im kinda new at this)

kool_kat_os
July 29th, 2008, 03:53 AM
Applications > Accessories > Terminal

psychobilly freakout
July 29th, 2008, 04:00 AM
when i try to enter the 3rd box root (hd?,?) it says in the terminal:error 23:error while parsing number.\

What should i do?

confused57
July 29th, 2008, 06:07 AM
when i try to enter the 3rd box root (hd?,?) it says in the terminal:error 23:error while parsing number.\

What should i do?
Are you entering the root results for "find /boot/grub/stage1", e.g. "root (hd0,1)":

root (hd0,1)
setup (hd0)
quit

The above is correct if root is on (hd0,1) and you want to install grub to (hd0).

crtlbreak
July 29th, 2008, 06:26 AM
How do i open a terminal?

(sorry im kinda new at this)

You will see there are many ways of doing things in Linux
- the most important thing is to achieve the desired result an learning from other peoples ways of reaching those same results - that way you learn how to do things quicker and more effectively.

For terminal in ubuntu you can also
ALT + F2 - this is the default "run" command - in the window type
gnome-terminal
this will deliver the same result.

regards

psychobilly freakout
July 29th, 2008, 07:14 PM
im still getting these errors saying unable to resolve host ubuntu!

---
P.s:When i restart my pc i always need to go into demo mode so everytime i log into ubutu everything restart and everything saved is gone.Is this problem known?

Kaspersky_
August 3rd, 2008, 06:44 PM
I am now shatting brix.


setup (hd0,0)
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 (hd0,0)"... failed (this is not fatal)
Running "embed /boot/grub/e2fs_stage1_5 (hd0,0)"... failed (this is not fatal)
Running "install /boot/grub/stage1 (hd0,0) /boot/grub/stage2 p /boot/grub/menu
.lst "... failed

Error 22: No such partition

I'm sure it has to do with it not finding the GRUB files and not being able to update them...

parakeets11
August 7th, 2008, 07:17 PM
I tried this but everytime I input the code "find /boot/grub/stage1" it says file is not found. I had gotten the Grub Error 22 when I powered on my computer this morning and i can access any OS.

unutbu
August 7th, 2008, 07:29 PM
Boot from the LiveCD.
Open a terminal and type

sudo fdisk -l
Post the output

parakeets11
August 7th, 2008, 07:49 PM
Disk /dev/sda: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x453d453d

Device Boot Start End Blocks Id System
/dev/sda1 * 1 24320 195350368+ 7 HPFS/NTFS

Disk /dev/sdb: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xf141d157

Device Boot Start End Blocks Id System
/dev/sdb1 1 19581 157281280 7 HPFS/NTFS
/dev/sdb2 19581 19982 3218750 7 HPFS/NTFS
/dev/sdb3 19983 24321 34853017+ 5 Extended
/dev/sdb5 24138 24321 1477948+ 82 Linux swap / Solaris

unutbu
August 7th, 2008, 07:55 PM
If you plan on installing Ubuntu, then proceed with the install and allow the installer to install GRUB on the MBR. (This is the default behavior). The installer will recognize that you have a windows OS on your machine, and will make a GRUB boot menu option to boot both Ubuntu and Windows.

If you just want Windows back, this howto tells you how to restore your MBR for XP and/or Vista: http://ubuntuforums.org/showthread.php?t=740221. Do not try to restore GRUB, since GRUB tries to read files such as menu.lst which will not exist unless you have a linux OS installed.

parakeets11
August 7th, 2008, 07:58 PM
Ah, but I do have Ubuntu installed. I have it on another HDD. But I should just let it overwrite the old Ubuntu?

unutbu
August 7th, 2008, 08:02 PM
If you have Ubuntu installed, one of the partitions should be a Linux partition.
The output from "sudo fdisk -l" shows three HPFS/NTFS partitions, and a Linux swap partition, but no Linux partition.

This strongly suggests you have not successfully installed Ubuntu.
If you are using Wubi then I am clueless (but I believe Wubi would not have installed GRUB on the MBR... so it doesn't sound to me like you are using Wubi.)

parakeets11
August 7th, 2008, 08:04 PM
No, I've been using Ubuntu for like a month, but it just recently died. Its installed on the Extended Partition, but i am going to reinstall and hope my windows is still going to be safe.

talsemgeest
August 7th, 2008, 10:05 PM
But there is no linux partition on the extended partition from the look of that fdisk -l

lanzailan
August 13th, 2008, 07:46 PM
hi there,,
i have a problem during installing ubuntu which is unable to install grub..
will someone help me to solve this problem..
thanks..

hyz
August 14th, 2008, 01:31 AM
I reisntalled grub from the live cd. but now i can only boot into windows. when i try to boot in linux, it gives me error 17. Is there any solution?

thanks

unutbu
August 14th, 2008, 03:34 AM
Please tell us if you had a working Linux installation and now need to fix it, or if your problem is occurring right after installing Linux.
When booting, does pressing ESC take you to the GRUB menu?
Boot from the LiveCD, open a terminal (http://www.psychocats.net/ubuntu/terminal) and type


sudo fdisk -l # '-l' is a hyphen followed by lowercase L, not a one.


Please post the output.
The output of the command above should look something like this:


Device Boot Start End Blocks Id System
/dev/sda1 1 7 56196 de Dell Utility
/dev/sda2 8 660 5245222+ b W95 FAT32
/dev/sda3 * 661 38536 304238970 83 Linux
/dev/sda4 38537 38913 3028252+ 5 Extended
/dev/sda5 38537 38913 3028221 82 Linux swap / Solaris

Each line represents a partition on your hard drive.
Find the line (partition) that ends with the word "Linux". Find the device name in the first column. The device name is /dev/sda3 in the example above.

Once you have the device name, type



sudo mount /dev/sda3 /mnt # change /dev/sda3 to your Linux partition's device name
cat /mnt/boot/grub/menu.lst
blkid

Please post the output.
Extra points for wrapping your output in code tags: http://ubuntuforums.org/showpost.php?p=5490091&postcount=43

lanzailan
August 14th, 2008, 11:46 AM
Device Boot Start End Blocks Id System
/dev/sda1 * 1 9728 78140128+ 7 HPFS/NTFS
/dev/sda2 9729 38912 234420480 f W95 Ext'd (LBA)
/dev/sda5 9729 19456 78140128+ 7 HPFS/NTFS
/dev/sda6 19457 29184 78140128+ 7 HPFS/NTFS
/dev/sda7 29185 38912 78140128+ 7 HPFS/NTFS
ubuntu@ubuntu:~$ sudo mkdir /u
ubuntu@ubuntu:~$ sudo mount /dev/sda5 /u
ubuntu@ubuntu:~$ cat /u/boot/grub/menu.lst
cat: /u/boot/grub/menu.lst: No such file or directory
ubuntu@ubuntu:~$


this is what i get from the output..

unutbu
August 14th, 2008, 12:32 PM
lanzailan, your problem is that Ubuntu has not managed to install itself on your machine yet. Your problem is not strictly speaking with GRUB, it is with the Ubuntu installer.

The Ubuntu installer should ask you a few questions and then start writing files into a partition on your hard drive. Only after it is done with that (I believe) does it try to install GRUB onto the MBR. Since your fdisk output shows no Linux partition, the Ubuntu installer has not yet written any files to your hard drive.

You need to solve this problem first.

I don't know much about how to solve installation problems. Perhaps follow the instructions here https://help.ubuntu.com/community/HowToMD5SUM to check that your Ubuntu CD has been burned with no errors.

After verifying that your CD is good, try installing again. If it still does not work, perhaps try the "Alternate CD" which you can download from http://www.ubuntu.com/getubuntu/download.

lanzailan
August 14th, 2008, 03:56 PM
i've installed twice but when the progress reached 94%, the message appeared.. unable to install grub.
i've checked the ubuntu and the hashes are same..
maybe i can try the alternate CD ](*,)
i got 3 already in my collection..

talsemgeest
August 14th, 2008, 07:38 PM
Have you ever managed to install ubuntu onto that computer before? If not it is probably a hardware configuration problem.

lanzailan
August 15th, 2008, 02:20 AM
Have you ever managed to install ubuntu onto that computer before? If not it is probably a hardware configuration problem.

NO.. as i mentioned above,, "unable to install grub.. fatal error"
hardware problem?? http://www.clicksmilies.com/s1106/travesmilies/smilie_blue.gif

skaught
August 15th, 2008, 04:04 AM
Hey everyone - I've been using Ubuntu for a little over a year, and I feel like I've built up an adequate understanding of the basics. That is, of course, until something I did in Windows XP hosed my MBR, and I had to re-install Grub. (Windows would boot, but skip the Grub menu.)

I've got my handy Live CD, I can get to the terminal just fine, and following what appear to be the standard directions on Grub repair, I get the following encouraging results:



> sudo grub
Probing devices to guess BIOS drives. This may take a long time.

grub> find /boot/grub/stage1
(hd0,2)

grub> root (hd0,2)
Filesystem type is ext2fs, partition type 0x83

grub> setup (hd0)
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 (hd0)"... 16 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd0) (hd0)1+16 p (hd0,2)/boot/grub/stage2
/boot/grub/menu.lst"... succeeded
Done.

grub> quit



At this point, most articles tell you to reboot, and let grub do it's thing. "The grub menu will magically appear! Everything will work for you, and be bliss!"

Sadly, I'm getting that oft-reported black screen with a blinking white cursor (_) that indicates a fudged MBR. I've tried repeating the process three times now, with increasing meticulousness, but the results are always the same.

Some other info you may find useful. Or might not, but I figured I'd post it before someone asks for it:



ubuntu@ubuntu:~$ sudo fdisk -l

Disk /dev/hda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/hda1 * 1 3824 30716248+ 7 HPFS/NTFS
/dev/hda2 3825 9179 43014037+ f W95 Ext'd (LBA)
/dev/hda3 9390 10664 10241437+ 83 Linux
/dev/hda5 3825 4844 8193118+ b W95 FAT32
/dev/hda6 4845 5864 8193118+ b W95 FAT32
/dev/hda7 5865 6884 8193118+ e W95 FAT16 (LBA)
/dev/hda8 6885 7904 8193118+ e W95 FAT16 (LBA)
/dev/hda9 7905 8924 8193118+ 83 Linux
/dev/hda10 8925 9179 2048256 82 Linux swap / Solaris


And just for kicks, my menu.lst:



ubuntu@ubuntu:~$ sudo mkdir /U

ubuntu@ubuntu:~$ sudo mount /dev/hda3 /U

ubuntu@ubuntu:~$ cat /U/boot/grub/menu.lst

# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
default 0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 30

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu

# Pretty colours
color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=0e914720-95fb-4f9c-9464-2f73ee19d156 ro

## Setup crashdump menu entries
## e.g. crashdump=1
# crashdump=0

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,2)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash

## should update-grub lock old automagic boot options
## e.g. lockold=false
## lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

## ## End Default Options ##

title Ubuntu 8.04.1, kernel 2.6.24-19-386
root (hd0,2)
kernel /boot/vmlinuz-2.6.24-19-386 root=UUID=0e914720-95fb-4f9c-9464-2f73ee19d156 ro quiet splash
initrd /boot/initrd.img-2.6.24-19-386

title Ubuntu 8.04.1, kernel 2.6.24-19-386 (recovery mode)
root (hd0,2)
kernel /boot/vmlinuz-2.6.24-19-386 root=UUID=0e914720-95fb-4f9c-9464-2f73ee19d156 ro single
initrd /boot/initrd.img-2.6.24-19-386

title Ubuntu 8.04.1, memtest86+
root (hd0,2)
kernel /boot/memtest86+.bin

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
#title Other operating systems:
#root

# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
#title Windows XP Pro
#root (hd0,0)
#savedefault
#makeactive
#chainloader +1


Yes, the Windows listing on the end is commented out. I did that, because I don't really care if Windows works at this point, or not. I can get that back later; right now, I just want Ubuntu!

Am I missing something glaringly obvious? Do I have cookie crumbs on my hard drive platter? Did I misspell hd0? There's gotta be something, right?

Muchas gracias & merci, in advance.

EDIT: Some bonus output, since I have nothing else to do tonight except watch the Olympics. Have some fstab. You'll note the phrase "/boot" is nowhere to be found. Significant?



# /etc/fstab: static file system information.
#
# -- This file has been automaticly generated by ntfs-config --
#
# <file system> <mount point> <type> <options> <dump> <pass>

proc /proc proc defaults 0 0
# Entry for /dev/hda3 :
UUID=0e914720-95fb-4f9c-9464-2f73ee19d156 / ext3 defaults,errors=remount-ro 0 1
# Entry for /dev/hda9 :
UUID=bee1e062-b084-4a61-933b-c3c5ab28ac5b /home ext3 defaults 0 2
# Entry for /dev/hda1 :
UUID=A648FD1748FCE6C9 /media/hda1 ntfs-3g defaults,locale=en_US.UTF-8 0 0
# Entry for /dev/hda5 :
UUID=0B8C-6D80 /media/hda5 vfat defaults 0 0
# Entry for /dev/hda6 :
UUID=246D-1D71 /media/hda6 vfat defaults 0 0
# Entry for /dev/hda7 :
UUID=4485-BE68 /media/hda7 vfat defaults 0 0
# Entry for /dev/hda8 :
UUID=4485-BE69 /media/hda8 vfat defaults 0 0
/dev/hdb1 /media/hdb1 ntfs-3g defaults,locale=en_US.UTF-8 0 0
# Entry for /dev/hda10 :
UUID=79d484ac-e36e-413e-8e34-2c72c14a3233 none swap sw 0 0
/dev/cdrom /media/cdrom0 udf,iso9660 user,noauto 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto 0 0

unutbu
August 15th, 2008, 05:00 AM
Are there any other drives that the BIOS might be handing-off to during the boot process?
A USB flash drive or something like that? If there is, try booting with it disconnected.

If there are no other drives, then I'm stumped.

Everything you posted looks perfect. It looks like GRUB has been installed on /dev/hda's MBR. But to be even more sure, perhaps boot from the LiveCD and type


sudo dd if=/dev/hda bs=512 count=1 | hexdump -C # This will print your MBR

You should get this (or something very close to this):

1+0 records in
1+0 records out
512 bytes (512 B) copied, 2.2036e-05 seconds, 23.2 MB/s
00000000 eb 48 90 00 00 00 00 00 00 00 00 00 00 00 00 00 |.H..............|
00000010 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
00000030 00 00 00 00 00 00 00 00 00 00 00 00 00 00 03 02 |................|
00000040 ff 00 00 80 14 43 e6 08 00 08 fa 90 90 f6 c2 80 |.....C..........|
00000050 75 02 b2 80 ea 59 7c 00 00 31 c0 8e d8 8e d0 bc |u....Y|..1......|
00000060 00 20 fb a0 40 7c 3c ff 74 02 88 c2 52 be 7f 7d |. ..@|<.t...R..}|
00000070 e8 34 01 f6 c2 80 74 54 b4 41 bb aa 55 cd 13 5a |.4....tT.A..U..Z|
00000080 52 72 49 81 fb 55 aa 75 43 a0 41 7c 84 c0 75 05 |RrI..U.uC.A|..u.|
00000090 83 e1 01 74 37 66 8b 4c 10 be 05 7c c6 44 ff 01 |...t7f.L...|.D..|
000000a0 66 8b 1e 44 7c c7 04 10 00 c7 44 02 01 00 66 89 |f..D|.....D...f.|
000000b0 5c 08 c7 44 06 00 70 66 31 c0 89 44 04 66 89 44 |\..D..pf1..D.f.D|
000000c0 0c b4 42 cd 13 72 05 bb 00 70 eb 7d b4 08 cd 13 |..B..r...p.}....|
000000d0 73 0a f6 c2 80 0f 84 ea 00 e9 8d 00 be 05 7c c6 |s.............|.|
000000e0 44 ff 00 66 31 c0 88 f0 40 66 89 44 04 31 d2 88 |D..f1...@f.D.1..|
000000f0 ca c1 e2 02 88 e8 88 f4 40 89 44 08 31 c0 88 d0 |........@.D.1...|
00000100 c0 e8 02 66 89 04 66 a1 44 7c 66 31 d2 66 f7 34 |...f..f.D|f1.f.4|
00000110 88 54 0a 66 31 d2 66 f7 74 04 88 54 0b 89 44 0c |.T.f1.f.t..T..D.|
00000120 3b 44 08 7d 3c 8a 54 0d c0 e2 06 8a 4c 0a fe c1 |;D.}<.T.....L...|
00000130 08 d1 8a 6c 0c 5a 8a 74 0b bb 00 70 8e c3 31 db |...l.Z.t...p..1.|
00000140 b8 01 02 cd 13 72 2a 8c c3 8e 06 48 7c 60 1e b9 |.....r*....H|`..|
00000150 00 01 8e db 31 f6 31 ff fc f3 a5 1f 61 ff 26 42 |....1.1.....a.&B|
00000160 7c be 85 7d e8 40 00 eb 0e be 8a 7d e8 38 00 eb ||..}.@.....}.8..|
00000170 06 be 94 7d e8 30 00 be 99 7d e8 2a 00 eb fe 47 |...}.0...}.*...G|
00000180 52 55 42 20 00 47 65 6f 6d 00 48 61 72 64 20 44 |RUB .Geom.Hard D|
00000190 69 73 6b 00 52 65 61 64 00 20 45 72 72 6f 72 00 |isk.Read. Error.|
000001a0 bb 01 00 b4 0e cd 10 ac 3c 00 75 f4 c3 00 00 00 |........<.u.....|
000001b0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
00000200

Look for "GRUB .Geom.Hard Disk.Read. Error." on lines 17--19.

If you confirm that GRUB is on your MBR, then the only thing I can imagine that might cause the blinking white cursor on a black screen would be if the BIOS is not handing off to the MBR on /dev/hda. If there is no other drive present then why that might be, I do not know.

skaught
August 15th, 2008, 05:11 AM
Well, thanks! Turns out GRUB is in fact in the MBR, so this isn't the solution I'd hoped for, but I didn't know you could look over the MBR like that. Learning something new is almost as good as getting things working again, right?

(I don't know why I'd be surprised about being able to find ANY info in Linux, of course. I guess Microsoft's "every-zing! iz! proprietary!!" brainwashing is pretty effective.)


ubuntu@ubuntu:~$ sudo dd if=/dev/hda bs=512 count=1 | hexdump -C # This will print your MBR
1+0 records in
1+0 records out
512 bytes (512 B) copied, 6.3e-05 seconds, 8.1 MB/s
00000000 eb 49 90 d0 bc 00 7c fb 50 07 50 1f fc be 1b 7c |.I....|.P.P....||
00000010 bf 1b 06 50 57 b9 e5 01 f3 a4 cb bd be 07 b1 04 |...PW...........|
00000020 38 6e 00 7c 09 75 13 83 c5 10 e2 f4 cd 18 8b f5 |8n.|.u..........|
00000030 83 c6 10 49 74 19 38 2c 74 f6 a0 b5 07 b4 03 02 |...It.8,t.......|
00000040 ff 00 00 20 01 00 00 00 00 02 ff 90 90 ca 00 ea |... ............|
00000050 54 7c 00 00 31 c0 8e d8 8e d0 bc 00 20 fb a0 40 |T|..1....... ..@|
00000060 7c 3c ff 74 02 88 c2 52 be 8a 7d e8 44 01 f6 c2 ||<.t...R..}.D...|
00000070 80 74 55 b4 41 bb aa 55 cd 13 5a 52 72 4a 81 fb |.tU.A..U..ZRrJ..|
00000080 55 aa 75 44 a0 41 7c 84 c0 75 05 83 e1 01 74 38 |U.uD.A|..u....t8|
00000090 66 8b 4c 10 be 05 7c c6 44 ff 01 66 8b 1e 44 7c |f.L...|.D..f..D||
000000a0 c7 04 10 00 c7 44 02 01 00 66 89 5c 08 c7 44 06 |.....D...f.\..D.|
000000b0 00 70 66 31 c0 89 44 04 66 89 44 0c b4 42 cd 13 |.pf1..D.f.D..B..|
000000c0 72 06 bb 00 70 e9 8c 00 b4 08 cd 13 73 19 f6 c2 |r...p.......s...|
000000d0 80 0f 84 ee 00 a0 4a 7c 3c ff 74 08 38 c2 74 04 |......J|<.t.8.t.|
000000e0 88 c2 eb 83 e9 8d 00 be 05 7c c6 44 ff 00 66 31 |.........|.D..f1|
000000f0 c0 88 f0 40 66 89 44 04 31 d2 88 ca c1 e2 02 88 |...@f.D.1.......|
00000100 e8 88 f4 40 89 44 08 31 c0 88 d0 c0 e8 02 66 89 |...@.D.1......f.|
00000110 04 66 a1 44 7c 66 31 d2 66 f7 34 88 54 0a 66 31 |.f.D|f1.f.4.T.f1|
00000120 d2 66 f7 74 04 88 54 0b 89 44 0c 3b 44 08 7d 3c |.f.t..T..D.;D.}<|
00000130 8a 54 0d c0 e2 06 8a 4c 0a fe c1 08 d1 8a 6c 0c |.T.....L......l.|
00000140 5a 8a 74 0b bb 00 70 8e c3 31 db b8 01 02 cd 13 |Z.t...p..1......|
00000150 72 2a 8c c3 8e 06 48 7c 60 1e b9 00 01 8e db 31 |r*....H|`......1|
00000160 f6 31 ff fc f3 a5 1f 61 ff 26 42 7c be 90 7d e8 |.1.....a.&B|..}.|
00000170 40 00 eb 0e be 95 7d e8 38 00 eb 06 be 9f 7d e8 |@.....}.8.....}.|
00000180 30 00 be a4 7d e8 2a 00 eb fe 47 52 55 42 20 00 |0...}.*...GRUB .|
00000190 47 65 6f 6d 00 48 61 72 64 20 44 69 73 6b 00 52 |Geom.Hard Disk.R|
000001a0 65 61 64 00 20 45 72 72 6f 72 00 bb 01 00 b4 0e |ead. Error......|
000001b0 cd 10 ac 3c 00 75 f4 c3 b4 cb f9 00 00 00 80 01 |...<.u..........|
000001c0 01 00 07 fe ff ff 3f 00 00 00 b1 62 a9 03 00 00 |......?....b....|
000001d0 c1 ff 0f fe ff ff f0 62 a9 03 2b af 20 05 00 fe |.......b..+. ...|
000001e0 ff ff 83 fe ff ff 6d 8c fd 08 3b 8b 38 01 00 00 |......m...;.8...|
000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
00000200

I DID have a digital camera plugged in, but not powered up. I'll remove it and reboot, just to see if it makes a lick of difference. After that... um... flash my BIOS? *shudder*

talsemgeest
August 15th, 2008, 05:17 AM
Ok looks like you have two linux installations. Just in case, can you use (hd0,8) instead of (hd0,2). The thing is, if grub is installed on two different partitions it can tend to stump this process. Worth a shot and I hope it helps.

skaught
August 15th, 2008, 05:30 AM
I'm not 100% positive, since it's been a while since I set it up, but I think hd(0,8)/hda9 is an ext3 partition for my /home folder. I don't believe it's an additional installation of Ubuntu. Wouldn't "grub> find /boot/grub/stage1" return more than one result if there was a full install there?

Another possibility I've found mentions of is that my device.map file in the grub folder might not be configured correctly. Does that seem like a plausible problem? (Like, could an automatic package update goof that up? I'm pretty-darned-sure I've never edited anything in there except menu.lst.)

EDIT: Forgot to post code, eh?


ubuntu@ubuntu:~$ cat /U/boot/grub/device.map
(hd0) /dev/hda
(hd1) /dev/hdb

talsemgeest
August 15th, 2008, 08:43 AM
Yeah, it sounds fair enough. I'm afraid you have stumped me though. All I can do is tell you that if I was in your situation I would back up and reinstall, but that is easier for some than others...

skaught
August 15th, 2008, 01:33 PM
I'm going to keep looking for options. Re-installing the OS is the WINDOWS way, and part of the reason I switched to Ubuntu. I want control of my computer, even if I have to learn arcane and esoteric things to achieve it.

unutbu
August 15th, 2008, 04:09 PM
One curious thing I noted was that in your MBR the word GRUB begins at offset 0x18a.

According to http://www.geocities.com/thestarman3/asm/mbr/GRUB.htm:


Offset of the word "GRUB" GRUB version
0x176 0.92, 0.93
0x179 0.94, 0.95
0x17B 0.94 SuSE 9.1
0x17F 0.97 <-- Gutsy and Hardy
0x18A Yours

Which Live CD are you using? And next time you boot the LiveCD, please type


grub --version
It would be interesting to know what version of GRUB puts "GRUB" at offset 0x18A.

PS. 0x18A refers to the 18th line in the output, and hexadecimal 'A' refers to the 10th character in the line.

Given that your Live CD is somehow different, and since your method seems right but the result did not work, perhaps try a Hardy Live CD, repeat the grub commands you used to install GRUB to the MBR, and see if that works better.

skaught
August 15th, 2008, 04:53 PM
Oh!! Well, there's a notion. The last live CD I had was for 6.06, which is what I used to repair grub. I thought that:


grub> root (hd0,2)

meant "install using the grub files found on this hard drive". But what the heck - trying a newer live CD can hardly hurt, right?

I've burned an 8.04 CD today; I'll give that a shot when I get home later.

unutbu
August 15th, 2008, 05:36 PM
skaught, you are right -- "root (hd0,2)" followed by "setup (hd0)" copies the stage1 file from (hd0,2)/boot/grub/ to the MBR. There are some slight differences between stage1 and what gets put on the MBR, but I don't think that matters here.

Hm. Maybe what I suggested above (retrying with a Hardy LiveCD) is not going to make a lick of difference since it would still be using the same stage1 file.

Maybe try it anyway. If it doesn't work, then perhaps force GRUB to rewrite the stage1, e2fs_stage1_5 and stage2 files:

Boot from the LiveCD


sudo mount /dev/hda3 /mnt
sudo mkdir /mnt/boot/grub-20080815 # Make a backup of /boot/grub
sudo cp -a /mnt/boot/grub/* /mnt/boot/grub-20080815
gksu gedit /mnt/boot/grub/device.map
Remove the (hd1) line in device.map so that it looks like this:


(hd0) /dev/hda
I don't think this is really the problem, but we might as well make it appropriate for your situation just in case.


grub-install --root-directory=/mnt --recheck /dev/hda
sudo dd if=/dev/hda bs=512 count=1 | hexdump -C # Note where "GRUB" starts
reboot


The /usr/sbin/grub-install script replaces the stage* files in /mnt/boot/grub with ones found in /usr/lib/grub/i386-pc. It then installs them on the MBR and subsequent sectors.

psusi
August 16th, 2008, 03:10 AM
Everything looks perfect. The only thing that I can think of is that grub might not be using LBA mode ( though it should since your root partition starts beyond cylinder 1024 ), so when you install it you might try forcing LBA mode. Check with help setup in grub, but I think you just need to add --force-lba or something to the setup command.

bebopsan
August 17th, 2008, 11:08 PM
Hello.

I have this same problem of reinstalling windows and not being able to boot with Grub. i saw many posts including this and have tried with this particular solution, but when i enter the command setup (hd0) the terminal returns this error:

grub> setup (hd0)
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 (hd0)"... 16 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd0) (hd0)1+16 p (hd0,5)/boot/grub/stage2
/boot/grub/menu.lst"... failed

Error 12: Invalid device requested

i would really apreciate your help, thanks!.

caljohnsmith
August 17th, 2008, 11:24 PM
Hello.

I have this same problem of reinstalling windows and not being able to boot with Grub. i saw many posts including this and have tried with this particular solution, but when i enter the command setup (hd0) the terminal returns this error:

grub> setup (hd0)
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 (hd0)"... 16 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd0) (hd0)1+16 p (hd0,5)/boot/grub/stage2
/boot/grub/menu.lst"... failed

Error 12: Invalid device requested

i would really apreciate your help, thanks!.
Interesting, I helped someone a few days ago with that kind of problem, and unfortunately it turns out that something corrupted his HDD's partition table. How about running:

sudo testdisk
Go through the prompts until you get to the point where you can select the "analyze" option, and do that. Please copy the results of that back here, and also post the results of:

sudo fdisk -l

Islington
August 22nd, 2008, 02:58 AM
worked like a charm!

how do I get grub to see my windows partition? :confused:

caljohnsmith
August 22nd, 2008, 03:05 AM
worked like a charm!

how do I get grub to see my windows partition? :confused:
You need to add an entry for Windows in your /boot/grub/menu.lst. If your Windows partition is on your first HDD, first partition, the entry would be:

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

You need to change (hd0,0) to whatever partition your Windows is on if different. If you need more details let me know.

Islington
August 22nd, 2008, 03:16 AM
You need to add an entry for Windows in your /boot/grub/menu.lst. If your Windows partition is on your first HDD, first partition, the entry would be:

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

You need to change (hd0,0) to whatever partition your Windows is on if different. If you need more details let me know.

so if mine is on the first HDD, 3rd partition; (hd0,2)?

thanks for the fast reply, didnt expect that :)

edit: cant count.

caljohnsmith
August 22nd, 2008, 03:19 AM
so if mine is on the first HDD, 3rd partition; (hd0,2)?

Yes. :)

Islington
August 22nd, 2008, 03:49 AM
Yes. :)

guess I did something wrong. I added the section before the various linux sections, and now I can only boot into windows! if I enter it after then I can only boot into linux.:confused:

unutbu
August 22nd, 2008, 03:53 AM
Hm. Can you post the relevant section of your menu.lst?

Islington
August 22nd, 2008, 04:03 AM
Hm. Can you post the relevant section of your menu.lst?

gimme a minute, I need to reinstall grub.

Islington
August 22nd, 2008, 04:15 AM
oh gosh. I feel really dumb. The reason it was doing that is because I have to hit esc key to see the menu, and the coundown for this is only 3 seconds. After the 3 seconds were passed, grub boots whatever is on the top of the list.

Is there a way to increase the grub countdown time?

edit: struck with teh dumb again.


## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 3

after 2 seconds of googling. :(

wide-load
August 23rd, 2008, 02:01 AM
Thanks a lot. I followed the directions and it worked great. You saved me hours of work.:)

KPryor
August 29th, 2008, 06:53 AM
Just wanted to add my own appreciation for the help given in this thread. I got too brave tonight, playing with things on my laptop and screwed up my grub. This thread had me booting up like normal in no time. Thanks to all, especially catlett!
KP

k3ntegra
August 31st, 2008, 02:10 AM
Hey guys i got to the 2nd step of the first post and got the following message



grub> find /boot/grub/stage1
find /boot/grub/stage1

Error 15: File not found
grub>

k3ntegra
August 31st, 2008, 02:11 AM
Hey guys i got to the 2nd step of the first post and got the following message



grub> find /boot/grub/stage1
find /boot/grub/stage1

Error 15: File not found
grub>


Please can someone help me, i've been struggling for the past hours trying to figure this out..

caljohnsmith
August 31st, 2008, 02:12 AM
Hey guys i got to the 2nd step of the first post and got the following message



grub> find /boot/grub/stage1
find /boot/grub/stage1

Error 15: File not found
grub>

Try:

grub> find /grub/stage1
And see if that returns anything.

k3ntegra
August 31st, 2008, 02:17 AM
Try:

grub> find /grub/stage1
And see if that returns anything.


I get the same message too :(



grub> find /grub/stage1
find /grub/stage1

Error 15: File not found
grub>


also i typed stageONE not stageL

caljohnsmith
August 31st, 2008, 02:29 AM
Are you sure you are running Grub as root?

sudo grub

k3ntegra
August 31st, 2008, 03:12 AM
Are you sure you are running Grub as root?

sudo grub

yes i did. i also checked the cd for any errors and there were none.

k3ntegra
August 31st, 2008, 05:23 PM
after resintalling ubuntu as "Guided install" instead of "manual install", i was able to fully install it. Because of this i was able to the following things the original poster wrote,
http://ubuntuforums.org/showthread.php?t=224351

but i still get grub error at start up and i still get it when i try to use super grub cd.



ubuntu@ubuntu:~$ sudo mkdir /mnt/root
ubuntu@ubuntu:~$ sudo grub
Probing devices to guess BIOS drives. This may take a long time.

[ 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> find /boot/grub/stage1
find /boot/grub/stage1
(hd2,7)
grub> root (hd2,7)
root (hd2,7)
grub> setup (hd0)
setup (hd0)
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 (hd0)"... 16 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 d (hd0) (hd0)1+16 p (hd2,7)/boot/grub/stage2 /boot/grub/menu.lst"... succeeded
Done.
grub> quit
quit
ubuntu@ubuntu:~$

caljohnsmith
August 31st, 2008, 05:34 PM
k3ntegra, you have at least three HHDs, so your set up is not as simple. What Grub error are you getting on start up? Do you see the Grub menu on start up? Also post the following from a Live CD:

sudo fdisk -lu
sudo mount /dev/sdc8 /mnt
cat /mnt/boot/grub/menu.lst

k3ntegra
August 31st, 2008, 05:53 PM
k3ntegra, you have at least three HHDs, so your set up is not as simple. What Grub error are you getting on start up? Do you see the Grub menu on start up? Also post the following from a Live CD:

sudo fdisk -lu
sudo mount /dev/sdc8 /mnt
cat /mnt/boot/grub/menu.lst

i get grub error 22 at startup and error 15 in super grub cd



ubuntu@ubuntu:~$ sudo fdisk -lu

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders, total 976773168 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xa1c95ffb

Device Boot Start End Blocks Id System
/dev/sda1 * 63 83891429 41945683+ 82 Linux swap / Solaris
/dev/sda2 83891430 530578754 223343662+ 7 HPFS/NTFS
/dev/sda3 530578755 763360604 116390925 7 HPFS/NTFS
/dev/sda4 763360605 976768064 106703730 7 HPFS/NTFS

Disk /dev/sdb: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x0f120f11

Device Boot Start End Blocks Id System
/dev/sdb1 16065 75441239 37712587+ f W95 Ext'd (LBA)
/dev/sdb2 * 75441240 312576704 118567732+ 7 HPFS/NTFS
/dev/sdb5 16128 75441239 37712556 7 HPFS/NTFS

Disk /dev/sdc: 320.0 GB, 320072933376 bytes
16 heads, 63 sectors/track, 620181 cylinders, total 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x963c764f

Device Boot Start End Blocks Id System
/dev/sdc1 1008 625140431 312569712 f W95 Ext'd (LBA)
/dev/sdc5 1071 313197695 156598312+ 7 HPFS/NTFS
/dev/sdc6 313197759 323501471 5151856+ e W95 FAT16 (LBA)
/dev/sdc7 397084527 625140335 114027904+ 7 HPFS/NTFS
/dev/sdc8 323501535 393968735 35233600+ 83 Linux
/dev/sdc9 393968799 397084463 1557832+ 82 Linux swap / Solaris

Partition table entries are not in disk order

Disk /dev/sdd: 2030 MB, 2030043136 bytes
255 heads, 63 sectors/track, 246 cylinders, total 3964928 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x00717db6

Device Boot Start End Blocks Id System
/dev/sdd1 63 3964927 1982432+ e W95 FAT16 (LBA)
Partition 1 has different physical/logical endings:
phys=(245, 254, 63) logical=(246, 205, 23)
ubuntu@ubuntu:~$ sudo mount/dev/sdc8 /mnt
sudo: mount/dev/sdc8: command not found
ubuntu@ubuntu:~$ sudo mount /dev/sdc8 /mnt
ubuntu@ubuntu:~$ cat /mnt/boot/grub/menu.lst
# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not use 'savedefault' or your
# array will desync and will not let you boot your system.
default 0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 10

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu

# Pretty colours
#color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=f333669b-b8f5-42fb-9bb6-70f083137076 ro

## Setup crashdump menu entries
## e.g. crashdump=1
# crashdump=0

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd2,7)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash

## should update-grub lock old automagic boot options
## e.g. lockold=false
## lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

## ## End Default Options ##

title Ubuntu 8.04.1, kernel 2.6.24-19-generic
root (hd2,7)
kernel /boot/vmlinuz-2.6.24-19-generic root=UUID=f333669b-b8f5-42fb-9bb6-70f083137076 ro quiet splash
initrd /boot/initrd.img-2.6.24-19-generic
quiet

title Ubuntu 8.04.1, kernel 2.6.24-19-generic (recovery mode)
root (hd2,7)
kernel /boot/vmlinuz-2.6.24-19-generic root=UUID=f333669b-b8f5-42fb-9bb6-70f083137076 ro single
initrd /boot/initrd.img-2.6.24-19-generic

title Ubuntu 8.04.1, memtest86+
root (hd2,7)
kernel /boot/memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title Other operating systems:
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sdb2
title Windows NT/2000/XP (loader)
root (hd1,1)
savedefault
makeactive
map (hd0) (hd1)
map (hd1) (hd0)
chainloader +1


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/sdc6.
title Ubuntu 8.04.1 (8.04) (on /dev/sdc6)
root (hd2,5)
kernel /boot/vmlinuz-2.6.24-19-generic root=/dev/sdc6
initrd /boot/initrd.img-2.6.24-19-generic
savedefault
boot

ubuntu@ubuntu:~$

caljohnsmith
August 31st, 2008, 06:12 PM
Is the Grub error 22 on start up before you see a Grub menu, or after you select an OS entry in the Grub menu?

k3ntegra
August 31st, 2008, 06:29 PM
it is before i see an os selection menu. I wouldnt mind deleting the partition that contains windows xp on the 160gb harddrive, unfortunately gparted wont let me.

caljohnsmith
August 31st, 2008, 06:37 PM
it is before i see an os selection menu. I wouldnt mind deleting the partition that contains windows xp on the 160gb harddrive, unfortunately gparted wont let me.
That may be part of the issue--what do you mean gparted won't let you delete that partition? Are you running gparted from a Live CD with:

gksudo gparted
What does that show or what is the problem?

k3ntegra
August 31st, 2008, 06:58 PM
That may be part of the issue--what do you mean gparted won't let you delete that partition? Are you running gparted from a Live CD with:

gksudo gparted
What does that show or what is the problem?

when i ran gparted to delete and reformat the partition with windows on it and then clicked apply i got an error message

when i run the code it gives the following


ubuntu@ubuntu:~$ gskudo gparted
bash: gskudo: command not found
ubuntu@ubuntu:~$ gksudo gparted
======================
libparted : 1.7.1
======================
Unable to open /dev/fd0 read-write (Read-only file system). /dev/fd0 has been opened read-only.
Input/output error during read on /dev/fd0
Unable to open /dev/scd0 read-write (Read-only file system). /dev/scd0 has been opened read-only.
Unable to open /dev/scd0 read-write (Read-only file system). /dev/scd0 has been opened read-only.
Unable to open /dev/scd0 - unrecognised disk label.



edit:
i was able to reformat the partition with xp on it to an ext3, and now windows is no more, i'll try to give it try now..

when i tried SUDO grub with (hd0,0) instead of just (hd0), i got a "failed" message.



find /boot/grub/stage1
(hd2,7)
grub> root (hd2,7)
root (hd2,7)
grub> setup (hd0,0)
setup (hd0,0)
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 (hd0,0)"... failed (this is not fatal)
Running "embed /boot/grub/e2fs_stage1_5 (hd2,7)"... failed (this is not fatal)
Running "install /boot/grub/stage1 d (hd0,0) /boot/grub/stage2 p /boot/grub/menu.lst "... succeeded
Done.
grub>


edit2:
still getting the same error after deleting the partition with windows on it..

unutbu
August 31st, 2008, 07:50 PM
After you get Error 22, can you get to a GRUB prompt? You might have to press ESC, return or space.

If you can get to a grub prompt, what output do you see if you type


geometry (hd2)
geometry (hd1)
geometry (hd0)
geometry (hd3)

One of these should show a drive with five partitions (it does not show extended partitions). Which one is it?

k3ntegra
August 31st, 2008, 08:20 PM
After you get Error 22, can you get to a GRUB prompt? You might have to press ESC, return or space.

If you can get to a grub prompt, what output do you see if you type


geometry (hd2)
geometry (hd1)
geometry (hd0)
geometry (hd3)

One of these should show a drive with five partitions (it does not show extended partitions). Which one is it?

i didn't get a grub prompt after pressing those keys, i tried all the and even some alt keys and no response. all i could do was ctrl alt del to do a system restart.

unutbu
August 31st, 2008, 09:21 PM
k3ntegra, when you install GRUB, GRUB uses Linux's drive order to number the drives. Linux sees /dev/sdc as your third drive. When you boot, GRUB uses the BIOS's drive order to number the drives. Usually Linux and the BIOS agree on the drive order, but in some cases, they don't. I am beginning to suspect that this is happening in your case.

You can try to fix this problem by physically unplugging your drives from the data cable or USB ports and reconnecting them in different locations. I am not familiar with the ins-and-outs of master vs. slave drives, setting dip switches and so forth, so I shy away from this solution. However, if you understand what is needed to swap drive locations, then this might be the easiest way .

If you do not want to swap the drives, there is also a way to fix this using /boot/grub/device.map. See http://ubuntuforums.org/showpost.php?p=3518911&postcount=9 and http://users.bigpond.net.au/hermanzone/p15.htm#device.map.


There is one problem. I don't know how to determine a priori what your BIOS thinks is your drive order. If we unplug the 2GB flash drive, we have 3 drives to worry about. There are then 6 cases:

Each line of the table below shows the association between the drives in GRUB's (hdx) terminology and Linux's /dev/sdy terminology:

Case 1:


GRUB using BIOS order Linux order # This is the default order that you are currently using
(hd0) /dev/sda
(hd1) /dev/sdb
(hd2) /dev/sdc # Linux is on sdc


Case 2:


GRUB using BIOS order Linux order # We know Linux is not booting when we
(hd1) /dev/sda # associate /dev/sdc with (hd2), so
(hd0) /dev/sdb # we can discount this possibility
(hd2) /dev/sdc


We know these first two don't/won't work. The next four are all possibilities.

The next two assume /dev/sdc is what the BIOS sees as (hd1):

Case 3:


GRUB using BIOS order Linux order
(hd0) /dev/sda
(hd2) /dev/sdb
(hd1) /dev/sdc


Case 4:


GRUB using BIOS order Linux order
(hd2) /dev/sda
(hd0) /dev/sdb
(hd1) /dev/sdc


I propose you try mbwardle's solution assuming Case 3 is true. I wrote out instructions below. If they do not work, then we know both Case 3 and Case 4 are not true because we will have discovered that /dev/sdc is not what the BIOS sees as (hd1).

If you can boot Linux using the instructions below, then great. We'll know we are in either Case 3 or Case 4. If you still can not boot, then we'll know we are in either Case 5 or Case 6. You can then repeat the instructions below with a slight and obvious adjustment to device.map and menu.lst. (After reading the instructions below, if it isn't obvious, ask.)

Case 5:


GRUB using BIOS order Linux order
(hd1) /dev/sda
(hd2) /dev/sdb
(hd0) /dev/sdc


Case 6:


GRUB using BIOS order Linux order
(hd2) /dev/sda
(hd1) /dev/sdb
(hd0) /dev/sdc


Using this method and a bit of trial and error, you hopefully will be able to boot your OSs.

Here are mbwardle's instructions adapted to your situation:

Unplug the 2GB flash drive from your system. That will give us one less drive to worry about.


Boot from the Ubuntu CD
Open a Terminal (Applications->Accessories->Terminal)
Type


sudo mount /dev/sdc8 /mnt # mount your Linux partition
sudo cp /mnt/boot/grub/device.map /mnt/boot/grub/device.map-20080831 # backup to be safe
gksu gedit /mnt/boot/grub/device.map

Edit the device map to look like this:


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

Save and exit gedit.
At the terminal type


sudo grub --device-map=/mnt/boot/grub/device.map
root (hd1,7)
setup (hd0)
quit

Back at the terminal type


gksu gedit /mnt/boot/grub/menu.lst

So a search and replace, replacing all occurrences of (hd2,7) with (hd1,7).
Save and exit.
Reboot

k3ntegra
August 31st, 2008, 10:31 PM
when i type sudo grub --device.map=device.map , i get the following




ubuntu@ubuntu:~$ sudo grub --device.map=device.map
grub: unrecognized option `--device.map=device.map'
Try ``grub --help'' for more information.
ubuntu@ubuntu:~$

unutbu
September 1st, 2008, 02:15 AM
Doh! #-o Sorry about that. The correct line is


sudo grub --device-map=/mnt/boot/grub/device.map

k3ntegra
September 1st, 2008, 04:53 AM
Doh! #-o Sorry about that. The correct line is


sudo grub --device-map=/mnt/boot/grub/device.map


well unfotunately this didnt work, and also when i tried to reload live cd i got io buffer errors. I also found out because of grub becoming the default bootloader of my system , it prevented windows xp to format a partition to install itself. so i physically disconnected the two other harddisks that i tried to install ubuntu on and connected the hard disk i wanted to install windows on to sata port 0. i guess now i can install ubuntu from windows and not worry about some dumb grub error, if i wanted too. Anyway thanks for all your help "ubuntu", i appreciate it.

umuero
September 2nd, 2008, 04:53 PM
I've recently faced the grub fatal error on installation;

It was caused by the faulty partition type at the partition table (because i've created the partition in windows);

it can be checked by
sudo fdisk -l /dev/sda
showed
....
/dev/sdb2 * 1658 2702 8393962+ e W95 FAT16 (LBA)
....
while it was formatted in ext3 and should be
/dev/sdb2 * 1658 2702 8393962+ 83 Linux
....

it can be set by fdisk
t change a partition's system id

hope this helps.

alx1880
September 6th, 2008, 04:37 AM
Hello, i got error 22 but everytime i type find /boot/grub/stage1, no file is found, no success either with setup(hd0), what can i do?

unutbu
September 6th, 2008, 02:40 PM
alx1880, we'll need some more information to help you.
Please take a look here:
http://ubuntuforums.org/showpost.php?p=5584686&postcount=465

melerz
September 6th, 2008, 03:34 PM
Hey everyone =]
[I`m new to the linux environment]
Recently I`v installed the newest Ubuntu distrubtion [8.0.4.1].
It may be useful to say that this is the first linux-based system I install on the current machine.
The problem is that after the installation, when the computer restart, I can't see any boot menu, but the same screen I had before and the windows boot up regulary.
I loaded the live-cd, wrote the "sudo fdisk -lu" and recognized the system
partition -> /dev/sda2.

In addition, I typed
"sudo mount /dev/sda3 /mnt"
but error has been occured:
-Special device /dev/sda2 /mnt doesn't exist--

other method I`v tried is:


sudo grub
find /boot/grub/stage1
->hd0,1<-
root (hd0,1)
setup (hd0)

*after I press enter, it says that he can't find menu.lst and below there
is a line: Error 22: No such partition [something like this form] *

Thank you all, thank you :]

caljohnsmith
September 6th, 2008, 03:43 PM
Hey everyone =]
[I`m new to the linux environment]
Recently I`v installed the newest Ubuntu distrubtion [8.0.4.1].
It may be useful to say that this is the first linux-based system I install on the current machine.
The problem is that after the installation, when the computer restart, I can't see any boot menu, but the same screen I had before and the windows boot up regulary.
I loaded the live-cd, wrote the "sudo fdisk -lu" and recognized the system
partition -> /dev/sda2.

In addition, I typed
"sudo mount /dev/sda3 /mnt"
but error has been occured:
-Special device /dev/sda2 /mnt doesn't exist--

other method I`v tried is:

*after I press enter, it says that he can't find menu.lst and below there
is a line: Error 22: No such partition [something like this form] *

Thank you all, thank you :]
So is Ubuntu on sda2 or sda3? Is the sda3 above a typo? Please post the full output of:

sudo fdisk -lu
So we can get a better idea of your partitioning. Also, if Grub successfully finds stage1 but then complains about "no such partition" when you give it the correct (hdX,Y), it might mean there is something wrong with your partition table. But post the output of the fdisk command first and we can go from there.

melerz
September 6th, 2008, 04:19 PM
thank you for the fast replay.
Sorry about the typing mistake, I ment sda2 not 3.
here is some screenshots:

"sudo fdisk -lu"
http://img357.imageshack.us/my.php?image=11657583wb9.jpg

"sudo mount /dev/sda2 /mnt"
http://img395.imageshack.us/my.php?image=20378677gn2.jpg

thank you.

P.S
I have two drives.
one is 160GB and completly belongs to WINDOWS, and the other one
is 40GB divided into 3 partitions:
- NTFS, belongs to windows.
-ext3, where the Ubuntu is installed.
-swap

caljohnsmith
September 6th, 2008, 04:47 PM
That is certainly a strange error that mount is giving you, because /dev/sda2 should exist, at least according to fdisk. Try the following:

ls -l /dev/sd*
sudo fsck /dev/sda2
Please post the output of only the first command, and if the second command asks you to fix anything, be sure to say "y".

melerz
September 6th, 2008, 05:07 PM
"ls -l /dev/sd*"

http://img224.imageshack.us/my.php?image=73846098uu5.jpg

Although you asked not to do so here is the second output:

http://img398.imageshack.us/my.php?image=28578544gw8.jpg

thank you.

caljohnsmith
September 6th, 2008, 05:37 PM
That is really strange that fdisk shows your partitions, and yet they are not even listed devices in your /dev directory. Let's start clean just to make sure it's not some transient bug; reboot your Ubuntu Live CD, and run the commands again:

sudo fdisk -lu
ls -l /dev/sd*
You don't need to post the output if it is the same as before, only if you get something different. Also, do you have any other Live CDs you can boot? If so, try them and see if they give the same results.

melerz
September 6th, 2008, 06:38 PM
the same output appears.
I don't have another Live CD but of course is not problem to get one..
I`ll download another distribution and inform you ASAP.
***HUGE*** thanks for your effort.

caljohnsmith
September 6th, 2008, 06:47 PM
the same output appears.
I don't have another Live CD but of course is not problem to get one..
I`ll download another distribution and inform you ASAP.
***HUGE*** thanks for your effort.
You're welcome, let's hope we figure out your problem. :)

While you're downloading another Live CD, do you have internet access when you use your Ubuntu Live CD? If so, do the following:

sudo apt-get install testdisk
sudo testdisk
After you get the testdisk screen, select "no log", select HDD and "proceed", "Intel", "Analyze", and see what it shows for your HDD and what errors it might give. Please post a screen shot of what it says, and try to make sure you get everything in the screen shot (your other screen shots were cropped on the edges).

melerz
September 6th, 2008, 08:05 PM
i don't have Internet in the Live-CD because I just don't know how to configure the dial-up settings..nvm.
if this app is just for checking HDD I can test it by the manufacturer checking tool.
Anyway, I have just started to download "Fedora" so I`ll inform you when its finished.
thanx.

EDIT:
when I typed "ls -l /dev/sd*" it did show sda2 and others partitions.
http://img57.imageshack.us/my.php?image=47859265rv7.jpg

However, every "sudo" command has been denied..claiming I don't have permission and it starts to quote sentences from Spiderman "with great power comes great responsibility"..***? :\

caljohnsmith
September 7th, 2008, 02:17 PM
i don't have Internet in the Live-CD because I just don't know how to configure the dial-up settings..nvm.
if this app is just for checking HDD I can test it by the manufacturer checking tool.
Anyway, I have just started to download "Fedora" so I`ll inform you when its finished.
thanx.

EDIT:
when I typed "ls -l /dev/sd*" it did show sda2 and others partitions.
http://img57.imageshack.us/my.php?image=47859265rv7.jpg

However, every "sudo" command has been denied..claiming I don't have permission and it starts to quote sentences from Spiderman "with great power comes great responsibility"..~What the heck~? :\
Yes, Fedora is a bit different then Ubuntu. :) I think you have to become root by doing:

su -
Notice the dash "-" is part of the command. Once you are root, then just run the fsck without the sudo in front.

melerz
September 7th, 2008, 08:23 PM
Ok, here is what I got:
-fdisk -lu ->

http://img156.imageshack.us/my.php?image=91520949vk3.jpg

the rest of the screen:
http://img83.imageshack.us/my.php?image=64675429lb6.jpg

-fsck /dev/sda2 [and sdb2]

http://img83.imageshack.us/my.php?image=45871260xn4.jpg

thanks very much! :}

caljohnsmith
September 7th, 2008, 08:42 PM
OK, I think that Fedora helped clear things up. Your Ubuntu installation is on sdb2, and not sda2. When you did the "find /boot/grub/stage1" command in Grub, did it actually return (hd0,1)? Try it from the Fedora CD:

su -
grub
grub> find /boot/grub/stage1
If that returns (hd1,1), then proceed with:

grub> root (hd1,1)
grub> setup (hd1)
grub> quit
Can you set your BIOS so your sdb drive is first in the boot order, or do you have to boot the sda drive?

melerz
September 8th, 2008, 02:11 PM
Ok, it did returned (hd1,1) and the setup was end succefuly.
However the same problem occure, as the windows pop-up regulary.
In addition, I did set the BIOS so sdb would boot first and than when the computer start itself, there is a line:
"GRUB read error" and nothing I can do..

Thanks :]

caljohnsmith
September 8th, 2008, 03:11 PM
Ok, it did returned (hd1,1) and the setup was end succefuly.
However the same problem occure, as the windows pop-up regulary.
In addition, I did set the BIOS so sdb would boot first and than when the computer start itself, there is a line:
"GRUB read error" and nothing I can do..

Thanks :]
First of all, do you have a Windows XP Install CD? If you do, boot that up, go to the "recovery console", and run the command "fixmbr". That should fix the master boot record (MBR) of your Windows drive and at least make it bootable again.

But the bad news is that "Grub read error" is not a good sign; it could mean your sdb drive is dying. How old is that HDD? It is only 40 GB so I might guess it is old. Do you have a HDD diagnostic CD that came with your sdb HDD that you could check it with? If you don't, you could download the "Ultimate Boot CD" (http://www.ultimatebootcd.com) which has lots of good HDD tools to check your HDD's health.

And in the meantime, boot your Fedora Live CD again and do the following:

su -
fsck /dev/sdb2
If fsck asks you to fix any errors, of course say "y". Let me know how it goes.

melerz
September 8th, 2008, 05:30 PM
Ahmm, first..the windows is normally boot when I change back the settings. I just want to clear this point..:p

fsck doesn't output any fixes..but details on this driver.

The driver is really old, like 6-7 years...so it might be a problem in the disk...I`ll check it :]

tnx

feel the beat
September 10th, 2008, 12:42 PM
please i need help with that

please :)

grub> find /boot/grub/stage1
(hd0,5)

grub> root (hd0,5)

grub> setup (hd0)
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 (hd0)"... 16 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd0) (hd0)1+16 p (hd0,5)/boot/grub/stage2
/boot/grub/menu.lst"... failed

Error 12: Invalid device requested

grub>

caljohnsmith
September 10th, 2008, 02:17 PM
"Feel the beat", from your Live CD, try the following and post the results:

sudo mount /dev/sda6 /mnt
cat /mnt/boot/grub/menu.lst
The error you got can sometimes be caused by a corrupt partition table. If the above commands successfully print your menu.lst, then try doing:

sudo apt-get install testdisk
sudo testdisk
After starting testdisk with the above command, choose "no log", select HDD and "proceed", "Intel", "Analyze", and see what it shows for your HDD and what errors it might give. Please post the output of that screen.

feel the beat
September 11th, 2008, 11:55 AM
"Feel the beat", from your Live CD, try the following and post the results:

sudo mount /dev/sda6 /mnt
cat /mnt/boot/grub/menu.lst
The error you got can sometimes be caused by a corrupt partition table. If the above commands successfully print your menu.lst, then try doing:

sudo apt-get install testdisk
sudo testdisk
After starting testdisk with the above command, choose "no log", select HDD and "proceed", "Intel", "Analyze", and see what it shows for your HDD and what errors it might give. Please post the output of that screen.

Thanks a lot caljohnsmith for your care about my problem

but after hundreds of trying i found my way to solve my problem by using

super grub disk to reinstall grub
it was so easy and it's just done with a few steps :)

Thanks again :)

feel the beat
September 11th, 2008, 12:05 PM
"Feel the beat",

sudo apt-get install testdisk
sudo testdisk
After starting testdisk with the above command, choose "no log", select HDD and "proceed", "Intel", "Analyze", and see what it shows for your HDD and what errors it might give. Please post the output of that screen.


TestDisk 6.8, Data Recovery Utility, August 2007
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org

Disk /dev/sda - 80 GB / 74 GiB - CHS 9729 255 63
Current partition structure:
Partition Start End Size in sectors

1 E extended LBA 0 1 1 9727 254 63 156280257
2 * HPFS - NTFS 5099 1 1 9727 254 63 74364822
Space conflict between the following two partitions
1 E extended LBA 0 1 1 9727 254 63 156280257
2 * HPFS - NTFS 5099 1 1 9727 254 63 74364822
X extended 0 1 2 2674 254 63 42973811
5 L Linux 0 3 1 2674 254 63 42973686
X extended 2675 0 1 2798 254 63 1992060
6 L Linux Swap 2675 1 1 2798 254 63 1991997





*=Primary bootable P=Primary L=Logical E=Extended D=Deleted
[Proceed ] [ Backup ]
Try to locate partition






TestDisk 6.8, Data Recovery Utility, August 2007
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org

Disk /dev/sda - 80 GB / 74 GiB - CHS 9730 255 63
Partition Start End Size in sectors
D Linux 0 1 1 5098 254 63 81915372
D HPFS - NTFS 0 1 1 5098 254 63 81915372
D Linux 0 3 1 2674 254 63 42973686
D Linux Swap 2675 1 1 2798 254 63 1991997
P HPFS - NTFS 5099 1 1 9727 254 63 74364822








Structure: Ok. Use Up/Down Arrow keys to select partition.
Use Left/Right Arrow keys to CHANGE partition characteristics:
*=Primary bootable P=Primary L=Logical E=Extended D=Deleted
Keys A: add partition, L: load backup, T: change type,
Enter: to continue
SWAP2 version 1, 1019 MB / 972 MiB

caljohnsmith
September 11th, 2008, 01:56 PM
TestDisk 6.8, Data Recovery Utility, August 2007
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org

Disk /dev/sda - 80 GB / 74 GiB - CHS 9729 255 63
Current partition structure:
Partition Start End Size in sectors

1 E extended LBA 0 1 1 9727 254 63 156280257
2 * HPFS - NTFS 5099 1 1 9727 254 63 74364822
Space conflict between the following two partitions
1 E extended LBA 0 1 1 9727 254 63 156280257
2 * HPFS - NTFS 5099 1 1 9727 254 63 74364822
X extended 0 1 2 2674 254 63 42973811
5 L Linux 0 3 1 2674 254 63 42973686
X extended 2675 0 1 2798 254 63 1992060
6 L Linux Swap 2675 1 1 2798 254 63 199199



Super Grub Disk is a great way to solve many Grub problems, but as you can see from the above testdisk error, it's pretty clear your original Grub problem is merely a symptom of a corrupted partition table; I would highly recommend that you fix your partition table before you inevitably run into more problems. If you need help doing that, first post the output of:

sudo fdisk -lu
Also have testdisk do a deep scan, so start testdisk:

sudo testdisk
Then select "create log", select HDD and "proceed", "Intel", and "Analyze". Then do "proceed", choose Y/N depending on if you have a Vista partition, select "enter", and select "search!" so it does a deeper search, which will take a while. Once it is finished searching, post the results of that screen.

feel the beat
September 12th, 2008, 02:24 AM
Super Grub Disk is a great way to solve many Grub problems, but as you can see from the above testdisk error, it's pretty clear your original Grub problem is merely a symptom of a corrupted partition table; I would highly recommend that you fix your partition table before you inevitably run into more problems. If you need help doing that,
Also have testdisk do a deep scan, so start testdisk:

sudo testdisk
Then select "create log", select HDD and "proceed", "Intel", and "Analyze". Then do "proceed", choose Y/N depending on if you have a Vista partition, select "enter", and select "search!" so it does a deeper search, which will take a while. Once it is finished searching, post the results of that screen.



Thanks a lot caljohnsmith

first post the output of:

sudo fdisk -lu


Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders, total 156301488 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xef11ef11

Device Boot Start End Blocks Id System
/dev/sda1 * 63 156280319 78140128+ f W95 Ext'd (LBA)
/dev/sda2 * 81915498 156280319 37182411 7 HPFS/NTFS
/dev/sda5 189 42973874 21486843 83 Linux
/dev/sda6 42973938 44965934 995998+ 82 Linux swap / Solaris



sudo testdisk
Then select "create log", select HDD and "proceed", "Intel", and "Analyze". Then do "proceed", choose Y/N depending on if you have a Vista partition, select "enter", and select "search!" so it does a deeper search, which will take a while. Once it is finished searching, post the results of that screen.



TestDisk 6.8, Data Recovery Utility, August 2007
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org

Disk /dev/sda - 80 GB / 74 GiB - CHS 9729 255 63
Partition Start End Size in sectors
D Linux 0 1 1 5098 254 63 81915372
D HPFS - NTFS 0 1 1 5098 254 63 81915372
D Linux 0 3 1 2674 254 63 42973686
D Linux 6 1 1 2680 254 63 42973812
D Linux Swap 2675 1 1 2798 254 63 1991997
L HPFS - NTFS 5099 1 1 9727 254 63 74364822







Structure: Ok. Use Up/Down Arrow keys to select partition.
Use Left/Right Arrow keys to CHANGE partition characteristics:
*=Primary bootable P=Primary L=Logical E=Extended D=Deleted
Keys A: add partition, L: load backup, T: change type, P: list files,
Enter: to continue
EXT3 Large file Sparse superblock, 41 GB / 39 GiB





With My Best Regards and i really appreciate that :)

caljohnsmith
September 12th, 2008, 02:47 AM
With My Best Regards and i really appreciate that :)
You're welcome, now let's hope we can get your partition table fixed. :) Before we change your partition table though, do you know from memory what your partitions were? Do you have Windows installed on that HDD? If you do, it looks like it is in the last partition, and at least right now it is a logical partition. Is that maybe just an NTFS partition used for file storage?

feel the beat
September 12th, 2008, 01:44 PM
You're welcome, now let's hope we can get your partition table fixed. :) Before we change your partition table though, do you know from memory what your partitions were? Do you have Windows installed on that HDD? If you do, it looks like it is in the last partition, and at least right now it is a logical partition. Is that maybe just an NTFS partition used for file storage?

hmmmmmmmmmm

it was on it a Windows and now i am stuck with a problem of installing windows after linux installing. do you know any way to do that?

because after i install windows in that partition it's bring to me that problem of "invalid partition table" or something like that and it comes just after i finish the first part of installing windows and force me to wait until rebooting the system to continue my installation

Regards

caljohnsmith
September 12th, 2008, 01:58 PM
hmmmmmmmmmm

it was on it a Windows and now i am stuck with a problem of installing windows after linux installing. do you know any way to do that?

because after i install windows in that partition it's bring to me that problem of "invalid partition table" or something like that and it comes just after i finish the first part of installing windows and force me to wait until rebooting the system to continue my installation

Regards
Yes, you need to fix your partition table before trying to reinstall Windows. Is your Ubuntu install new? If it is, how about just saving whatever important documents you have in Ubuntu, and then wiping your HDD clean to start over again? Then you can set up the partitions with gparted, and you shouldn't have partition table problems. As long as you are trying to reinstall Windows anyway, I think starting over with a clean HDD is your best bet at this point.

rybaxs
September 15th, 2008, 04:58 AM
find /boot/grub/stage1
(hd0,0)
grub> root (hd0,0)
grub> setup (hd0,0)
setup (hd0,0)
Checking if "/boot/grub/stage1" exists... no
Checking if "/boot/grub/stage2" exists... no

grub>

when i restarted the system
- error operating system!
what should i do?

caljohnsmith
September 15th, 2008, 02:29 PM
find /boot/grub/stage1
(hd0,0)
grub> root (hd0,0)
grub> setup (hd0,0)
setup (hd0,0)
Checking if "/boot/grub/stage1" exists... no
Checking if "/boot/grub/stage2" exists... no

grub>

when i restarted the system
- error operating system!
what should i do?
First off, I should mention that you should run "setup (hd0)" instead of "setup (hd0,0)". So you are sure that using "find /boot/grub/stage1" in the grub prompt returns (hd0,0)? Because when you use that, Grub then complains that it can't find that stage1 file. Please post the output of:

sudo fdisk -lu

melerz
September 15th, 2008, 06:01 PM
Sorry to cut-off your conversation =]
Hey john, if you remember I have the sda\sdb situation..GRUB read error...etc :]
So I have some news:
I`v checked for errors with UBCD411 and PowerMax (belongs to Maxtor) and
nothing was found.
Than I`v formatted the drive and installed Ubuntu again, and the same problem occurred - the GRUB doesn't appear.

[Now I can mount the menu.lst and install GRUB, which I couldn't do it last time.]
I set the HDD of linux to boot first and I got the "GRUB read error".
After some "googling" I found something -> I disabled the IDE DMA in BIOS and w00pa, the "grub 1.5" has started to be my friend and I managed to see the boot menu.
**HOWEVER**, when I clicked the "Ubuntu....generic" line, the following screen is hanged. The springy-orange bar always move and nothing is happen.
After few minutes, I got a new screen, like dos - "BusyBox", and I can write dos-commands...
=\
Thanx..very much..!

caljohnsmith
September 15th, 2008, 06:14 PM
Sorry to cut-off your conversation =]
Hey john, if you remember I have the sda\sdb situation..GRUB read error...etc :]
So I have some news:
I`v checked for errors with UBCD411 and PowerMax (belongs to Maxtor) and
nothing was found.
Than I`v formatted the drive and installed Ubuntu again, and the same problem occurred - the GRUB doesn't appear.

[Now I can mount the menu.lst and install GRUB, which I couldn't do it last time.]
I set the HDD of linux to boot first and I got the "GRUB read error".
After some "googling" I found something -> I disabled the IDE DMA in BIOS and w00pa, the "grub 1.5" has started to be my friend and I managed to see the boot menu.
**HOWEVER**, when I clicked the "Ubuntu....generic" line, the following screen is hanged. The springy-orange bar always move and nothing is happen.
After few minutes, I got a new screen, like dos - "BusyBox", and I can write dos-commands...
=\
Thanx..very much..!
That's great you at least have Grub working now that you made those BIOS changes. Since your problem now seems to be about Ubuntu loading and not a Grub problem, I would first recommend that you start a new thread in the "general" category. Then those who are good at troubleshooting Ubuntu boot problems will see your thread and can hopefully help. I might be able to help too, but I think you'll have much better luck if everyone sees it. :)

melerz
September 15th, 2008, 06:18 PM
T-H-A-N-K
Y-O-U
S-O
M-U-C-H
:]
I`ll post in there.
BB ;p

unutbu
September 15th, 2008, 06:24 PM
Melerz,
This might help:
http://users.bigpond.net.au/hermanzone/p15.htm#busybox

Boot from the LiveCD,
Open a terminal and type

blkid

Then compare the UUID listed by blkid against the UUID
listed in your menu.lst. You'll have to mount your Linux partition first to find your menu.lst. If you mount the Linux partition at /mnt, then look in /mnt/boot/grub/menu.lst. If you'd like more explicit instructions, post your


sudo fdisk -l

melerz
September 15th, 2008, 07:08 PM
thanks, but I don't know what happened, everything screwed up again =\
In live cd , when I try to mount sda1 (this is where the linux is) it wrote me "special device not found.." as it wrote to me before =\
Even when I typed "setup (hd0,0)" it output me the "old problem" (as I thought..) that menu.lst hasn't been found.
When I boot the computer, the "GRUB 1.5" text is an infinite loop and I need to go back to BIOS and set the XP to load first..
To cut the story,
I returned to begining. damn. I`m tired.

thanx.

KATHYxx
September 16th, 2008, 02:07 AM
I am trying to install a brand new Ubuntu from scratch on top of a hosed one. Except the installation gets stuck for some reason and can't finish. Grub is hosed and I cannot reach ubuntu or windows.
Error 22 comes up before the menu comes up.

In trying to repair Grub, i can't find /boot/grub/stage1 as it doesn't exist (error 15).
/boot doesn't appear to have any subdirectories.. hidden or otherwise.

fdisk returns


device boot Start End Blocks ID System
/dev/sda1 * 63 165598019 82798978+ 7 HPFS/NTFS
/dev/sda2 194948775 195366464 208845 83 Linux
/dev/sda4 165598020 194948774 14675377+ 5 Extended
/dev/sda5 193615443 194948774 666666 82 Linux swap / Solaris
/dev/sda6 165598146 193615379 14008617 83 Linux




/dev/mmcblk0p1 57 31359 15651+ 1 FAT12



I tried mounting sda6 and then

cat /mnt/boot/grub/menu.1st
but theres no such file. I tried both one and lower case L.

Did the same for sda2 and got the same result.

caljohnsmith
September 16th, 2008, 02:18 AM
I am trying to install a brand new Ubuntu from scratch on top of a hosed one. Except the installation gets stuck for some reason and can't finish.
If the Ubuntu installation stalls and it can't go further, then even if you were to get Grub working, surely your Ubuntu would not work or at least would be crippled. In other words, from your description, it sounds like your main problem is just getting Ubuntu to install properly; having a broken Grub is only a symptom of the failed Ubuntu install. I think you will have a better chance at receiving useful responses if you post to the "installation and upgrades" section at this point. :)

KATHYxx
September 16th, 2008, 03:35 AM
If the Ubuntu installation stalls and it can't go further, then even if you were to get Grub working, surely your Ubuntu would not work or at least would be crippled. In other words, from your description, it sounds like your main problem is just getting Ubuntu to install properly; having a broken Grub is only a symptom of the failed Ubuntu install. I think you will have a better chance at receiving useful responses if you post to the "installation and upgrades" section at this point. :)

My main concern here was getting the computer to work enough so I can at least boot Windows XP, which has been sharing the hard drive peacefully with it for some time now before I tried upgrading Gusty to Hardy, where a rather large chain of events left me attempting to install Hardy from scratch.

I made a thread in that section a day or two ago, but it hasn't been getting any responses so I've been trying to find another solution myself, thus my post here.

Though, you've confirmed what I expected what happened, so thank you for that.


EDIT: Downloading an older distro's installer CD got Grub working again. I can access windows now so this part of the issue's solved

Rorke
September 17th, 2008, 05:35 PM
Thanks :-)

Balrak
September 18th, 2008, 09:31 PM
please i need help with that



grub> find /boot/grub/stage1
(hd0,0)

grub> root (hd0,0)

grub> setup (hd0)
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 (hd0)"... 16 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd0) (hd0)1+16 p (hd0,0)/boot/grub/stage2/boot/grub/menu.lst"... succeeded

done

grub>


but nothing.

only error 21.

please help me.:-(

caljohnsmith
September 18th, 2008, 09:43 PM
Balrak, are you getting the Grub error 21 before you get the Grub menu on start up, or after you select the Ubuntu entry in the menu? Also, please post:

sudo fdisk -lu

Balrak
September 19th, 2008, 06:14 AM
disk /dev/sda:250.0 gb, 25oo59350016 bytes
255 heads, 63 sectors/track, 30401 cylinders,total 488397168 sectors
units = sectors of 1 * 512 = 512 bytes
disk identifier: 0x51955194

device boot start end blocks id system
/dev/sda1 * 63 476246924 238123431 83 linux
/dev/sda2 476246925 488392064 6072570 5 extended
/dev/sda5 476246988 488392064 6072538+ 82 linux swap / solaris


I dont get the Grub menu on start up
maybe i must something do to see grub menu? (sorry for my eanglish )

trindflo
September 19th, 2008, 06:55 AM
I just had an interesting experience attempting to use Norton Ghost (version 11) to clone an Ubuntu installation. It has taken me 24 hours to find the 10 second fix.

I used Ghost to duplicate an entire disk which consisted of a root file system in a primary partition and the swap inside a logical drive within an extended partition.

On reboot, I received two grub messages: the first message announced stage 1.5, then the second message announced Error 17 and halted.

The problem was that Ghost had numbered the partitions in a strange way. The first partition, /dev/sda1, was the extended partition. /dev/sda2 was the root partition, and /dev/sda5 was the logical drive for the swap.

The solution for me was to boot from a live CD (I used the Ubuntu 8.04.1 desktop installation CD, and I believe much older tools would also work). I then opened a terminal session and put myself in superuser mode (using sudo since it was Ubuntu). From there I ran the following fdisk commands:




# fdisk -l

Disk /dev/sda: 203.9 GB, 203928109056 bytes
255 heads, 63 sectors/track, 24792 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 1 23255 186795756 83 Linux
/dev/sda2 23256 24792 12345952+ f W95 Ext'd (LBA)
/dev/sda5 23256 24792 12345921 82 Linux swap / Solaris


# fdisk /dev/sda


The number of cylinders for this disk is set to 24792.
There is nothing wrong with that, but this is larger than 1024,
and could in certain setups cause problems with:
1) software that runs at boot time (e.g., old versions of LILO)
2) booting and partitioning software from other OSs
(e.g., DOS FDISK, OS/2 FDISK)

Command (m for help): x

Expert command (m for help): f
Done.


Expert command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: Re-reading the partition table failed with error 16: Device or resource busy.
The kernel still uses the old table.
The new table will be used at the next reboot.
Syncing disks.

#


That was it. I rebooted and everything was fine. Just to summarize without the responses from fdisk:

- Use fdisk -l to find out the name of your drive
- Run fdisk against the drive (in my case, all the partitions were on /dev/sdaX - drop the 'X')
- Switch to the Expert mode of fdisk by typing 'x'
- Fix the order of the partitions with 'f'
- Write the fixed partition to the disk and exit with 'w'

Reboot, then sneer at your machine and tell it that resistance is futile.

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


This will restore grub if you already had grub installed but lost it to a windows install or some other occurence that erased/changed your MBR so that grub no longer appears at start up or it returns an error.

(This how to is written for Ubuntu but should work on other systems. The only thing to take note of, when you see "sudo" that will mean to you that the following command should be entered at a root terminal.)

Boot into the live Ubuntu cd. This can be the live installer cd or the older live session Ubuntu cds.

When you get to the desktop open a terminal and enter. (I am going to give you the commands and then I will explain them later)


sudo grub

This will get you a "grub>" prompt (i.e. the grub shell). At grub>. enter these commands


find /boot/grub/stage1

This will return a location. If you have more than one, select the installation that you want to provide the grub files.
Next, THIS IS IMPORTANT, whatever was returned for the find command use it in the next line (you are still at grub>. when you enter the next 3 commands)


root (hd?,?)
Again use the value from the find command i.e. if find returned (hd0,1) then you would enter root (hd0,1)

Next enter the command to install grub to the mbr


setup (hd0)

Finally exit the grub shell

quit

That is it. Grub will be installed to the mbr.
When you reboot, you will have the grub menu at startup.

Now the explanation.
Sudo grub gets you the grub shell.
Find /boot/grub/stage1 has grub locate the file stage1. What this does is tell us where grub's files are. Only a small part of grub is located on the mbr, the rest of grub is in your boot folder. Grub needs those files to run the setup. So you find the files and then you tell grub where to locate the files it will need for setup.
So root (hd?,?) tells grub it's files are on that partition.
Finally setup (hd0) tells grub to setup on hd0. When you give grub the parameter hd0 with no following value for a partition, grub will use the mbr. hd0 is the grub label for the first drive's mbr.
Quit will exit you from the grub shell.



THIS IS AN EDIT. 5-HT MADE A GOOD POINT AND I AM JUST GOING TO COPY/PASTE IT HERE



THIS IS ANOTHER EDIT. TOSK POSTED A WAY TO MOUNT PROC AND UDEV. THIS WAS NEEDED BECAUSE GRUB WASN'T RECOGNISING THE DRIVE. I THOUGHT IT WAS A VALUABLE COMMENT AND DECIDED TO PUT IT IN THE ORIGINAL POST SO PEOPLE WILL SEE IT AT THE TOP. IT MAY BE MISSED AS JUST A REPLY POST DOWN THE PAGE.
ALL KNOWLEDGE IS WELCOME!





**This set of instruction is a combination of 2 guides I saw before. One was a Mepis grub how to but I never found it again. The other is the grub manual. It's section explained the find, root, setup process but never mentioned it could be done from a live session.

This is the grub link http://www.gnu.org/software/grub/manual/html_node/Installing-GRUB-natively.html#Installing-GRUB-natively

Post script;
Just to post as much information as possible, this is an older how to for resoring grub to the mbr. The original post is directions for using the install cd and then there are replies that mention the method I posted here, as well as the chroot method mlind mentioned. If this method fails, you may want to try this http://ubuntuforums.org/showthread.php?t=24113

Balrak
September 19th, 2008, 07:07 AM
but u have error 17
it will help me?

i dont anderstand
i must only write this # fdisk /dev/sdaX
and my problem solved?

Balrak
September 19th, 2008, 08:59 AM
i make it ,but nothing
still error 21!

crtlbreak
September 19th, 2008, 11:56 AM
Have a look at Page 1 of this thread - the second half where "grub is not recognising the drive" and you have to mount the drive and then mount proc and udev.
Hell - this is defintely not a good introduction for you to linux - I truly feel for you!! But your persistence and the help from people in the forums will help you solve it - I have always had helpful assistance from the forums. Just keep at it!
regards

caljohnsmith
September 19th, 2008, 02:06 PM
i make it ,but nothing
still error 21!
On start up Balrak, does it say anything about "press ESC to see menu" or something of that sort? Whether it does or not, try pressing ESC repeatedly on start up and see if you get your Grub menu. In order to troubleshoot your problem, it is important to know whether your error 21 happens before you even get a Grub menu, or after you get the Grub menu and Grub automatically tries to boot some entry.

Balrak
September 19th, 2008, 03:06 PM
i just instal windows xp
if i will get error 21 then i can load my windows back?

crtlbreak
September 19th, 2008, 03:23 PM
my understanding is if you install any dos-based OS over a grub error it will not repair grub or the mbr - so attempting to install xp wont repair the problem - you will have a potentially bootable system but with two OS's on it instead of one - and still unbootable till the mbr and grub issue is addressed.

please reply to caljohnsmith about whether the grub error happens before the grub options or afterwards - as everything has to happen in a specific sequence in order to load the operating system.

regards

Balrak
September 19th, 2008, 08:00 PM
i just reinstal ubuntu and make sudo grub
reboot and press all time esc
but nothing error 21
no grub menu

meierfra.
September 20th, 2008, 05:40 PM
Balrak: Could you post your menu.lst:


sudo mount -t ext3 /dev/sda1 /mnt
gksudo gedit /mnt/boot/grub/menu.lst
(l is a lower case L)


According to Herman Grub Page (http://users.bigpond.net.au/hermanzone/p15.htm#21) you might have to change some setting in the bios:


go into bios and check if the hard drive controller is "off", if so change to "auto".


Googeling I found that some people think that "grub error 21" can be caused by the particular version of grub used by Ubuntu. So you might try reinstalling grub with Supergrub (see my signature) or a Live CD from a different Linux Distro (knoppix, fedora, ...)

keshtoda
September 28th, 2008, 08:46 AM
Hi all:

I have messed up my GRUB and Hardy installation and I am hoping someone could help me fix it.

Here's what I did:

I have (had?) Vista and Hardy installed. I created a new partition on one of the existing NTFS partition from Vista disk manager. Then as I tried to reboot to get to Hardy, GRUB threw an error 17.

So I tried reinstalling GRUB with Hardy LiveCD:


grub> find /boot/grub/stage1
find /boot/grub/stage1

Error 15: File not found
grub> find /grub/stage1
find /grub/stage1

Error 15: File not found
grub> setup (hd0)
setup (hd0)

Error 17: Cannot mount selected partition


Here's the fdisk output:


ubuntu@ubuntu:~$ sudo fdisk -lu

Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xc63be949

Device Boot Start End Blocks Id System
/dev/sda1 * 63 61441707 30720822+ 7 HPFS/NTFS
/dev/sda2 61448625 69256214 3903795 82 Linux swap / Solaris
/dev/sda3 69256215 220733099 75738442+ f W95 Ext'd (LBA)
/dev/sda4 220733100 234436544 6851722+ 83 Linux
/dev/sda5 81924096 151435247 34755576 7 HPFS/NTFS
/dev/sda6 151435264 220729343 34647040 7 HPFS/NTFS

I tried a few other things (after doing some seaching):


ubuntu@ubuntu:~$ sudo fsck /dev/sda4
fsck 1.40.8 (13-Mar-2008)
fsck: fsck.ntfs: not found
fsck: Error 2 while executing fsck.ntfs for /dev/sda4

ubuntu@ubuntu:~$ sudo e2fsck -b 8193 /dev/sda4
e2fsck 1.40.8 (13-Mar-2008)
e2fsck: Device or resource busy while trying to open /dev/sda4
Filesystem mounted or opened exclusively by another program?



ubuntu@ubuntu:~$ dmesg | tail
[ 424.751966] VFS: Can't find ext3 filesystem on dev sda4.


I am hoping I can salvage my Vista and Hardy installation. Any help is appreciated.

Thank you!

caljohnsmith
September 28th, 2008, 02:06 PM
Keshtoda, when you ran that fsck command on sda4, it looks like it tried to check sda4 as though it were an NTFS partition. Have you tried mounting that partition? Try the following:

sudo mount /dev/sda4 /mnt
ls -lR /mnt/boot
I doubt the above will work, but it is worth a shot; I think you might have accidentally formatted sda4 to NTFS, although fdisk doesn't show that, yet fsck seems to think it is NTFS.

Killer Cop
October 4th, 2008, 04:31 PM
Good guide, but I have a problem. I have a computer with Windows partition, empty NTFS partition and Ubuntu 8.04 partition.

Everytime the start the computer GRUB error 21 comes up. But when I restart the computer, the GRUB menu comes up normally.

I've tried running this guide, but it doesn't solve the problem. Is it just the computer or is it some GRUB malfunction thingy?

Please answer, I really don't understand this. :)

unutbu
October 4th, 2008, 07:26 PM
Killer Cop, I'm not sure I know the solution to your problem, but please post your /boot/grub/menu.lst.

argentinaL10N
October 8th, 2008, 08:39 AM
Dear friends,

I have a similar situation, hope you can help me out...

I have an HP Pavilion notebook (series 9000) with Vista Premium, 2 hard disks and 4 UBS ports. I also have a 10 GB IDE HD from an older PC, and I wanted to install Kubuntu in this one, via USB.

So I got it running under Vista, which gave me 2 more disks ( H and I ).

Then I booted from the LiveCD (md5sum checked for integrity, OK) to install Linux on the USB HD, followed the instructions in the forums (or so I believe) and then the machine asked me to reboot.

On rebooting, and after the HP splash, all I get is a black screen with the text:

GRUB loading stage 1.5
GRUB loading, please wait ...
Error 21

I entered the laptop's BIOS setting to change the boot sequence to boot from the USB HD (same effect); then to boot from the normal internal HD (same effect), all I can do is boot from the LiveCD again into Linux, where I can see the internal disks and all my data, but I can´t use them.

How can I boot into Vista again?
All I wanted to do was to run some Linux programs from my clients, while keeping Vista for the wife and kids in the main internal HDs.

I have prepared the information for your analysis:

ubuntu@ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x1e721e72

Device Boot Start End Blocks Id System
/dev/sda1 * 1 13526 108647563+ 7 HPFS/NTFS
/dev/sda2 13527 14593 8570677+ 7 HPFS/NTFS

Disk /dev/sdb: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xe38150e5

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 14592 117210208+ 7 HPFS/NTFS

Disk /dev/sdc: 10.1 GB, 10110320640 bytes
255 heads, 63 sectors/track, 1229 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x7e4617b9

Device Boot Start End Blocks Id System
/dev/sdc1 1 1171 9406026 83 Linux
/dev/sdc2 1172 1229 465885 5 Extended
/dev/sdc5 * 1172 1229 465853+ 82 Linux swap / Solaris




===============================


title Ubuntu 8.04.1, kernel 2.6.24-19-generic
root (hd2,0)
kernel /boot/vmlinuz-2.6.24-19-generic root=UUID=86c1199c-fe43-416c-bb43-1878c25b48e4 ro quiet
splash
initrd /boot/initrd.img-2.6.24-19-generic
quiet

title Ubuntu 8.04.1, kernel 2.6.24-19-generic (recovery mode)
root (hd2,0)
kernel /boot/vmlinuz-2.6.24-19-generic root=UUID=86c1199c-fe43-416c-bb43-1878c25b48e4 ro singl e
initrd /boot/initrd.img-2.6.24-19-generic

title Ubuntu 8.04.1, memtest86+
root (hd2,0)
kernel /boot/memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title Other operating systems:
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title Windows Vista/Longhorn (loader)
root (hd0,0)
savedefault
chainloader +1


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda2
title Windows Vista/Longhorn (loader)
root (hd0,1)
savedefault
chainloader +1

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

Any help or ideas will be highly appreciated,
THANKS!!!

unutbu
October 8th, 2008, 12:31 PM
The suggestion below should allow you to boot Vista and Ubuntu. To boot Vista by default you will have to set the BIOS boot order so that the Vista drive boots first.

To boot Ubuntu you will have to set the Ubuntu drive first. On some BIOSes there is a "temporary boot list" that can be set by pressing some key like F12, which can allow you to select a boot device for just one boot. If you have such an option, that might be useful so you can boot Ubuntu when necessary, but otherwise boot Vista by default.

To restore the ability to boot Vista: follow the directions here:
http://ubuntuforums.org/showthread.php?t=740221
This restores the Vista MBR, so you should be able to boot Vista after this.

To gain the ability to boot Ubuntu, try this:
Boot the LiveCD.
Open a terminal and type

sudo mount /dev/sdc1 /mnt
gksu gedit /mnt/boot/grub/menu.lst
Search and replace (hd0,0) with (hd1,0)
Search and replace (hd2,0) with (hd0,0)
Save and exit


sudo grub

At the grub> prompt type

root (hd2,0)
setup (hd2) # This installs GRUB (Ubuntu's bootloader) to the Ubuntu drive

zero-Q
October 11th, 2008, 10:38 PM
hi,
I have a problem with dual-boot installed on raid0 setup. I m using now 8.10 ubuntu beta, and I installed ubuntu according to the this website, and now there is no problem with ubuntu boot but after grub selection of xp entry, in only 1sec. the boot screen froze as a black screen and the windows boot progress never appears. I tried too many grub entry for xp, but I could not manage to boot xp, only 1 way to boot that windows cd and fixmbr but in this grub is over
thx
kind regards

caljohnsmith
October 11th, 2008, 11:09 PM
Zero-Q, how about first posting:

sudo fdisk -lu
cat /boot/grub/menu.lst
And we can work from there.

zero-Q
October 11th, 2008, 11:26 PM
Warning: ignoring extra data in partition table 5
Warning: ignoring extra data in partition table 5
Warning: ignoring extra data in partition table 5
Warning: invalid flag 0xc205 of partition table 5 will be corrected by w(rite)

Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x08ab08ab

Device Boot Start End Blocks Id System
/dev/sda1 * 63 40965749 20482843+ 7 HPFS/NTFS
/dev/sda2 40965750 976751999 467893125 f W95 Ext'd (LBA)
/dev/sda5 ? 612307648 1369984958 378838655+ 39 Plan 9

Disk /dev/sdb: 250.0 GB, 250058268160 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488395055 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x04000303

Disk /dev/sdb doesn't contain a valid partition table



# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not use 'savedefault' or your
# array will desync and will not let you boot your system.
default 0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 3

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
hiddenmenu

# Pretty colours
#color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=/dev/mapper/isw_dijhccibbc_Volume09 ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,0)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash

## should update-grub lock old automagic boot options
## e.g. lockold=false
## lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

## ## End Default Options ##

title Ubuntu intrepid (development branch), kernel 2.6.27-4-generic
root (hd0,8)
kernel /boot/vmlinuz-2.6.27-4-generic root=/dev/mapper/isw_dijhccibbc_Volume09 ro quiet splash
initrd /boot/initrd.img-2.6.27-4-generic

title Ubuntu intrepid (development branch), kernel 2.6.27-4-generic (recovery mode)
root (hd0,8)
kernel /boot/vmlinuz-2.6.27-4-generic root=/dev/mapper/isw_dijhccibbc_Volume09 ro single
initrd /boot/initrd.img-2.6.27-4-generic

title Ubuntu intrepid (development branch), memtest86+
root (hd0,8)
kernel /boot/memtest86+.bin

### END DEBIAN AUTOMAGIC KERNELS LIST

title Windows XP Professional x64 Edition
rootnoverify (hd0,0)
makeactive
chainloader +1

caljohnsmith
October 11th, 2008, 11:41 PM
Zero-q, fdisk must not be detecting your RAID0 setup correctly, because it is showing both drives when they should be seen as one I think. Frankly I'm amazed that you can even boot into Ubuntu at this point. From what little I can tell from the fdisk output, it looks like your Windows is in the first partition, so your Windows entry in your menu.lst should be correct. I think your best bet would be to figure out how to get Ubuntu to correctly recognize your RAID setup, and then probably booting Windows from Grub will work after that.

One more thing you could do to shed some light on your Grub problem is reboot, and when you get the Grub menu, press "c" to get the command line, and then type the following without pressing enter:

grub> geometry (hd
Then press TAB for tab-completion, and it should show a list of your drives; hopefully it will only show one drive, or your RAID array. For whichever drives it does show like (hd0) and (hd1), then do:

grub> geometry (hd0)
And see what partitions and size it shows for that drive. That will tell us how Grub sees your drives on startup. Please post the output of those commands if you want further help with it.

zero-Q
October 12th, 2008, 12:13 AM
grub>geometry (hd0,
Possible partitions are:
Partition num: 0, Filesystem type unknown, partition type 0x7
Partition num: 4, Filesystem type unknown, partition type 0x7
Partition num: 5, Filesystem type unknown, partition type 0x7
Partition num: 6, Filesystem type unknown, partition type 0x7
Partition num: 7, Filesystem type unknown, partition type 0x7
Partition num: 8, Filesystem type is ext2fs, partition type 0x83
Partition num: 9, Filesystem type is ext2fs, partition type 0x83
Partition num: 10, Filesystem type unknown, partition type 0x82
Partition num: 11, Filesystem type unknown, partition type 0x7




grub>geometry (hd0)
drive 0x80: C/H/S = 1023/255/63, The number of sectors = 976779264, LBA
Partition num: 0, Filesystem type unknown, partition type 0x7
Partition num: 4, Filesystem type unknown, partition type 0x7
Partition num: 5, Filesystem type unknown, partition type 0x7
Partition num: 6, Filesystem type unknown, partition type 0x7
Partition num: 7, Filesystem type unknown, partition type 0x7
Partition num: 8, Filesystem type is ext2fs, partition type 0x83
Partition num: 9, Filesystem type is ext2fs, partition type 0x83
Partition num: 10, Filesystem type unknown, partition type 0x82
Partition num: 11, Filesystem type unknown, partition type 0x7

caljohnsmith
October 12th, 2008, 12:17 AM
Do you know which partition is supposed to have Windows? Is it the first one? you have six NTFS partitions according to Grub (NTFS is 0x7 in Grub), so any of those could be Windows.

zero-Q
October 12th, 2008, 12:25 AM
the first 1 is windows installed partition

caljohnsmith
October 12th, 2008, 12:31 AM
I can't help you then because it looks like you have an entirely RAID related problem at this point, and I have minimal experience with RAID setups. Good luck and hopefully someone else can help you.

zero-Q
October 12th, 2008, 12:36 AM
after 2 year I am so closed to use ubuntu on my raid0 setup, I was waiting for bug-fix about raid issues, it is finally over, but as U see, another appeared but I wont give up XD
thx alot anyway

btw any chance to boot ubuntu from windos boot loader? maybe this can be an alternative way for me :)

talsemgeest
October 12th, 2008, 01:40 AM
after 2 year I am so closed to use ubuntu on my raid0 setup, I was waiting for bug-fix about raid issues, it is finally over, but as U see, another appeared but I wont give up XD
thx alot anyway

btw any chance to boot ubuntu from windos boot loader? maybe this can be an alternative way for me :)
I'm having the same problem. Unfortunately, it is just as hard for the windows bootloader to pick up ubuntu when everything is in raid as it is for the grub. I've ended up just getting an old ide hdd and putting ubuntu on that, then adding an entry for the grub to point to my windows installation on the raid. At least it works...

Agret
October 12th, 2008, 01:45 PM
root@ubuntu:/media/LinuxPart# grub
Probing devices to guess BIOS drives. This may take a long time.

[ 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> find /boot/grub/stage1
find /boot/grub/stage1
(hd2,3)
grub> root (hd2,3)
root (hd2,3)
grub> setup (hd0)
setup (hd0)
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 (hd0)"... 16 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 d (hd0) (hd0)1+16 p (hd2,3)/boot/grub/stage2 /boot/grub/menu.lst"... succeeded
Done.
grub>

Worked for me :)

Thank you very much for this useful guide.

Daibhidh
October 13th, 2008, 06:56 PM
Hi, I am slightly lost with all the advice on this thread. My situation is this:

I had Ubuntu and Vista dual-booting fine. Then one day it started going to Error 17 instead of the boot menu, so neither OS works. The live CD does work. The disks are set up as:

ubuntu@ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x04020401

Device Boot Start End Blocks Id System
/dev/sda1 1 1020 8193118+ 12 Compaq diagnostics
/dev/sda2 * 1021 7807 54516577+ 7 HPFS/NTFS
/dev/sda3 7808 11623 30650369 7 HPFS/NTFS
/dev/sda4 11624 14593 23856525 5 Extended
/dev/sda5 * 11624 14464 22820301 83 Linux
/dev/sda6 14465 14593 1036161 82 Linux swap / Solaris

Disk /dev/sdb: 4110 MB, 4110188544 bytes
128 heads, 63 sectors/track, 995 cylinders
Units = cylinders of 8064 * 512 = 4128768 bytes
Disk identifier: 0x00000000

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 992 3999712+ 7 HPFS/NTFS

I have tried the find commands suggested in other posts but it cannot find anything.

(When I look in places on my desktop it shows the two Windows volumes but not the Linux ones. Is this normal?)

What should I try first?

Thanks.

caljohnsmith
October 13th, 2008, 07:10 PM
Daibhidh, it sounds like you probably need to do a file system repair on your Ubuntu partition. From your Live CD do:

sudo umount /dev/sda5
sudo fsck -y /dev/sda5
Don't worry about a "not mounted" error from the first command if you get one, it is only to make sure sda5 is not mounted. Let me know if it returns any errors. If it corrects any errors, go ahead and repeat the Grub steps given at the beginning of this thread.

Also, you should have only one partition on your HDD marked as active (has the boot flag set), and both sda2 and sda5 are marked as active on your HDD according to fdisk (that is what the asterisk * is for). Maybe you have a BIOS that doesn't care about that, and you could previously boot your HDD anyway, but I would recommend removing the boot flag on the sda5 partition so you don't have future problems. To do that, first do:

sudo fdisk /dev/sda
Then enter "a", enter "5", then "w" to write the change to disk. Let me know how it goes or if you run into problems. :)

Daibhidh
October 13th, 2008, 10:50 PM
Thank you, caljohnsmith.

I got loads of errors which it corrected. (It ran clean the second time!)

I removed the flag so it now looks like this:

Device Boot Start End Blocks Id System
/dev/sda1 63 16386299 8193118+ 12 Compaq diagnostics
/dev/sda2 * 16386300 125419454 54516577+ 7 HPFS/NTFS
/dev/sda3 125419455 186720192 30650369 7 HPFS/NTFS
/dev/sda4 186723495 234436544 23856525 5 Extended
/dev/sda5 186723558 232364159 22820301 83 Linux
/dev/sda6 232364223 234436544 1036161 82 Linux swap / Solaris

I then tried the instructions at the beginning of the thread, but got error 15 when I tried to find the file at the grub prompt.

What should I do next?

caljohnsmith
October 13th, 2008, 11:12 PM
Daibhidh, one thing I should ask before we go too much further, what were the circumstances that led up to your booting problem? What happened before you couldn't boot anymore? Any idea of what caused your Ubuntu partition to have so many file system errors? Any information you can give will greatly help in getting to the root of your problem quicker. :) Also, please post the results of the following from your Live CD:

sudo mount /dev/sda5 /mnt
ls -l /mnt/boot/grub
Note "-l" is a lowercase L, not a one.

wavingpines
October 13th, 2008, 11:51 PM
I've recently installed Intrepid but can't persuade it to boot! I have two hard disks and installed it into the fourth partition on the second disk - /dev/sdb4 -or- (hd1,3). The partitions on this disk are arranged as follows:

#1 - Swap
#2 - Hardy (my main, or 'live' installation)
#3 - /home
#4 - Intrepid (my 'test' install)

I previously had Hardy installed in this partition so just changed the menu.lst file to reflect the higher kernel version but if I try to boot it from the grub menu, all I get is 'Error 2: Bad file or directory type' from the 'kernel' command. Although (after running the grub 'setup' on this partition) the 'root' command succeeds, it's as though grub can't see any files on my fourth partition! I've run a fsck on it and it's clean. I've run the grub 'setup' on it and although it says it's successful, there's still no 'grub' folder on it?! I copied-and-pasted the UUID and kernel/initrd file names so I know they're good. HELP!

Here's the entry in my menu.lst:


title Ubuntu 8.10, kernel 2.6.27-4-generic (intrepid)
root (hd1,3)
kernel /boot/vmlinuz-2.6.27-4-generic root=UUID=7188a87c-f5da-4fbd-ae76-baecde122f78 ro quiet splash
initrd /boot/initrd.img-2.6.27-4-generic
quiet

Thanks in advance (and in desparation)...

Daibhidh
October 14th, 2008, 12:06 AM
Hi caljohnsmith,

The response was
ls: cannot access /mnt/boot/grub: No such file or directory.

The only thing that I know of that could have done anything was that I forced it to switch off when it had crashed - I pressed the off button but misunderstood to resultant blank screen as a serious crash, so I held the off button down.

When I explore the disk, I can only see the Windows volumes, not the Linux ones. I am a bit concerned as to whether there is anything useable in the Linux ones at all.

Would reinstalling Ubuntu fix the problem as there is nothing I need to keep in the existing Linux volumes - all my data is in Windows?

Daibhidh

meierfra.
October 14th, 2008, 12:07 AM
wavingpines: Did you upgrade to Hardy from an earlier version of Ubuntu? Then you might have an older version of grub which cannot read ext3 partition with 256 inodes. Try this




sudo apt-get purge grub
sudo apt-get install grub
sudo grub-install --recheck /dev/sda

caljohnsmith
October 14th, 2008, 12:17 AM
Daibhidh, sure, reinstalling Ubuntu will probably fix the problem. I guess as long as you don't mind that option, you might as well go for it, because it could save a lot of troubleshooting. :)

Daibhidh
October 14th, 2008, 04:19 PM
Thank you, caljohnsmith.

Your advice and reassurance were useful. In the end I did reinstall and everything is now perfect, with no loss of data.

Daibhidh

BobSongs
October 14th, 2008, 07:26 PM
Is there some way to copy GRUB's current settings to some other drive in order to restore this information should GRUB get messed up?

unutbu
October 14th, 2008, 07:51 PM
I believe this would work, but I would appreciate comments if anyone finds a mistake.

The first sector of your hard disk contains GRUB stage 1.
The next 17 sectors contains GRUB stage 1.5 [* See footnote below]
The final grub stage, stage 2, is located within the filesystem at /boot/grub/stage2.

So to backup all the pieces to /media/backup, you could do the following:



sudo dd if=/dev/sda of=/media/backup/fullmbr bs=512 count=18
sudo tar cf /media/backup/boot.tar /boot/


Then to restore GRUB:


Boot from LiveCD
sudo mount /dev/sdaX /mnt # Change sdaX to partition name of Linux partition
sudo mkdir /media
sudo mkdir /media/backup
sudo mount /dev/sdaY /media/backup # Change sdaY to the partition name of /media/backup
sudo cp /media/backup/boot.tar /mnt
cd /mnt
sudo tar xvf /boot.tar
sudo dd if=/media/backup/fullmbr of=/dev/sda bs=512 count=18

Note that even if this works, this method is less flexible than understanding how GRUB works. Also,
reinstalling GRUB from a LiveCD (
http://ubuntuforums.org/showpost.php?p=1308395&postcount=1)
and simply backing up /boot/grub/menu.lst is probably safer, simpler, and in most cases sufficient.



Occasionally I've seen the stage1_5 bootloader occupy 18 sectors instead of 17. Here is how you can decide how many sectors you need to backup:


ls -l /boot/grub/e2fs_stage1_5

The output will show the size of the stage1.5 file in bytes:


-rw-r--r-- 1 root root 8660 2008-01-15 05:20 /boot/grub/e2fs_stage1_5
Divide 8860 by 512 and round up. 8860/512 = 17 sectors. (1 sector = 512 bytes).

1 sector for stage1 (MBR) plus 17 sectors for stage1.5 imply you need to backup 18 sectors:


sudo dd if=/dev/sda of=/media/backup/fullmbr bs=512 count=18

Also note that if /boot/grub is located on a partition with some other kind of filesystem other than ext2/ext3, then your stage1.5 file will be called something else (e.g. reiserfs_stage1_5), and you need to then look at the appropriate file to do the calculation properly.

Edit: caljohnsmith kindly pointed out to me that the above backup also saves sda's partition table. This means that if you actually use this method to backup your GRUB and subsequently edit your partition table, you must backup your GRUB again.

Edit2: I feel I should emphasize: I don't actually recommend anyone using the above method to backup GRUB. Knowing how to reinstall GRUB using the GRUB CLI would be a better method for all cases I can imagine.

wavingpines
October 14th, 2008, 08:11 PM
Hi meierfra

I checked my version of grub in Symantec and I was already up to date, and I didn't want a beta version on my main disk so I thought I'd do a fresh install onto /dev/sda! A few hours later and I'm really confused. I was trying to get to a point where I could have the Intrepid grub and installation on sda (my clunky old IDE drive) and Hardy grub and installation on sdb (my shiny new SATA drive), and boot whichever one I want with the BIOS <F11> option to choose which drive I boot from.

Can anyone recommend a good resource that explains how this all hangs together? I don't normally think of myself as slow but this is really making me feel dense!

meierfra.
October 14th, 2008, 09:14 PM
wavingpines:


didn't want a beta version on my main disk

No, that is not a beta version, It might even be the same version you already have. So



sudo grub-install --recheck /dev/sda

might already be enough to solve your problem.

(I only included "sudo apt-get purge grub, sudo apt-get install grub" to make sure that you have Hardy's version of grub and not still something left over from your earlier version)

Explanation: The ext3 filesystem has changed slightly over the last year or so. (using 256 inodes instead of 128 ). Older version of grub cannot read such a filesystem. But newer version use a modified "stage2" file, which allows grub to read the new filesystems.

You probably already have the new stage2 files on your computer. But since "grub-install" was not run during your upgrade to Hardy, the new stage2 files were not placed into the /boot/grub folder and so grub is still using the old stage2 files.

meierfra.
October 14th, 2008, 09:27 PM
so I thought I'd do a fresh install onto /dev/sda! A few hours later and I'm really confused. I was trying to get to a point where I could have the Intrepid grub and installation on sda (my clunky old IDE drive) and Hardy grub and installation on sdb (my shiny new SATA drive), and boot whichever one I want with the BIOS <F11> option to choose which drive I boot from.


What is your current status? What kind of problems to you have? To you still get "error 2" ? Did you reinstall both Intrepid and Hardy?

wavingpines
October 16th, 2008, 06:34 PM
Hi meierfra

My current status is as follows: I've installed Intrepid on /dev/sda2 and my existing Hardy installation is on /dev/sdb2. At one point I got Intrepid to boot and had grub 0.97-29ubuntu36; Hardy reports 0.97-29ubuntu21.

I'm not sure which drive I'm actually booting from, as disabling either drive from the BIOS setup results in the same grub menu!

Here's my menu.lst entry (from /dev/sdb2) for Hardy, which I had to edit to (HD0,1) to prevent the dreaded error 2, and this now works fine:

title Ubuntu 8.04.1, kernel 2.6.24-19-generic
root (hd0,1)
kernel /boot/vmlinuz-2.6.24-19-generic root=UUID=03858597-54c6-4ae2-a869-d06b132b909d ro quiet splash all_generic_ide
initrd /boot/initrd.img-2.6.24-19-generic
quiet

I've added an entry to try to boot Intrepid, as follows but get error 2 from the 'kernel' line:

title Ubuntu 8.10 (Intrepid), kernel 2.6.27-4-generic
root (hd0,1)
kernel /boot/vmlinuz-2.6.27-4-generic root=UUID=6f1a73e3-d8d5-4a8e-ad3f-927ef3fd42dd ro quiet splash
initrd /boot/initrd.img-2.6.27-4-generic
quiet

No matter what I do I can't boot from /dev/sda2 (Intrepid) any more!

As ever, any advice gratefully received!

unutbu
October 16th, 2008, 06:42 PM
wavingpines, let's try to find out which drive is controlling the boot process.

Please boot into Hardy and post the output of the following commands:


sudo dd if=/dev/sda bs=1 skip=64 count=1 | hexdump
sudo dd if=/dev/sda bs=1 skip=1049 count=2 | hexdump


sudo dd if=/dev/sdb bs=1 skip=64 count=1 | hexdump
sudo dd if=/dev/sdb bs=1 skip=1049 count=2 | hexdump


blkid
cat /boot/grub/menu.lst

wavingpines
October 16th, 2008, 07:59 PM
Here goes...

The DD output is ..


root@b4:~# dd if=/dev/sda bs=1 skip=64 count=1 | hexdump
1+0 records in
1+0 records out
1 byte (1 B) copied, 0.0326163 s, 0.0 kB/s
0000000 0081
0000001
root@b4:~# dd if=/dev/sda bs=1 skip=1049 count=2 | hexdump
2+0 records in
2+0 records out
2 bytes (2 B) copied, 0.000506783 s, 3.9 kB/s
0000000 8001
0000002
root@b4:~# dd if=/dev/sdb bs=1 skip=64 count=1 | hexdump
1+0 records in
1+0 records out
1 byte (1 B) copied, 3.2093e-05 s, 31.2 kB/s
0000000 00ff
0000001
root@b4:~# dd if=/dev/sdb bs=1 skip=1049 count=2 | hexdump
2+0 records in
2+0 records out
2 bytes (2 B) copied, 5.2626e-05 s, 38.0 kB/s
0000000 ff01
0000002

blkid gives:


/dev/sda2: UUID="6f1a73e3-d8d5-4a8e-ad3f-927ef3fd42dd" SEC_TYPE="ext2" TYPE="ext3"
/dev/sdb1: TYPE="swap" UUID="ff63c267-84cc-463c-8832-73b63dc8fc40"
/dev/sdb2: UUID="03858597-54c6-4ae2-a869-d06b132b909d" SEC_TYPE="ext2" TYPE="ext3"
/dev/sdb3: UUID="74b76190-b7e2-4d13-926b-3ee2c48cb8eb" SEC_TYPE="ext2" TYPE="ext3"
/dev/sda1: TYPE="swap" UUID="3f4f9d20-f58f-4a04-acc9-f6d7a63d066a"
/dev/sdb4: UUID="7188a87c-f5da-4fbd-ae76-baecde122f78" SEC_TYPE="ext2" TYPE="ext3"

And I'll attach my menu.lst due to the size.

unutbu
October 16th, 2008, 08:40 PM
To get Intrepid to boot, try the following:
Boot into Hardy.


sudo mv /boot/grub/menu.lst /boot/grub/menu.lst-20081016 # Save a backup so we can restore your current setting if necessary

Save the attachment below into your home account as "menu.lst.txt". Use the following command to copy it to /boot/grub


sudo cp ~/menu.lst.txt /boot/grub/menu.lst

Then try to boot Intrepid.

If it works, post Intrepid's /boot/grub/menu.lst and I'll edit that one too.

wavingpines
October 16th, 2008, 10:10 PM
Hi unutbu

Sorry, no joy ... still an 'error 2' from the kernel command :(

What was the rationale behind the changes?

Thanks again for you help

unutbu
October 16th, 2008, 10:59 PM
Issue #1: We don't know if your BIOS is currently set to boot the drive with Hardy on it, or the drive with Intrepid on it first. The one that BIOS boots (first) is the one whose menu.lst is getting read. We might be editing the wrong menu.lst, which might explain why there was no change in behavior.

Issue #2: You say this allows you to boot Hardy:


title Ubuntu 8.04.1, kernel 2.6.24-19-generic
root (hd0,1)
kernel /boot/vmlinuz-2.6.24-19-generic root=UUID=03858597-54c6-4ae2-a869-d06b132b909d ro quiet splash all_generic_ide
initrd /boot/initrd.img-2.6.24-19-generic
quiet

That's interesting, because (hd0,1) is GRUB terminology for /dev/sda2.
But if you look at the output of blkid, you see that


/dev/sda2: UUID="6f1a73e3-d8d5-4a8e-ad3f-927ef3fd42dd" SEC_TYPE="ext2" TYPE="ext3"

/dev/sda2's UUID is 6f1a73e3-d8d5-4a8e-ad3f-927ef3fd42dd, not 03858597-54c6-4ae2-a869-d06b132b909d. In fact, 03858597-54c6-4ae2-a869-d06b132b909d is the UUID of /dev/sdb2.

So IF the menu.lst you posted is actually the one that's getting read (see Issue #1),
then it is telling GRUB to look for /boot/initrd.img-2.6.24-19-generic and /boot/vmlinuz-2.6.24-19-generic on (hd0,1), i.e. /dev/sda2 (Intrepid) but then look for the rest of the root filesystem on the partition with UUID=03858597-54c6-4ae2-a869-d06b132b909d, i.e., /dev/sdb2.

That's a bit strange, and probably not what is intended.

So what should we do about this?

Well, here is what I suggest, let's try to solve issue #1 first. Once we know which menu.lst is getting read, we can look at it, and at least try to make changes that have a chance of being effective :)

Here is how:

Boot into Hardy.

gksu gedit /boot/grub/menu.lst
Go about 2/3 of the way down until you find


title Ubuntu 8.04.1, kernel 2.6.24-19-generic
root (hd0,1)
kernel /boot/vmlinuz-2.6.24-19-generic root=UUID=03858597-54c6-4ae2-a869-d06b132b909d ro quiet splash all_generic_ide
initrd /boot/initrd.img-2.6.24-19-generic
quiet

Change the title line to


title Ubuntu 8.04.1, kernel 2.6.24-19-generic (Hi there!)

(You can change it back once we get things working).

Save and exit gedit.

Now reboot. Get to the GRUB menu. Do you see a boot line which says "Hi there!"?
If you do, then we know that Hardy's menu.lst is getting read. Otherwise, it is Intrepid's.

If it is Hardy's please post back with that information.
If not, here is how to post Intrepid's:

Boot into Hardy

sudo mount /dev/sda2 /mnt
cp /mnt/boot/grub/menu.lst ~/menu.txt-Intrepid

Then post ~/menu.txt-Intrepid

wavingpines
October 17th, 2008, 12:04 PM
Issue #1: I know it's using the menu.lst from /dev/sdb2 (Hardy) as I manually added the Intrepid entry to it, and this change appeared the next time I rebooted.

Issue #2: Yup, I'm confused too, but I feel as though I don't properly understand exactly how the grub root comand and the kernel command root parameter work. My understanding from what I've read is:

The grub root command tells grub where to find it's own files, as well as the kernel and initrd files;
The kernel command root parameter is passed to the kernel to tell it what partition to use as the root of it's filesystem


In which case, I shouldn't be able to boot at all, because grub won't find an old Hardy kernel on the Intrepid partition :confused:

unutbu
October 17th, 2008, 01:01 PM
Attached is another menu.lst (called menu.lst2.txt to get around the file attachment restrictions based on file extension).

It adds three new boot options, without removing any of the ones you have currently. It is based off of the one you first posted, not the one I first posted in response.

The new options are label "new sda2", "new Intrepid/sda2" and "new Intrepid/sdb2". In each of these I simply tried straightening out the correlation between the grub root commands and the UUIDs. I also added the "all_generic_ide" kernel option to the kernel lines.

Please try out each of these boot options.
If none of these work, please post the output of


mount # This will confirm for us what partition is getting mounted as the root partition
sudo fdisk -lu # Prints the partition table.

unutbu
October 17th, 2008, 02:01 PM
wavingpines, have you tried meierfra.'s advice already? (See http://ubuntuforums.org/showpost.php?p=5965422&postcount=592)

Although the UUIDs in menu.lst probably do need to be straightened out, I think his explanation might be the reason you are getting Error #2.

wavingpines
October 17th, 2008, 05:36 PM
Hi unutbu, I didn't try meierfra.'s suggestion yet - given my set-up, should I specify sda or sdb on the grub-install command?

unutbu
October 17th, 2008, 06:37 PM
Since Hardy is the controlling partition and Hardy is /dev/sdb, try


sudo grub-install --recheck /dev/sdb

wavingpines
October 17th, 2008, 11:01 PM
OK, I did the "sudo grub-install --recheck /dev/sdb". My Hardy option stills boots normally, and Intrepid has a go but fails during the startup with a message "request_module: runaway loop modprobe binfmt-464c".

A quick google finds a few references to this, all of which make me feel a bit sheepish for not mentioning this before...My Hardy installation is 64bit, Intrepid is 32bit, and it seems that's the cause of this latest problem but I can't see a solution in any of the threads I've looked at:(

How about doing a "sudo grub-install --recheck /dev/sda" from my (32bit) Intrepid live CD to patch up the Intrepid installation, so then I can try to boot from either drive using my PC boot device menu?

wavingpines
October 17th, 2008, 11:46 PM
OK I risked it and gave it a try. I booted from my (32bit) live Intrepid CD and did the following:


mkdir /media/intrepid
mount /dev/sda2 /media/intrepid
grub-install --recheck --root-directory=/media/intrepid /dev/sda


I had tried a basic 'grub-install' but got an error message about /dev/sda not being a block device(?) A quick google found someone with the same problem on Ubuntu Blog (http://ubuntu.wordpress.com/) and some helpful guidance from Richard Clark (http://www.rclarksworld.com/) using the --root-directory parameter.

A big thanks to meierfra. and unutbu here on ubuntuforums and also to Ubuntu Blog and Richard Clark.

I'm now in dual-boot heaven :) Still a bit confused as to how my Hardy menu.lst works with root (hd0,1) entries, but hey, I can choose which environment to boot from my BIOS menu!

khaled4net
October 24th, 2008, 02:14 AM
I lost my Grub loader by windows installation. Now I try to reinstall it by the following way but failed every time. please help me-

1. I first boot from a live cd. then in terminal type the command-

sudo grub
2. grub shell appears. e.g. grub>

3. in this shell i type-
find /boot/grub/stage1

then i got (hd0,7)

4. Then type-

root(hd0,7)
But i got-
Error 27: Unrecognized command

5. Then type-

setup(hd0)
Again i got the same message-

Error 27: Unrecognized command

Anybody can say me what is the problem and why i got the same error again and again???

caljohnsmith
October 24th, 2008, 02:17 AM
Try using spaces between the command and the drive:

grub> root (hd0,7)
grub> setup (hd0)
:)

John Jason Jordan
November 16th, 2008, 09:06 PM
I have a computer with two two 320 GB Sata-2 hard drives. They are set up as RAID partitions as follows:

sda2 + sdb2 = md0 (swap, 2 GB)
sda1 + sdb1 = md1 (Intrepid, 50 GB)
sda3 + sdb3 = md2 (ext3, empty, 18 GB)
sda4 + sdb4 = md3 (ext3, data, 250 GB)

I installed Intrepid as a dist-upgrade over Hardy, which was a dist-upgrade over Gutsy, all x86_64. There are no other OSs on the computer.

Grub worked fine until after the upgrade to Intrepid. I found that a lot of stuff did not work. Eventually I discovered the problem - I was booting to 2.6.24-19 instead of the kernel required by Intrepid (2.6.27-7).

I can boot, but I can't get into the GUI because the login window won't take keystrokes. However, I can boot into Recovery mode and then a root shell prompt, where the keyboard does work.

The /boot/grub/menu.lst shows the only boot options are 2.6.27-7, regular and recovery, plus memtest. However, when the computer boots the Grub menu displays only 2.6.24-19. There's the problem. The MBR doesn't reflect the correct menu.lst entries.

I have tried numerous things, but I can't get the syntax and process correct. Once I managed to get the boot display to reflect the 2.6.27-7 kernel, but then I got Error 15, can't find the file.

Can someone tell me how to do the grub-install command and the grub root and grub setup commands for the above setup?

talsemgeest
November 16th, 2008, 09:47 PM
MAybe boot from a live cd, install dmraid and set it up so that it can see your hard drives, then run the grub commands.

John Jason Jordan
November 17th, 2008, 01:29 AM
MAybe boot from a live cd, install dmraid and set it up so that it can see your hard drives, then run the grub commands.

I can boot from a live CD, and I can install dmraid in it, but the instructions for dmraid are beyond my job performance level. :(

I can say that the live CD will not mount my raid partitions or the individual parts. Neither will a Knoppix live CD or any of the rescue disks that I have. The problem is that the devices are sda and sdb, but when the partitions were made part of a RAID array the RAID software created a superblock. That superblock blocks the operating system from seeing the underlying sda1-4 and sdb1-4 partitions so it can't mount them.

talsemgeest
November 17th, 2008, 01:54 AM
Oh, what kind have you done? Fake-RAID (raid devices set up in bios), hardware RAID (Hard drives are plugged in to a special RAID card in the computer), or software RAID (Setup using ubuntualternate cd to create RAID drives).

John Jason Jordan
November 17th, 2008, 02:47 AM
Oh, what kind have you done? Fake-RAID (raid devices set up in bios), hardware RAID (Hard drives are plugged in to a special RAID card in the computer), or software RAID (Setup using ubuntualternate cd to create RAID drives).

The RAID arrays were created with mdadm in Linux (software RAID).

talsemgeest
November 17th, 2008, 03:09 AM
Oh, sorry I have only ever tried with fake-raid. I'm not sure whether it dmraid works with software raid.

You will have to find some way to get the live cd to see your raid partitions. How though, I'm not sure.

amartinwest
November 18th, 2008, 05:25 PM
Thanks for this, I have a separate boot partition and although I mounted the boot drive on the root partition the find did not work. Since I knew where the boot partition was I just did root (hd0,2). The machine has Vista and the recovery drive as the first two partitions. When I did setup it then found /grub/stage1. So moral of the story is if you have a separate boot partition do find /grub/stage1.

shokora
November 19th, 2008, 11:07 AM
Nice tutorial, but it didn't quite work for me. I would like to add that if find /boot/grub/stage1 gives you hd1,? then you should run setup (hd1) instead of setup (hd0).

talsemgeest
November 19th, 2008, 11:11 AM
Nice tutorial, but it didn't quite work for me. I would like to add that if find /boot/grub/stage1 gives you hd1,? then you should run setup (hd1) instead of setup (hd0).
However, (hd0) is the drive the motherboard usually boots off, so unless you have changed it manually, it should be left at (hd0).

maxcomx
December 5th, 2008, 12:32 PM
It worked out for me, but i have a strange problem....
I explain:
I use a dualboot for ubuntu and vista,i accidentally install paragon boot manager on vista, witch messed up the mbr or what ever. I couldnot see the grub starting anymore it was the 'paragone boot manager' starting with 3 choise;vista,vistarecov and linux. None of them was working. What a boot manager !!! I tried some thing with the hiren boot cd to fix the mbr, well the best i got is a black screen before this dawm 'paragon boot manager' start, i'v been asking people on #ubuntu or #linux dont rember... So i heard that i should first reinstall the grub, allright, so i googled-it and get on this forum. Did what it says and restart get into ubuntu and it seems to be like new..
So now if i try to start vista, it doesnt work. and something weird append here, all the personal folder, you know like;picture,video,music etc of the vista OS are now in UBUNTU !! and what i had in ubuntu theyr gone if i had any, im not to sure. how the from one partition can get into another one like that. I mean its not that bad actually, but i can't acces the reste of that vista partition which makes me mad some how.

well, i'll try to find some way to fix that, if you got an idea let me know.

Cheers

paragkalra
December 7th, 2008, 09:42 AM
Thanks it worked for me as well...........

simonjp
December 7th, 2008, 11:30 PM
I used to dual-boot XP and Ubuntu and had to reinstall Windows thus loosing the grub loader and access to the Ibex install.

If I re-install the grub loader, will it still recognise my install of XP still and restore access to Ubuntu? Partition set-up is straight forward - XP on 1st partition, Ubuntu on 2nd.

caljohnsmith
December 8th, 2008, 12:05 AM
I used to dual-boot XP and Ubuntu and had to reinstall Windows thus loosing the grub loader and access to the Ibex install.

If I re-install the grub loader, will it still recognise my install of XP still and restore access to Ubuntu? Partition set-up is straight forward - XP on 1st partition, Ubuntu on 2nd.
Restoring Grub to the MBR (Master Boot Record) as per the directions in this thread won't automatically make Grub recognize your XP install; if you don't all ready have an entry for Win XP in your Grub's menu.lst, then once you restore Grub to the MBR and can boot into Ubuntu, just do the following once you can boot into Ubuntu:

gksudo gedit /boot/grub/menu.lst
And add at the bottom:

title Windows XP
root (hd0,0)
chainloader +1
And as long as you don't have any issues with Windows, that should be all it takes. Let me know if you run into problems though.

shedt
December 8th, 2008, 02:42 AM
Hello,

I have two hard disks. The main sata one has two partitions. One is for recovery. I have another ide drive.

The Ide drive was formatted ntfs, and then I installed ubuntu 8.10.

I then did a restore on my main drive thinkgin ubuntu would be fine or that it should be easy to fix.

Anyhow, I cannot re-install grub. I've tried for a while but I just can't do it. It won't mount etc etc.

Anyway's, I'm in the live CD. I can see all the files for linux but I don't know what's going on.

I can find grub manually in /media/ubuntu/disks/boot/grub

The drive is listed in fdisk as sdb1

It's the only partition.

I can mount it root (hd0,0) But setup won't work.

setup (hd0)
or
setup (hd1)


Error 17: Cannot mount selected partition

I'm wondering if grub or something in the mbr was changed? The main sata drive where XP is is:

Device Boot Start End Blocks Id System
/dev/sda1 * 1 23331 187406226 7 HPFS/NTFS
/dev/sda2 23332 24321 7952143+ c W95 FAT32 (LBA)

Do I need to install grub here somehow?

I'm really lost. I have files I need in ubuntu, just don't know how to get to them.

I really love it though. I have it also on my other gaming machine.

caljohnsmith
December 8th, 2008, 03:01 AM
So are you booting the SATA drive on start up? If so, try:

sudo grub
grub> root (hd1,0)
grub> setup (hd0)
grub> quit
And please post the output of all the above commands. If that doesn't work, let me know exactly what happens on start up, and also post the full output of:

sudo fdisk -lu
sudo xxd -l 2 -p /dev/sda
sudo xxd -s 1049 -l 2 -p /dev/sda
sudo xxd -l 2 -p /dev/sdb
sudo xxd -s 1049 -l 2 -p /dev/sdb
sudo mount /dev/sdb1 /mnt
ls -lR /mnt/boot
Note that "-l" is a lowercase L, not a one.

shedt
December 8th, 2008, 03:08 AM
Thanks, I just booted windows, I'll drop back to ubuntu live-cd.

I am running XP on the SATA, ubuntu is on the ide drive.

I'm guessing something on the sata was removed, since everything was installed on the ide drive.

Thank you again.

shedt
December 8th, 2008, 03:14 AM
Error 17: Cannot mount selected partition

I had tried something from one of the first pages about mounting the partition, but I could not get the proc I think it was called to work. I'll try the other things you posted.

Thanks again.

shedt
December 8th, 2008, 03:15 AM
Disk /dev/sda: 200.0 GB, 200049647616 bytes
255 heads, 63 sectors/track, 24321 cylinders, total 390721968 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xcab10bee

Device Boot Start End Blocks Id System
/dev/sda1 * 63 374812514 187406226 7 HPFS/NTFS
/dev/sda2 374812578 390716864 7952143+ c W95 FAT32 (LBA)

Disk /dev/sdb: 163.9 GB, 163928604672 bytes
255 heads, 63 sectors/track, 19929 cylinders, total 320173056 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xa99ba99b

Device Boot Start End Blocks Id System
/dev/sdb1 63 320159384 160079661 7 HPFS/NTFS

shedt
December 8th, 2008, 03:18 AM
ubuntu@ubuntu:~$ sudo xxd -l 2 -p /dev/sda
33ff
ubuntu@ubuntu:~$ sudo xxd -s 1049 -l 2 -p /dev/sda
0000
ubuntu@ubuntu:~$ sudo xxd -s 1049 -l -p /dev/sdb
ubuntu@ubuntu:~$ sudo mount /dev/sdb1 /mnt
ubuntu@ubuntu:~$ ls -lR /mnt/boot
ls: cannot access /mnt/boot: No such file or directory

caljohnsmith
December 8th, 2008, 03:24 AM
When you installed Ubuntu, did you choose the "Install Ubuntu" option from the first main menu of the Live CD? Or did you choose "Try Ubuntu without making changes", boot to the desktop, and then run the Installer that is on the desktop? Because if you did the latter case, Ubuntu needs to be installed to a partition with a linux file system, such as ext3, not NTFS like sdb1 is currently. Or if you did the first case above, then you installed Ubuntu inside of Windows as a "wubi" install. Please let me know what you which method you used to install Ubuntu before we proceed further. :)

shedt
December 8th, 2008, 03:46 AM
Well, I think I used wubi. But I did install inside of the ntfs. There are folders and disk images as far as i can tell. I hope this is nto too bad.

I say I think becuase I tried wubi but I'm not too sure if it worked, plus I installed on two machines yesterday. I'm pretty sure it was the wubi as it only let me use 30 gigs of the ntfs.

thanks again!

caljohnsmith
December 8th, 2008, 03:54 AM
OK, how about posting the output of:

sudo mount /dev/sdb1 /mnt
ls -l /mnt
ls -lR /mnt/ubuntu
Do you have Windows installed on sda1? And do you get the Grub error 17 after you select Ubuntu from the boot menu, or before you even see a boot menu? Please post the following commands again, but try to not have any typos this time:

sudo xxd -l 2 -p /dev/sdb
sudo xxd -s 1049 -l 2 -p /dev/sdb
Note "-l" is a lowercase L, not a one.

shedt
December 8th, 2008, 03:55 AM
Thanks i will try now, I was just looking through the menu file. I did not realize wubi was different.

shedt
December 8th, 2008, 03:59 AM
ubuntu@ubuntu:~$ sudo mount /dev/sdb1 /mnt
fuse: mount failed: Device or resource busy
ubuntu@ubuntu:~$ ls -l /mnt
total 233
-rwxrwxrwx 1 root root 56 2008-12-08 01:57 fix grub
drwxrwxrwx 1 root root 0 2008-12-06 03:57 Recycled
drwxrwxrwx 1 root root 4096 2008-12-08 00:43 RECYCLER
-rwxrwxrwx 1 root root 3498 2008-12-07 23:22 send me disc
drwxrwxrwx 1 root root 4096 2008-12-06 10:08 System Volume Information
drwxrwxrwx 1 root root 4096 2008-12-06 04:13 ubuntu
-rwxrwxrwx 2 root root 4335 2005-12-10 18:24 Untitled22.ses
drwxrwxrwx 1 root root 12288 2008-12-07 15:15 Windows Files
-rwxrwxrwx 1 root root 192307 2008-10-27 17:37 wubildr
-rwxrwxrwx 1 root root 8192 2008-10-27 17:37 wubildr.mbr
ubuntu@ubuntu:~$ ls -lR /mnt/ubuntu
/mnt/ubuntu:
total 156
-rwxrwxrwx 1 root root 1833 2008-12-06 04:13 curl_log.txt
drwxrwxrwx 1 root root 0 2008-12-06 04:13 disks
drwxrwxrwx 1 root root 0 2008-12-06 04:12 docs
drwxrwxrwx 1 root root 4096 2008-12-06 04:27 install
-rwxrwxrwx 2 root root 2650 2008-12-06 04:13 metadl_log.txt
-rwxrwxrwx 1 root root 25214 2008-10-27 17:37 Ubuntu.ico
-rwxrwxrwx 2 root root 118608 2008-12-06 04:12 Uninstall-Ubuntu.exe
drwxrwxrwx 1 root root 0 2008-12-06 04:12 winboot

/mnt/ubuntu/disks:
total 29296884
drwxrwxrwx 1 root root 4096 2008-12-06 06:33 boot
-rwxrwxrwx 2 root root 29000000000 2008-12-06 21:08 root.disk
drwxrwxrwx 1 root root 0 2008-12-06 04:12 shared
-rwxrwxrwx 2 root root 1000000000 2008-12-06 04:16 swap.disk

/mnt/ubuntu/disks/boot:
total 25940
-rwxrwxrwx 1 root root 503560 2008-11-04 20:53 abi-2.6.27-7-generic
-rwxrwxrwx 1 root root 503560 2008-11-20 23:30 abi-2.6.27-9-generic
-rwxrwxrwx 1 root root 85316 2008-11-04 20:53 config-2.6.27-7-generic
-rwxrwxrwx 1 root root 85316 2008-11-20 23:30 config-2.6.27-9-generic
drwxrwxrwx 1 root root 0 2008-12-06 06:32 grub
-rwxrwxrwx 1 root root 8922653 2008-12-06 06:32 initrd.img-2.6.27-7-generic
-rwxrwxrwx 1 root root 8923020 2008-12-06 06:33 initrd.img-2.6.27-9-generic
-rwxrwxrwx 1 root root 124152 2008-09-11 20:11 memtest86+.bin
-rwxrwxrwx 1 root root 1352144 2008-11-04 20:53 System.map-2.6.27-7-generic
-rwxrwxrwx 1 root root 1352144 2008-11-20 23:30 System.map-2.6.27-9-generic
-rwxrwxrwx 1 root root 1130 2008-11-04 20:57 vmcoreinfo-2.6.27-7-generic
-rwxrwxrwx 1 root root 1130 2008-11-20 23:32 vmcoreinfo-2.6.27-9-generic
-rwxrwxrwx 1 root root 2339552 2008-11-04 20:53 vmlinuz-2.6.27-7-generic
-rwxrwxrwx 1 root root 2339712 2008-11-20 23:30 vmlinuz-2.6.27-9-generic

/mnt/ubuntu/disks/boot/grub:
total 17
-rwxrwxrwx 1 root root 191 2008-12-06 04:26 default
-rwxrwxrwx 1 root root 45 2008-12-06 04:26 device.map
-rwxrwxrwx 1 root root 5236 2008-12-06 06:32 menu.lst
-rwxrwxrwx 1 root root 5152 2008-12-06 06:32 menu.lst~

/mnt/ubuntu/disks/shared:
total 0

/mnt/ubuntu/docs:
total 0

/mnt/ubuntu/install:
total 0

/mnt/ubuntu/winboot:
total 408
-rwxrwxrwx 1 root root 806 2008-10-27 17:37 menu.lst
-rwxrwxrwx 1 root root 192307 2008-10-27 17:37 wubildr
-rwxrwxrwx 1 root root 209235 2008-10-27 17:37 wubildr.exe
-rwxrwxrwx 1 root root 8192 2008-10-27 17:37 wubildr.mbr
ubuntu@ubuntu:~$ sudo xxd -l 2 -p /dev/sdb
33c0
ubuntu@ubuntu:~$ sudo -s 1049 -l 2 -p /dev/sdb
/bin/bash: 1049: No such file or directory
ubuntu@ubuntu:~$

thanks again, I'm learning :)

:guitar:

caljohnsmith
December 8th, 2008, 04:03 AM
Do you know which drive you are booting on start up? How about also posting:

sudo umount /mnt
sudo mount /dev/sda1 /mnt
ls -l /mnt
cat /mnt/boot.ini

shedt
December 8th, 2008, 04:05 AM
I think I almost got it from following here:

https://wiki.ubuntu.com/WubiGuide#Cannot%20boot%20into%20Ubuntu

shedt
December 8th, 2008, 04:11 AM
Do you know which drive you are booting on start up? How about also posting:

sudo umount /mnt
sudo mount /dev/sda1 /mnt
ls -l /mnt
cat /mnt/boot.ini

I'm booting on startup my XP drive which is sda1 I guess.

The ubuntu drive is sdb1

So far this has worked, trying to figure out the rest:




ubuntu@ubuntu:~$ sudo mkdir /win
ubuntu@ubuntu:~$ sudo mount /dev/sdb1 /win
ubuntu@ubuntu:~$ sudo mkdir /vdisk
ubuntu@ubuntu:~$ sudo mount -o loop /win/ubuntu/disks/root.disk /vdisk



How can I access my Wubi install and repair my install if it won't boot?

Boot the Ubuntu Desktop CD, or another LiveCD, then mount the windows partition:

sudo mkdir /win
sudo mount /dev/sda1 /win

Replace sda1 with the appropriate device (a = disk, 1 = partition number), then mount the virtual disk therein

sudo mkdir /vdisk
sudo mount -o loop /win/ubuntu/disks/root.disk /vdisk

Now the content of the virtual disk will be visible under /vdisk. 7.04 users will have to install ntfs-3g first and specify it as fstype to gain r/w access.

To check the filesystem you can use:

sudo fsck /win/ubuntu/disks/root.disk

Yeah sda1 is windows.

shedt
December 8th, 2008, 04:22 AM
If I have it mounted and I am browsed too:

root@ubuntu:/win/ubuntu/disks/boot/grub#

Can I not somehow run grub again from here?

I'll try some more. Thanks again

:)

caljohnsmith
December 8th, 2008, 04:28 AM
While you have sdb1 mounted on /win, how about posting the output of:

cat /win/ubuntu/disks/boot/grub/menu.lst
That will definitely help clarify your problem. Also, just to let you know, I have to leave now and won't be around until tomorrow morning sometime. We can pick up from there if you haven't all ready solved it.

shedt
December 8th, 2008, 04:36 AM
Thank you for your help caljohnsmith.

i really appreciate it. I'm just going to mount the disk from within windows and get the files i need. Tomorrow I will just install Ubuntu properly without wubi.

My bad making you run around in circles (and myself)

But I have learned a few things.

Thanks again!

:guitar:

gychang
December 9th, 2008, 04:11 AM
This will restore grub if you already had grub installed but lost it to a windows install or some other occurence that erased/changed your MBR so that grub no longer appears at start up or it returns an error.

(This how to is written for Ubuntu but should work on other systems. The only thing to take note of, when you see "sudo" that will mean to you that the following command should be entered at a root terminal.)

Boot into the live Ubuntu cd. This can be the live installer cd or the older live session Ubuntu cds.

When you get to the desktop open a terminal and enter. (I am going to give you the commands and then I will explain them later)


sudo grub

This will get you a "grub>" prompt (i.e. the grub shell). At grub>. enter these commands


find /boot/grub/stage1

This will return a location. If you have more than one, select the installation that you want to provide the grub files.
Next, THIS IS IMPORTANT, whatever was returned for the find command use it in the next line (you are still at grub>. when you enter the next 3 commands)


root (hd?,?)
Again use the value from the find command i.e. if find returned (hd0,1) then you would enter root (hd0,1)

Next enter the command to install grub to the mbr


setup (hd0)

Finally exit the grub shell

quit

That is it. Grub will be installed to the mbr.
When you reboot, you will have the grub menu at startup.

l][/COLOR]

thanks very much, works like a charm.

gychang

philetus
December 12th, 2008, 08:48 PM
ubuntu@ubuntu:~$ sudo mount -t ext3 /dev/sda6 /mnt/root
ubuntu@ubuntu:~$ sudo mount -t proc none /mnt/root/proc
mount: mount point /mnt/root/proc does not exist
ubuntu@ubuntu:~$ sudo mount -t proc none /mnt/root/proc
mount: mount point /mnt/root/proc does not exist
ubuntu@ubuntu:~$ sudo mkdir /mnt/root/proc
ubuntu@ubuntu:~$ sudo mount -t ext3 /dev/sda6 /mnt/root
mount: /dev/sda6 already mounted or /mnt/root busy
mount: according to mtab, /dev/sda6 is already mounted on /mnt/root

philetus
December 12th, 2008, 09:06 PM
Do I need to start from scratch and reinstall intrepid?

saurabh kakkar
December 26th, 2008, 06:04 PM
plz help me
my sys has stared giving Error 17 :(
when i try



grub> find /boot/grub/stage1

it gives following error


Error 15: File not found


Now when i try mounting root partition using the livecd:

I dont know what is my root partition to be put in this command


sudo mount -t ext3 /dev/sda6 /mnt/root

what shud i do ???
My
sudo fdisk -l
output is :


Disk /dev/sda: 80.0 GB, 80060424192 bytes
255 heads, 63 sectors/track, 9733 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes

Device Boot Start End Blocks Id System
/dev/sda1 * 1 1912 15358108+ c W95 FAT32 (LBA)
/dev/sda2 1913 9000 56934360 f W95 Ext'd (LBA)
/dev/sda3 9001 9733 5887822+ 7 HPFS/NTFS
/dev/sda5 1913 4462 20482843+ b W95 FAT32
/dev/sda6 4463 7012 20482843+ b W95 FAT32
/dev/sda7 7013 8960 15647278+ b W95 FAT32
/dev/sda8 8961 9000 321268+ 82 Linux swap / Solaris


EDIT
Bull **** my bro had formated my ubuntu partition oh man
actually in win xp i had installed software to see my ubuntu partition
he mistakenly formated this drive

now i will have to install ubuntu again

unutbu
December 26th, 2008, 07:41 PM
The output of fdisk shows that according to your current partition table, you have no Linux root partition.

Do you believe that you should have a Linux partition, and that it has been overwritten by a partition editor or operating system installer?

If this is the case, it might be possible to restore your old partition table (with the Linux root partition) by using testdisk (http://www.cgsecurity.org/wiki/TestDisk). However, if files have been written to the Win95 FAT32 partitions which are currently occupying the space where the Linux partition used to be, then you will suffer some (possibly extensive) data loss.

So please tell us more about your situation, and how it came to be that there is no Linux partition. Maybe if we understand more we can give you better advice about what to do next.

Stargazer989
December 27th, 2008, 05:23 PM
i did it the way Tosk posted... but i shutdown... rather, i used hibernate like i normally do and i'm still geting errors: 16, 17 or 18.
in the past, i've used hibernate almost daily(just about daily unless there was a restart reuired because of an update). but now, for some reason, GRUB just flopped. :|
Using Ubuntu 8.04 Hardy Heron.
any ideas ?

unutbu
December 27th, 2008, 05:55 PM
Please run the following command and post the RESULTS.txt file that it outputs.

cd ~/Desktop && wget 'http://home.comcast.net/~ubuntu_grub/boot_info_script.txt' && sudo bash boot_info_script.txt
The RESULTS.txt file will give us information about your boot setup.

Stargazer989
December 27th, 2008, 06:42 PM
results in attachment.

unutbu
December 27th, 2008, 07:31 PM
While booted from the Live CD, try the following commands and please post the output:


sudo tune2fs -l /dev/sda3

Also, when you try booting Ubuntu from the sda hard drive now, do you currently get GRUB error #16, #17 or #18?

Do you see the error before reaching the GRUB menu, or after?

Stargazer989
December 27th, 2008, 07:42 PM
tune2fs 1.40.8 (13-Mar-2008)
Filesystem volume name: <none>
Last mounted on: <not available>
Filesystem UUID: a1bf78f0-d25c-4870-8916-9c06673b2bad
Filesystem magic number: 0xEF53
Filesystem revision #: 1 (dynamic)
Filesystem features: has_journal ext_attr resize_inode dir_index filetype sparse_super large_file
Filesystem flags: signed_directory_hash
Default mount options: (none)
Filesystem state: clean
Errors behavior: Continue
Filesystem OS type: Linux
Inode count: 4014080
Block count: 16052951
Reserved block count: 802647
Free blocks: 9631994
Free inodes: 3758238
First block: 0
Block size: 4096
Fragment size: 4096
Reserved GDT blocks: 1020
Blocks per group: 32768
Fragments per group: 32768
Inodes per group: 8192
Inode blocks per group: 256
Filesystem created: Sun Jul 6 20:07:57 2008
Last mount time: Sat Dec 27 17:37:40 2008
Last write time: Sat Dec 27 17:37:40 2008
Mount count: 20
Maximum mount count: 37
Last checked: Tue Oct 7 02:54:53 2008
Check interval: 15552000 (6 months)
Next check after: Sun Apr 5 02:54:53 2009
Reserved blocks uid: 0 (user root)
Reserved blocks gid: 0 (group root)
First inode: 11
Inode size: 128
Journal inode: 8
Default directory hash: tea
Directory Hash Seed: dbf9ce89-c73e-462a-8589-01184636fe6e
Journal backup: inode blocks

i'm assuming the GRUB menu is where i get to pick which OS/version, right ? so it's before... and as for the error... it's somewhat 'random' ... i boot and get 16.. later i boot and get 18... later it'd be 17. no pattern as far as i know.

unutbu
December 27th, 2008, 08:33 PM
Unfortunately, I don't know the answer to your problem.
The part about the GRUB error changing randomly is particularly surprising/worrisome to me. Usually I would expect the results of a boot to be repeatable. To have randomly changing results when you repeat the same experiment would suggest hardware failure to me... but I could be wrong.

Moreover, GRUB errors 16,17,18 are quite different in nature:


16: Inconsistent filesystem structure
This error is returned by the filesystem code to denote an internal error caused by the sanity checks of the filesystem structure on disk not matching what it expects. This is usually caused by a corrupt filesystem or bugs in the code handling it in GRUB.
17: Cannot mount selected partition
This error is returned if the partition requested exists, but the filesystem type cannot be recognized by GRUB.
18: Selected cylinder exceeds maximum supported by BIOS
This error is returned when a read is attempted at a linear block address beyond the end of the BIOS translated area. This generally happens if your disk is larger than the BIOS can handle (512MB for (E)IDE disks on older machines or larger than 8GB in general).

(see http://www.gnu.org/software/grub/manual/grub.html#Troubleshooting)

I suggest you start a new thread in the Absolute Beginners Forum to ask about this problem. There are some very knowledgable forum helpers there who might not be subscribed to an ultra-long thread such as this one. Doing so will also bring your problem to the attention of the Unanswered Posts Team.


If you repeat the information you posted here (including results.doc and emphasizing that the grub error comes before the GRUB menu, and that the error changes between 16,17,18 randomly) that will give them a head start.

tad1073
December 27th, 2008, 08:54 PM
This how to saved my a** last night. I have a 64 bit machine w/ Ubuntu 8.10 x86_64 and 8.04 32 bit. I removed 8.04 and when I rebooted got grub error 22. Booted the live cd, followed tour tut. and bam!!! got grub back.

Many many many thanks...

Stargazer989
December 27th, 2008, 10:35 PM
http://ubuntuforums.org/showthread.php?p=6445527 if anybody can diagnose the problem post there or here or post here and link me on there. lol

robertj20112
December 29th, 2008, 12:49 PM
Thank you so much, Catlett. Your clear tutorial on how to restore grub to the MBR allowed me to dump Vista from my triple-boot configuration without disturbing XP or Hardy. Have been using Hardy since September and am completely sold on it. What a terrific package, only surpassed by the great folks like yourself who provide the help we newbies need. Hope one day to be able to help others the way you do.

FerociousTwig
December 30th, 2008, 08:29 PM
Is there any easy way to tell what partitions are named what?
So like... is sda1 my windows partition or the recovery partition that my dell came preinstalled with?

unutbu
December 30th, 2008, 09:10 PM
To get a listing of your partition table, open a Terminal (Applications>Accessories>Terminal) and type


sudo fdisk -l
Note above, -l is a minus lowercase L, not a minus one.

This will give you a listing that looks something like this:


Disk /dev/sda: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x48000000

Device Boot Start End Blocks Id System
/dev/sda1 1 7 56196 de Dell Utility
/dev/sda2 8 660 5245222+ b W95 FAT32
/dev/sda3 * 661 3210 20482875 83 Linux
/dev/sda4 3211 38913 286784347+ 5 Extended
/dev/sda5 3211 5760 20482843+ 83 Linux
/dev/sda6 5761 22209 132126561 83 Linux
/dev/sda7 22210 38658 132126561 83 Linux
/dev/sda8 38659 38913 2048256 82 Linux swap / Solaris

The "System" column lists the partition type.
The "Blocks" column lists the size of the partition in 1K-blocks (KiB).

If you'd like to look at the files in a partition, you can do that once the partition is mounted. The command to mount a partition is


sudo mount /dev/sda1 /mnt
(Change sda1 to the partition you wish to mount, change /mnt to whatever mount point you wish).

You can then look at the files in /mnt using the command


ls -l /mnt
or a file manager like nautilus.

von Stalhein
January 3rd, 2009, 12:05 PM
I tried the live disk stuff from the first post to restore my dual boot Ibex/XP setup, to no avail.

I installed a new optical drive today, and the SATA plugs have obviously gone back into different slots :D

My old GRUB was thus: -

title Microsoft Windows XP Home Edition
root (hd1,0)
savedefault
makeactive
map (hd0) (hd1)
map (hd1) (hd0)
chainloader +1

The present fdisk is this: -


Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x960c960c

Device Boot Start End Blocks Id System
/dev/sda1 * 1 14593 117218241 7 HPFS/NTFS

Disk /dev/sdb: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xa3f79c20

Device Boot Start End Blocks Id System
/dev/sdb1 2 14593 117210240 f W95 Ext'd (LBA)
/dev/sdb5 2 14593 117210208+ 7 HPFS/NTFS

Disk /dev/sdc: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xf66fc667

Device Boot Start End Blocks Id System
/dev/sdc1 * 1 18700 150207718+ 83 Linux
/dev/sdc2 18701 19457 6080602+ f W95 Ext'd (LBA)
/dev/sdc5 18701 19457 6080571 82 Linux swap / Solaris


What do I change the old GRUB to so I get back to where I was???
TIA

unutbu
January 3rd, 2009, 12:32 PM
When adding a new drive, the most likely problem is that the BIOS's numbering of the drives has changed.

GRUB references partitions using this notation: (hdX,Y). The X refers to the drive number, the Y refers to the partition number. So the values of X used in /boot/grub/menu.lst are probably off by one.

If so, the problem can be fixed by adding lines like this to /boot/grub/menu.lst:


title Microsoft Windows XP Home Edition (hd2,0)
root (hd2,0)
savedefault
makeactive
map (hd0) (hd2)
map (hd2) (hd0)
chainloader +1

title Microsoft Windows XP Home Edition (hd0,0)
root (hd0,0)
savedefault
makeactive
chainloader +1

The first boot stanza should work if the BIOS lists the Windows drive as drive #3.

The second boot stanza should work if the BIOS lists the Windows drive as drive #1.

Save this in /boot/grub/menu.lst and then reboot.
You will be given two new boot options for Windows. Try each. One should work. Once you find the one that works, you can edit /boot/grub/menu.lst again to remove the bogus boot stanzas.

If the above does not work, then please post back with the following information:


What are your current symptoms? That is, when you boot up,
Do you see a GRUB Error? If so, which number?
Do you make it to the GRUB menu?
Are you having trouble booting XP, or Ibex, or both?


If you can boot the LiveCD and get an internet connection, running this command would help clarify your boot setup:


cd ~/Desktop && wget 'http://home.comcast.net/~ubuntu_grub/boot_info_script.txt' && sudo bash boot_info_script.txt
The command will produce a file called RESULTS.txt. Please post that file here.

von Stalhein
January 3rd, 2009, 01:07 PM
1. Usually Error 12, depending on where I swap the sata connectors.
2. Yes
3. No trouble with either, just trouble with both - I can only do one or the other, depending on the boot order in the BIOS.

OK, here it is :D


============================= Boot Info Summary: ==============================

=> Grub is installed in the MBR of /dev/sda and looks on boot drive #3 in
partition #1 for its boot files.
=> Windows is installed in the MBR of /dev/sdb
=> Grub is installed in the MBR of /dev/sdc and looks on the same drive in
partition #1 for its boot files.

sda1: __________________________________________________ _______________________

File system: ntfs
Boot sector type: Windows XP
Boot sector info: The info in boot sector on the starting sector of the
MFT is wrong. The info in the boot sector on the
starting sector of the MFT Mirror is wrong. According
to the info in the boot sector, sda1 has 234436480
sectors, but according to the info from fdisk, it has
234436482 sectors.
Operating System: Windows XP
Boot files/dirs: /boot.ini /ntldr /NTDETECT.COM

sdb1: __________________________________________________ _______________________

File system: Extended Partition

sdb5: __________________________________________________ _______________________

File system: ntfs
Boot sector type: Windows XP
Boot sector info: According to the info in the boot sector, sdb5 starts
at sector 63, but according to the info from fdisk,
sdb5 starts at sector 16128 .
Operating System:
Boot files/dirs:

sdc1: __________________________________________________ _______________________

File system: ext3
Boot sector type: No Boot Loader
Boot sector info:
Operating System: Ubuntu 8.10
Boot files/dirs: /boot/grub/menu.lst /etc/fstab /boot /boot/grub

sdc2: __________________________________________________ _______________________

File system: Extended Partition

sdc5: __________________________________________________ _______________________

File system: swap

=========================== Drive/Partition Info: =============================

Drive sda: __________________________________________________ ___________________

fdisk -lu /dev/sda:

Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x960c960c

Device Boot Start End Blocks Id System
/dev/sda1 * 63 234436544 117218241 7 HPFS/NTFS

sfdisk -V /dev/sda:

/dev/sda: OK

Drive sdb: __________________________________________________ ___________________

fdisk -lu /dev/sdb:

Disk /dev/sdb: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xa3f79c20

Device Boot Start End Blocks Id System
/dev/sdb1 16065 234436544 117210240 f W95 Ext'd (LBA)
/dev/sdb5 16128 234436544 117210208+ 7 HPFS/NTFS

sfdisk -V /dev/sdb:

Warning: no primary partition is marked bootable (active)
This does not matter for LILO, but the DOS MBR will not boot this disk.
/dev/sdb: OK

Drive sdc: __________________________________________________ ___________________

fdisk -lu /dev/sdc:

Disk /dev/sdc: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xf66fc667

Device Boot Start End Blocks Id System
/dev/sdc1 * 63 300415499 150207718+ 83 Linux
/dev/sdc2 300415500 312576704 6080602+ f W95 Ext'd (LBA)
/dev/sdc5 300415563 312576704 6080571 82 Linux swap / Solaris

sfdisk -V /dev/sdc:

/dev/sdc: OK

blkid -c /dev/null: __________________________________________________ __________

/dev/sda1: UUID="01C3D871F965AC80" LABEL="DSK1_VOL1" TYPE="ntfs"
/dev/sdb5: UUID="A83CB1173CB0E18C" LABEL="Disk 2" TYPE="ntfs"
/dev/sdc1: UUID="756b6798-621b-4d0c-a622-d079cd159cf0" SEC_TYPE="ext2" TYPE="ext3"
/dev/sdc5: TYPE="swap" UUID="4e2664d2-a70a-469b-9242-1adb97db8229"
/dev/loop0: TYPE="squashfs"

=============================== "mount" output: ===============================

/proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
tmpfs on /lib/modules/2.6.27-7-generic/volatile type tmpfs (rw,mode=0755)
tmpfs on /lib/modules/2.6.27-7-generic/volatile type tmpfs (rw,mode=0755)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
varrun on /var/run type tmpfs (rw,nosuid,mode=0755)
varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
rootfs on / type rootfs (rw)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
/dev/scd1 on /cdrom type iso9660 (ro,noatime)
/dev/loop0 on /rofs type squashfs (ro,noatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
gvfs-fuse-daemon on /home/ubuntu/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=ubuntu)



================================ sda1/boot.ini: ================================

[boot loader]

timeout=30

default=multi(0)disk(0)rdisk(0)partition(1)\WINDOW S

[operating systems]

multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Home Edition" /fastdetect /NoExecute=OptIn


=========================== sdc1/boot/grub/menu.lst: ===========================


# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not change this entry to 'saved' or your
# array will desync and will not let you boot your system.
default 0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 15

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu

# Pretty colours
#color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
## password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=756b6798-621b-4d0c-a622-d079cd159cf0 ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,0)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash vga=771

## should update-grub lock old automagic boot options
## e.g. lockold=false
## lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(single-user) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

## ## End Default Options ##

splashimage=(hd0,0)/boot/grub/splash.xpm.gz

title Chainload into GRUB 2
root (hd0,0)
kernel /boot/grub/core.img

title ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
root

title When you have verified GRUB 2 works, you can use this command to
root

title complete the upgrade: upgrade-from-grub-legacy
root

title ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
root

title Debian GNU/Linux, kernel 2.6.27-11-generic
root (hd0,0)
kernel /boot/vmlinuz-2.6.27-11-generic root=UUID=756b6798-621b-4d0c-a622-d079cd159cf0 ro quiet splash vga=771
initrd /boot/initrd.img-2.6.27-11-generic

title Debian GNU/Linux, kernel 2.6.27-11-generic (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.27-11-generic root=UUID=756b6798-621b-4d0c-a622-d079cd159cf0 ro single
initrd /boot/initrd.img-2.6.27-11-generic

title Debian GNU/Linux, kernel 2.6.27-10-generic
root (hd0,0)
kernel /boot/vmlinuz-2.6.27-10-generic root=UUID=756b6798-621b-4d0c-a622-d079cd159cf0 ro quiet splash vga=771
initrd /boot/initrd.img-2.6.27-10-generic

title Debian GNU/Linux, kernel 2.6.27-10-generic (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.27-10-generic root=UUID=756b6798-621b-4d0c-a622-d079cd159cf0 ro single
initrd /boot/initrd.img-2.6.27-10-generic

title Debian GNU/Linux, kernel 2.6.27-8-generic
root (hd0,0)
kernel /boot/vmlinuz-2.6.27-8-generic root=UUID=756b6798-621b-4d0c-a622-d079cd159cf0 ro quiet splash vga=771
initrd /boot/initrd.img-2.6.27-8-generic

title Debian GNU/Linux, kernel 2.6.27-8-generic (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.27-8-generic root=UUID=756b6798-621b-4d0c-a622-d079cd159cf0 ro single
initrd /boot/initrd.img-2.6.27-8-generic

title Debian GNU/Linux, kernel 2.6.27-7-generic
root (hd0,0)
kernel /boot/vmlinuz-2.6.27-7-generic root=UUID=756b6798-621b-4d0c-a622-d079cd159cf0 ro quiet splash vga=771
initrd /boot/initrd.img-2.6.27-7-generic

title Debian GNU/Linux, kernel 2.6.27-7-generic (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.27-7-generic root=UUID=756b6798-621b-4d0c-a622-d079cd159cf0 ro single
initrd /boot/initrd.img-2.6.27-7-generic

title Debian GNU/Linux, kernel 2.6.24-21-generic
root (hd0,0)
kernel /boot/vmlinuz-2.6.24-21-generic root=UUID=756b6798-621b-4d0c-a622-d079cd159cf0 ro quiet splash vga=771
initrd /boot/initrd.img-2.6.24-21-generic

title Debian GNU/Linux, kernel 2.6.24-21-generic (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.24-21-generic root=UUID=756b6798-621b-4d0c-a622-d079cd159cf0 ro single
initrd /boot/initrd.img-2.6.24-21-generic

title Debian GNU/Linux, kernel 2.6.20-16-generic
root (hd0,0)
kernel /boot/vmlinuz-2.6.20-16-generic root=UUID=756b6798-621b-4d0c-a622-d079cd159cf0 ro quiet splash vga=771
initrd /boot/initrd.img-2.6.20-16-generic

title Debian GNU/Linux, kernel 2.6.20-16-generic (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.20-16-generic root=UUID=756b6798-621b-4d0c-a622-d079cd159cf0 ro single
initrd /boot/initrd.img-2.6.20-16-generic

title Debian GNU/Linux, kernel memtest86+
root (hd0,0)
kernel /boot/memtest86+.bin

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title Systems for teh n00bs!!!:
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sdb1
title Microsoft Windows XP Home Edition
root (hd0,1)
savedefault
makeactive
map (hd0) (hd1)
map (hd1) (hd0)
chainloader +1


=============================== sdc1/etc/fstab: ===============================

# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/sda1
UUID=756b6798-621b-4d0c-a622-d079cd159cf0 / ext3 defaults,errors=remount-ro,relatime 0 1
# /dev/sda5
UUID=059e0975-883a-4693-9bf3-6bec10b11ea6 none swap sw 0 0
/dev/cdrom /media/cdrom0 udf,iso9660 user,noauto 0 0
/dev/scd1 /media/cdrom1 udf,iso9660 user,noauto 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto 0 0

================================== sdc1/boot: ==================================

total 83500
drwxr-xr-x 3 root root 4096 2008-12-21 12:29 .
drwxrwxrwx 23 root root 4096 2008-12-21 12:28 ..
-rw-r--r-- 1 root root 414274 2007-09-23 20:28 abi-2.6.20-16-generic
-rw-r--r-- 1 root root 422838 2008-10-22 03:12 abi-2.6.24-21-generic
-rw-r--r-- 1 root root 507990 2008-11-21 13:46 abi-2.6.27-10-generic
-rw-r--r-- 1 root root 508385 2008-12-19 17:57 abi-2.6.27-11-generic
-rw-r--r-- 1 root root 507665 2008-11-04 21:00 abi-2.6.27-7-generic
-rw-r--r-- 1 root root 507735 2008-11-06 19:20 abi-2.6.27-8-generic
-rw-r--r-- 1 root root 83217 2007-09-23 17:47 config-2.6.20-16-generic
-rw-r--r-- 1 root root 80062 2008-10-22 03:12 config-2.6.24-21-generic
-rw-r--r-- 1 root root 91358 2008-11-21 13:46 config-2.6.27-10-generic
-rw-r--r-- 1 root root 91358 2008-12-19 17:57 config-2.6.27-11-generic
-rw-r--r-- 1 root root 91364 2008-11-04 21:00 config-2.6.27-7-generic
-rw-r--r-- 1 root root 91364 2008-11-06 19:20 config-2.6.27-8-generic
drwxr-xr-x 3 root root 4096 2009-01-03 11:34 grub
-rw-r--r-- 1 root root 7635391 2008-06-04 10:54 initrd.img-2.6.20-16-generic
-rw-r--r-- 1 root root 6948833 2007-09-25 09:40 initrd.img-2.6.20-16-generic.bak
-rw-r--r-- 1 root root 7910888 2008-10-28 09:43 initrd.img-2.6.24-21-generic
-rw-r--r-- 1 root root 7912815 2008-10-01 11:58 initrd.img-2.6.24-21-generic.bak
-rw-r--r-- 1 root root 8202482 2008-12-01 11:01 initrd.img-2.6.27-10-generic
-rw-r--r-- 1 root root 8201905 2008-12-21 12:29 initrd.img-2.6.27-11-generic
-rw-r--r-- 1 root root 8179651 2008-11-06 11:36 initrd.img-2.6.27-7-generic
-rw-r--r-- 1 root root 8200306 2008-11-17 20:15 initrd.img-2.6.27-8-generic
-rw-r--r-- 1 root root 124152 2008-09-11 20:11 memtest86+.bin
-rw-r--r-- 1 root root 807071 2007-09-23 20:30 System.map-2.6.20-16-generic
-rw-r--r-- 1 root root 905617 2008-10-22 03:12 System.map-2.6.24-21-generic
-rw-r--r-- 1 root root 1029828 2008-11-21 13:46 System.map-2.6.27-10-generic
-rw-r--r-- 1 root root 1031799 2008-12-19 17:57 System.map-2.6.27-11-generic
-rw-r--r-- 1 root root 1029585 2008-11-04 21:00 System.map-2.6.27-7-generic
-rw-r--r-- 1 root root 1029612 2008-11-06 19:20 System.map-2.6.27-8-generic
-rw-r--r-- 1 root root 1074 2008-11-21 13:48 vmcoreinfo-2.6.27-10-generic
-rw-r--r-- 1 root root 1074 2008-12-19 17:58 vmcoreinfo-2.6.27-11-generic
-rw-r--r-- 1 root root 1073 2008-11-04 21:02 vmcoreinfo-2.6.27-7-generic
-rw-r--r-- 1 root root 1073 2008-11-06 19:22 vmcoreinfo-2.6.27-8-generic
-rw-r--r-- 1 root root 1747372 2007-09-23 20:28 vmlinuz-2.6.20-16-generic
-rw-r--r-- 1 root root 1920760 2008-10-22 03:12 vmlinuz-2.6.24-21-generic
-rw-r--r-- 1 root root 2247280 2008-11-21 13:46 vmlinuz-2.6.27-10-generic
-rw-r--r-- 1 root root 2248912 2008-12-19 17:57 vmlinuz-2.6.27-11-generic
-rw-r--r-- 1 root root 2244464 2008-11-04 21:00 vmlinuz-2.6.27-7-generic
-rw-r--r-- 1 root root 2244304 2008-11-06 19:20 vmlinuz-2.6.27-8-generic

=============================== sdc1/boot/grub: ===============================

total 920
drwxr-xr-x 3 root root 4096 2009-01-03 11:34 .
drwxr-xr-x 3 root root 4096 2008-12-21 12:29 ..
-rw-r--r-- 1 root root 2236 2009-01-03 11:34 acorn.mod
-rw-r--r-- 1 root root 4876 2009-01-03 11:34 affs.mod
-rw-r--r-- 1 root root 6808 2009-01-03 11:34 afs.mod
-rw-r--r-- 1 root root 2612 2009-01-03 11:34 amiga.mod
-rw-r--r-- 1 root root 1144 2009-01-03 11:34 aout.mod
-rw-r--r-- 1 root root 2680 2009-01-03 11:34 apple.mod
-rw-r--r-- 1 root root 4724 2009-01-03 11:34 ata.mod
-rw-r--r-- 1 root root 4300 2009-01-03 11:34 biosdisk.mod
-rw-r--r-- 1 root root 2568 2009-01-03 11:34 bitmap.mod
-rw-r--r-- 1 root root 2248 2009-01-03 11:34 blocklist.mod
-rw-r--r-- 1 root root 512 2009-01-03 11:34 boot.img
-rw-r--r-- 1 root root 1456 2009-01-03 11:34 boot.mod
-rw-r--r-- 1 root root 8756 2009-01-03 11:34 _bsd.mod
-rw-r--r-- 1 root root 2324 2009-01-03 11:34 bsd.mod
-rw-r--r-- 1 root root 2076 2009-01-03 11:34 cat.mod
-rw-r--r-- 1 root root 512 2009-01-03 11:34 cdboot.img
-rw-r--r-- 1 root root 2508 2009-01-03 11:34 _chain.mod
-rw-r--r-- 1 root root 1816 2009-01-03 11:34 chain.mod
-rw-r--r-- 1 root root 2312 2009-01-03 11:34 cmp.mod
-rw-r--r-- 1 root root 713 2009-01-03 11:34 command.lst
-rw-r--r-- 1 root root 1908 2009-01-03 11:34 configfile.mod
-rw-r--r-- 1 root root 28746 2009-01-03 11:34 core.img
-rw-r--r-- 1 root root 3208 2009-01-03 11:34 cpio.mod
-rw-r--r-- 1 root root 1588 2009-01-03 11:34 cpuid.mod
-rw-r--r-- 1 root root 197 2007-09-20 19:04 default
-rw-r--r-- 1 root root 45 2009-01-03 11:34 device.map
-rw-r--r-- 1 root root 512 2009-01-03 11:34 diskboot.img
-rw-r--r-- 1 root root 8660 2007-09-20 19:04 e2fs_stage1_5
-rw-r--r-- 1 root root 2096 2009-01-03 11:34 echo.mod
-rw-r--r-- 1 root root 4484 2009-01-03 11:34 elf.mod
-rw-r--r-- 1 root root 4352 2009-01-03 11:34 ext2.mod
-rw-r--r-- 1 root root 4972 2009-01-03 11:34 fat.mod
-rw-r--r-- 1 root root 8452 2007-09-20 19:04 fat_stage1_5
-rw-r--r-- 1 root root 2716 2009-01-03 11:34 font.mod
-rw-r--r-- 1 root root 2564 2009-01-03 11:34 fshelp.mod
-rw-r--r-- 1 root root 83 2009-01-03 11:34 fs.lst
-rw-r--r-- 1 root root 8548 2009-01-03 11:34 gfxterm.mod
-rw-r--r-- 1 root root 2896 2009-01-03 11:34 gpt.mod
-r--r--r-- 1 root root 3572 2009-01-03 11:34 grub.cfg
-rw-r--r-- 1 root root 7860 2009-01-03 11:34 gzio.mod
-rw-r--r-- 1 root root 1632 2009-01-03 11:34 halt.mod
-rw-r--r-- 1 root root 1384 2009-01-03 11:34 hello.mod
-rw-r--r-- 1 root root 2084 2009-01-03 11:34 help.mod
-rw-r--r-- 1 root root 3104 2009-01-03 11:34 hexdump.mod
-rw-r--r-- 1 root root 6348 2009-01-03 11:34 hfs.mod
-rw-r--r-- 1 root root 6432 2009-01-03 11:34 hfsplus.mod
-rw-r--r-- 1 root root 15 2007-09-20 19:04 installed-version
-rw-r--r-- 1 root root 5576 2009-01-03 11:34 iso9660.mod
-rw-r--r-- 1 root root 5208 2009-01-03 11:34 jfs.mod
-rw-r--r-- 1 root root 9152 2007-09-20 19:04 jfs_stage1_5
-rw-r--r-- 1 root root 6568 2009-01-03 11:34 jpeg.mod
-rw-r--r-- 1 root root 30924 2009-01-03 11:34 kernel.img
-rw-r--r-- 1 root root 4872 2009-01-03 11:34 _linux.mod
-rw-r--r-- 1 root root 1576 2009-01-03 11:34 linux.mod
-rw-r--r-- 1 root root 1024 2009-01-03 11:34 lnxboot.img
-rw-r--r-- 1 root root 3156 2009-01-03 11:34 loopback.mod
-rw-r--r-- 1 root root 3928 2009-01-03 11:34 ls.mod
-rw-r--r-- 1 root root 4236 2009-01-03 11:34 lspci.mod
-rw-r--r-- 1 root root 5424 2009-01-03 11:34 lvm.mod
-rw-r--r-- 1 root root 2216 2009-01-03 11:34 memdisk.mod
-rw-r--r-- 1 root root 7200 2009-01-03 11:34 menu.lst
-rw-r--r-- 1 root root 6847 2009-01-03 11:34 menu.lst~
-rw-r--r-- 1 root root 5967 2008-06-04 10:52 menu.lst.backup
-rw-r--r-- 1 root root 6847 2009-01-03 11:34 menu.lst_backup_by_grub2_postinst
-rw-r--r-- 1 root root 6460 2008-06-04 11:24 menu.lst.bak
-rw-r--r-- 1 root root 5950 2008-05-11 10:05 menu.lst_original
-rw-r--r-- 1 root root 4344 2009-01-03 11:34 minix.mod
-rw-r--r-- 1 root root 7860 2007-09-20 19:04 minix_stage1_5
-rw-r--r-- 1 root root 990 2009-01-03 11:34 moddep.lst
-rw-r--r-- 1 root root 11924 2009-01-03 11:34 _multiboot.mod
-rw-r--r-- 1 root root 1660 2009-01-03 11:34 multiboot.mod
-rw-r--r-- 1 root root 41436 2009-01-03 11:34 normal.mod
-rw-r--r-- 1 root root 3400 2009-01-03 11:34 ntfscomp.mod
-rw-r--r-- 1 root root 8600 2009-01-03 11:34 ntfs.mod
-rw-r--r-- 1 root root 29 2009-01-03 11:34 partmap.lst
-rw-r--r-- 1 root root 936 2009-01-03 11:34 pci.mod
-rw-r--r-- 1 root root 3328 2009-01-03 11:34 pc.mod
-rw-r--r-- 1 root root 2292 2009-01-03 11:34 play.mod
-rw-r--r-- 1 root root 6576 2009-01-03 11:34 png.mod
-rw-r--r-- 1 root root 1024 2009-01-03 11:34 pxeboot.img
-rw-r--r-- 1 root root 5192 2009-01-03 11:34 raid.mod
-rw-r--r-- 1 root root 1784 2009-01-03 11:34 read.mod
-rw-r--r-- 1 root root 1372 2009-01-03 11:34 reboot.mod
-rw-r--r-- 1 root root 9760 2009-01-03 11:34 reiserfs.mod
-rw-r--r-- 1 root root 10132 2007-09-20 19:04 reiserfs_stage1_5
-rw-r--r-- 1 root root 3272 2009-01-03 11:34 search.mod
-rw-r--r-- 1 root root 5588 2009-01-03 11:34 serial.mod
-rw-r--r-- 1 root root 4484 2009-01-03 11:34 sfs.mod
-rw-r--r-- 1 root root 2300 2009-01-03 11:34 sleep.mod
drwxr-xr-x 2 root root 4096 2008-06-04 10:52 splashimages
-rw-r--r-- 1 root root 38321 2008-05-08 11:35 splash.xpm.gz
-rw-r--r-- 1 root root 512 2007-09-20 19:04 stage1
-rw-r--r-- 1 root root 110132 2007-09-20 19:04 stage2
-rw-r--r-- 1 root root 2632 2009-01-03 11:34 sun.mod
-rw-r--r-- 1 root root 1980 2009-01-03 11:34 terminal.mod
-rw-r--r-- 1 root root 10040 2009-01-03 11:34 terminfo.mod
-rw-r--r-- 1 root root 1664 2009-01-03 11:34 test.mod
-rw-r--r-- 1 root root 2960 2009-01-03 11:34 tga.mod
-rw-r--r-- 1 root root 5028 2009-01-03 11:34 udf.mod
-rw-r--r-- 1 root root 5128 2009-01-03 11:34 ufs.mod
-rw-r--r-- 1 root root 2292 2009-01-03 11:34 vbeinfo.mod
-rw-r--r-- 1 root root 14084 2009-01-03 11:34 vbe.mod
-rw-r--r-- 1 root root 3172 2009-01-03 11:34 vbetest.mod
-rw-r--r-- 1 root root 3944 2009-01-03 11:34 vga.mod
-rw-r--r-- 1 root root 4084 2009-01-03 11:34 video.mod
-rw-r--r-- 1 root root 2884 2009-01-03 11:34 videotest.mod
-rw-r--r-- 1 root root 12379 2008-11-02 11:25 wyvern-luke-tuxwalker-1944.xpm.gz
-rw-r--r-- 1 root root 6624 2009-01-03 11:34 xfs.mod
-rw-r--r-- 1 root root 9980 2007-09-20 19:04 xfs_stage1_5

=============================== StdErr Messages: ===============================

cat: /tmp/BootInfo/Unknown_MBR: No such file or directory

unutbu
January 3rd, 2009, 01:29 PM
Boot the LiveCD. Open a terminal. Type

sudo mount /dev/sdc1 /mnt
sudo cp /mnt/boot/grub/menu.lst /mnt/boot/grub/menu.lst_20080103 # Saves a backup
gksu gedit /mnt/boot/grub/menu.lst

Do a Find/Replace: change every occurrence of


root (hd0,0)

to


uuid 756b6798-621b-4d0c-a622-d079cd159cf0

(Using uuids references partitions in a way which is immune to BIOS renumbering of hard drive numbers.)

At the end of menu.lst, add these stanzas:


title Microsoft Windows XP Home Edition (hd0,0)
root (hd0,0)
savedefault
makeactive
chainloader +1

title Microsoft Windows XP Home Edition
root (hd0,1)
savedefault
makeactive
map (hd0) (hd1)
map (hd1) (hd0)
chainloader +1


title Microsoft Windows XP Home Edition (hd2,0)
root (hd2,0)
savedefault
makeactive
map (hd0) (hd2)
map (hd2) (hd0)
chainloader +1

One of these should allow you to boot Windows.

von Stalhein
January 3rd, 2009, 11:46 PM
Thanks unutbu - I did as you showed.

I now get Error 13 for the first XP option and error 12 for the other 2.

I'm wondering if the MBR on the XP disk is borked - maybe I need to do a fixmbr?

The current Grub file is as follows ( I must prune some of those old kernels!!!): -



# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not change this entry to 'saved' or your
# array will desync and will not let you boot your system.
default 0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 15

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu

# Pretty colours
#color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
## password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title Windows 95/98/NT/2000
# uuid 756b6798-621b-4d0c-a622-d079cd159cf0
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=756b6798-621b-4d0c-a622-d079cd159cf0 ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,0)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash vga=771

## should update-grub lock old automagic boot options
## e.g. lockold=false
## lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(single-user) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

## ## End Default Options ##

splashimage=(hd0,0)/boot/grub/splash.xpm.gz

title Chainload into GRUB 2
uuid 756b6798-621b-4d0c-a622-d079cd159cf0
kernel /boot/grub/core.img

title ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
root

title When you have verified GRUB 2 works, you can use this command to
root

title complete the upgrade: upgrade-from-grub-legacy
root

title ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
root

title Debian GNU/Linux, kernel 2.6.27-11-generic
uuid 756b6798-621b-4d0c-a622-d079cd159cf0
kernel /boot/vmlinuz-2.6.27-11-generic root=UUID=756b6798-621b-4d0c-a622-d079cd159cf0 ro quiet splash vga=771
initrd /boot/initrd.img-2.6.27-11-generic

title Debian GNU/Linux, kernel 2.6.27-11-generic (recovery mode)
uuid 756b6798-621b-4d0c-a622-d079cd159cf0
kernel /boot/vmlinuz-2.6.27-11-generic root=UUID=756b6798-621b-4d0c-a622-d079cd159cf0 ro single
initrd /boot/initrd.img-2.6.27-11-generic

title Debian GNU/Linux, kernel 2.6.27-10-generic
uuid 756b6798-621b-4d0c-a622-d079cd159cf0
kernel /boot/vmlinuz-2.6.27-10-generic root=UUID=756b6798-621b-4d0c-a622-d079cd159cf0 ro quiet splash vga=771
initrd /boot/initrd.img-2.6.27-10-generic

title Debian GNU/Linux, kernel 2.6.27-10-generic (recovery mode)
uuid 756b6798-621b-4d0c-a622-d079cd159cf0
kernel /boot/vmlinuz-2.6.27-10-generic root=UUID=756b6798-621b-4d0c-a622-d079cd159cf0 ro single
initrd /boot/initrd.img-2.6.27-10-generic

title Debian GNU/Linux, kernel 2.6.27-8-generic
uuid 756b6798-621b-4d0c-a622-d079cd159cf0
kernel /boot/vmlinuz-2.6.27-8-generic root=UUID=756b6798-621b-4d0c-a622-d079cd159cf0 ro quiet splash vga=771
initrd /boot/initrd.img-2.6.27-8-generic

title Debian GNU/Linux, kernel 2.6.27-8-generic (recovery mode)
uuid 756b6798-621b-4d0c-a622-d079cd159cf0
kernel /boot/vmlinuz-2.6.27-8-generic root=UUID=756b6798-621b-4d0c-a622-d079cd159cf0 ro single
initrd /boot/initrd.img-2.6.27-8-generic

title Debian GNU/Linux, kernel 2.6.27-7-generic
uuid 756b6798-621b-4d0c-a622-d079cd159cf0
kernel /boot/vmlinuz-2.6.27-7-generic root=UUID=756b6798-621b-4d0c-a622-d079cd159cf0 ro quiet splash vga=771
initrd /boot/initrd.img-2.6.27-7-generic

title Debian GNU/Linux, kernel 2.6.27-7-generic (recovery mode)
uuid 756b6798-621b-4d0c-a622-d079cd159cf0
kernel /boot/vmlinuz-2.6.27-7-generic root=UUID=756b6798-621b-4d0c-a622-d079cd159cf0 ro single
initrd /boot/initrd.img-2.6.27-7-generic

title Debian GNU/Linux, kernel 2.6.24-21-generic
uuid 756b6798-621b-4d0c-a622-d079cd159cf0
kernel /boot/vmlinuz-2.6.24-21-generic root=UUID=756b6798-621b-4d0c-a622-d079cd159cf0 ro quiet splash vga=771
initrd /boot/initrd.img-2.6.24-21-generic

title Debian GNU/Linux, kernel 2.6.24-21-generic (recovery mode)
uuid 756b6798-621b-4d0c-a622-d079cd159cf0
kernel /boot/vmlinuz-2.6.24-21-generic root=UUID=756b6798-621b-4d0c-a622-d079cd159cf0 ro single
initrd /boot/initrd.img-2.6.24-21-generic

title Debian GNU/Linux, kernel 2.6.20-16-generic
uuid 756b6798-621b-4d0c-a622-d079cd159cf0
kernel /boot/vmlinuz-2.6.20-16-generic root=UUID=756b6798-621b-4d0c-a622-d079cd159cf0 ro quiet splash vga=771
initrd /boot/initrd.img-2.6.20-16-generic

title Debian GNU/Linux, kernel 2.6.20-16-generic (recovery mode)
uuid 756b6798-621b-4d0c-a622-d079cd159cf0
kernel /boot/vmlinuz-2.6.20-16-generic root=UUID=756b6798-621b-4d0c-a622-d079cd159cf0 ro single
initrd /boot/initrd.img-2.6.20-16-generic

title Debian GNU/Linux, kernel memtest86+
uuid 756b6798-621b-4d0c-a622-d079cd159cf0
kernel /boot/memtest86+.bin

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title Systems for teh n00bs!!!:
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sdb1

title Microsoft Windows XP Home Edition (hd0,0)
root (hd0,0)
savedefault
makeactive
chainloader +1

title Microsoft Windows XP Home Edition
root (hd0,1)
savedefault
makeactive
map (hd0) (hd1)
map (hd1) (hd0)
chainloader +1


title Microsoft Windows XP Home Edition (hd2,0)
root (hd2,0)
savedefault
makeactive
map (hd0) (hd2)
map (hd2) (hd0)
chainloader +1

meierfra.
January 4th, 2009, 02:19 AM
According to the error message your current boot order must be

sdc (the Ubuntu drive)
sda (the Windows drive)
sdb


(hd0,0) is the Ubuntu partition. No boot loader is installed in the boot sector of the Ubuntu partition, so your first entry gives Error 13.

(hd0,1) and (hd2,0) both are extended partition. Grub cannot apply "makeactive" to an extended partition and your other two entries give Error 12.


So windows xp should be on "(hd1,0)". Try

title Microsoft Windows XP Home Edition
rootnoverify (hd1,0)
map (hd0) (hd1)
map (hd1) (hd0)
chainloader +1


If this does not work, report any error messages you got. Could you also delete boot_info_script.txt and then download and run it again (the script was updated this afternoon)?

Are you able to access the Windows partition from Ubuntu?

unutbu
January 4th, 2009, 02:24 AM
Error 13 means that the boot sector (MBR) on sda is corrupt. (See http://users.bigpond.net.au/hermanzone/p15.htm#13)

Do you have a Windows install CD? If so, boot it, select "Recovery Console", and
type


fixboot
chkdsk /r

Re-run the chkdisk command until it reports no errors.

If you don't have a Windows install CD, you can download a Windows Repair CD: http://www.webtree.ca/windowsxp/tools/bootdiscs/xp_rec_con.zip

Once that is done, reboot and select the XP option which produced the Error 13 before.
See if you can boot Windows.

By the way, can you boot Ubuntu now?

von Stalhein
January 4th, 2009, 02:34 AM
Thanks again - yes, I can boot into Ibex without any issues from the GRUB menu.

I have the XP disk, I'll go the mbr fix and report back.

von Stalhein
January 4th, 2009, 06:00 AM
I used to be able to boot into Ibex from GRUB :D

I tried the fixboot and chkdsk, but the recovery console (unbeknownst to me) was acting on my other windows disk - ie the one without the OS on it - n00b!!

Anyway, I changed it's physical connection to make sure that the XP CD disk booted c:\ and tried again. From there I kept getting Error 17 from the GRUB menu.

I did a fixmbr, and now I have XP back, but no GRUB menu.

I presume I can access my Ubuntu disk from a live cd boot, and then I'll follow the steps in the first post in this thread?

Later I booted to the livecd but get the "Error 15: File not found message". And I can't (or haven't worked out) how to boot the Ibex disk from within the livecd.

I found my SuperGrub CD, and tried various items on it without luck as well.

Thanks for your patience - what's the next step?

unutbu
January 4th, 2009, 03:59 PM
von Stalhein, I now see I have made errors in my advice to you.
In post #658, I typed


root (hd0,1)

when I meant


root (hd1,0)

I also missed the fact that you were able to boot both XP and Ibex depending on your boot order. That shows there was nothing corrupt with your MBRs. The problem should have been fixable by editing /boot/grub/menu.lst.

meierfra, the author of the awesome boot_info_script.txt was right, and somehow I missed his post #660. Apologies to both you and meierfra.

How about we try to turn things around by

Booting the LiveCD,

sudo mount /dev/sdc1 /mnt
gksu gedit /mnt/boot/grub/menu.lst

Edit the Windows boot stanzas at the end of the file to include


title Microsoft Windows XP Home Edition
rootnoverify (hd1,0)
map (hd0) (hd1)
map (hd1) (hd0)
chainloader +1

Save and exit gedit.

Then use Catlett's method (http://ubuntuforums.org/showpost.php?p=1308395&postcount=1) to reinstall GRUB.

If this does not work, boot the LiveCD and run this:


cd ~/Desktop && wget 'http://home.comcast.net/~ubuntu_grub/boot_info_script.txt' && sudo bash boot_info_script.txt

and post the RESULTS.txt again.

meierfra.
January 4th, 2009, 05:55 PM
I agree with unutbu's advice, but since you changed the physical connection I would like to suggest an extra step. Try this

1) Undo the changes to the physical connection.

Also make sure that your bios are set to boot from the Ubuntu drive. After this you might already be able to boot into Ubuntu again but I'm not sure since I don't know which hard drive was effected by "fixmbr".

If you are not able boot into Ubuntu, reinstall Grub from the LiveCD via


sudo grub

and at the grub prompt


find /boot/grub/stage2
This should return something of the form (hdX,0) (probably (hd2,0).)

Then still at the grub prompt


root (hdX,0)
setup (hdX)
quit

You should now be able to boot into Ubuntu again


2) Edit menu.lst (if you can't boot into Ubuntu, use the method suggested by unutbu) Since I'm not sure whether your boot order will be exactly the same as at the time of my post #660, use

title Microsoft Windows XP Home Edition (hd0)
rootnoverify (hd0,0)
chainloader +1


title Microsoft Windows XP Home Edition (hd1)
rootnoverify (hd1,0)
map (hd0) (hd1)
map (hd1) (hd0)
chainloader +1

title Microsoft Windows XP Home Edition (hd2)
rootnoverify (hd2,0)
map (hd0) (hd2)
map (hd2) (hd0)
chainloader +1


Reboot and try each entry. If none of the entries worked, report all the error messages you got and also run the script again and post the content of "RESULTS.txt"

von Stalhein
January 4th, 2009, 09:01 PM
Thanks very much guys - I have to go back to work today :-( so I will have a crack at your advice later today my time.

von Stalhein
January 5th, 2009, 09:11 AM
I'm back :)
I changed the drives around to where they were (I think!)
The Ibex disk, which shows up in the BIOS as a SCSI drive is set to boot first, but it just goes to the "Error 17" message.

According to my GigaByte mobo manual:
At the moment, the 160G HDD with Ibex is on SATA0_SII
The 120G HDD with the XP OS is on SATA0_SB
The 120G HDD with the XP files is on SATA1_SB
The SATA DVD is on SATA1_SII

The GRUB commands return "Error 15: File not found"


I paste in the RESULTS.TXT

============================= Boot Info Summary: ==============================

=> Grub is installed in the MBR of /dev/sda and looks on the same drive in
partition #1 for its boot files.
=> Windows is installed in the MBR of /dev/sdb
=> Windows is installed in the MBR of /dev/sdc

sda1: __________________________________________________ _______________________

File system:
Boot sector type: Windows XP
Boot sector info:
Mounting failed:
mount: you must specify the filesystem type

sda2: __________________________________________________ _______________________

File system: Extended Partition

sda5: __________________________________________________ _______________________

File system: swap

sdb1: __________________________________________________ _______________________

File system: Extended Partition

sdb5: __________________________________________________ _______________________

File system: ntfs
Boot sector type: Windows XP
Boot sector info:
Operating System:
Boot files/dirs:

sdc1: __________________________________________________ _______________________

File system: ntfs
Boot sector type: Windows XP
Boot sector info: No errors found in the Boot Parameter Block.
Mounting failed:
$LogFile indicates unclean shutdown (0, 0)
Failed to mount '/dev/sdc1': Operation not supported
Mount is denied because NTFS is marked to be in use. Choose one action:

Choice 1: If you have Windows then disconnect the external devices by
clicking on the 'Safely Remove Hardware' icon in the Windows
taskbar then shutdown Windows cleanly.

Choice 2: If you don't have Windows then you can use the 'force' option for
your own responsibility. For example type on the command line:

mount -t ntfs-3g /dev/sdc1 sdc1 -o force

Or add the option to the relevant row in the /etc/fstab file:

/dev/sdc1 sdc1 ntfs-3g force 0 0

=========================== Drive/Partition Info: =============================

Drive sda: __________________________________________________ ___________________

fdisk -lu /dev/sda:

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xf66fc667

Device Boot Start End Blocks Id System
/dev/sda1 * 63 300415499 150207718+ 83 Linux
/dev/sda2 300415500 312576704 6080602+ f W95 Ext'd (LBA)
/dev/sda5 300415563 312576704 6080571 82 Linux swap / Solaris

sfdisk -V /dev/sda:

/dev/sda: OK

Drive sdb: __________________________________________________ ___________________

fdisk -lu /dev/sdb:

Disk /dev/sdb: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xa3f79c20

Device Boot Start End Blocks Id System
/dev/sdb1 16065 234436544 117210240 f W95 Ext'd (LBA)
/dev/sdb5 16128 234436544 117210208+ 7 HPFS/NTFS

sfdisk -V /dev/sdb:

Warning: no primary partition is marked bootable (active)
This does not matter for LILO, but the DOS MBR will not boot this disk.
/dev/sdb: OK

Drive sdc: __________________________________________________ ___________________

fdisk -lu /dev/sdc:

Disk /dev/sdc: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x960c960c

Device Boot Start End Blocks Id System
/dev/sdc1 * 63 234436544 117218241 7 HPFS/NTFS

sfdisk -V /dev/sdc:

/dev/sdc: OK

blkid -c /dev/null: __________________________________________________ __________

/dev/sda5: TYPE="swap" UUID="4e2664d2-a70a-469b-9242-1adb97db8229"
/dev/sdb5: UUID="A83CB1173CB0E18C" LABEL="Disk 2" TYPE="ntfs"
/dev/sdc1: UUID="01C3D871F965AC80" LABEL="DSK1_VOL1" TYPE="ntfs"
/dev/loop0: TYPE="squashfs"

=============================== "mount" output: ===============================

/proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
tmpfs on /lib/modules/2.6.27-7-generic/volatile type tmpfs (rw,mode=0755)
tmpfs on /lib/modules/2.6.27-7-generic/volatile type tmpfs (rw,mode=0755)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
varrun on /var/run type tmpfs (rw,nosuid,mode=0755)
varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
rootfs on / type rootfs (rw)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
/dev/scd1 on /cdrom type iso9660 (ro,noatime)
/dev/loop0 on /rofs type squashfs (ro,noatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
gvfs-fuse-daemon on /home/ubuntu/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=ubuntu)

=============================== StdErr Messages: ===============================

/dev/sda1: unknown volume type

meierfra.
January 5th, 2009, 06:41 PM
dev/sda1 * 63 300415499 150207718+ 83 Linux

sda1: __________________________________________________ _______________________

File system:
Boot sector type: Windows XP
Boot sector info:
Mounting failed:
mount: you must specify the filesystem type




It looks like you applied "fixboot" to your Ubuntu partition. You should be able to fix this with a file system check:



sudo e2fsck -fy /dev/sda1
(here /dev/sda1 needs to be your Ibex partitions. It should be /dev/sda1, but just to make sure, run "sudo fdisk -lu".)

If e2fsck fails to run:

Go to "System>Administration->Software Sorces" and enable all the repositories in the "ubuntu software" tab.



sudo apt-get install testdisk

sudo testdisk


Select the Ibex drive

Choose "proceed", "intel" and "advanced"

Select your Ibex partition and then "Superblock"

This should list all superblocks:

superblock 0, blocksize=4096
superblock 32768, blocksize=4096
superblock 98304, blocksize=4096
superblock 163840, blocksize=4096
superblock 229376, blocksize=4096
superblock 294912, blocksize=4096
superblock 819200, blocksize=4096
superblock 884736, blocksize=4096
superblock 1605632, blocksize=4096


Use these numbers with "e2fsck":





sudo e2fsck -b 32768 -fy /dev/sdb1

If that fails:




sudo e2fsck -b 98304 -fy /dev/sdb1


repeat until you find a superblock which works.

von Stalhein
January 6th, 2009, 10:25 AM
Sorry meierfra I'm as smart as an indoor plant!!

I had it all back (!) from your suggestions above, and then I told the GRUB to update as per the comment in the GRUB 2 file, and lost it again :(

I've been trying to get it back for the last couple of hours, but I don't want to fiddle about to much in case I make it worse.

It now boots into a GRUB 1.96, but every Linux choice gives an error message that I need to load the kernel first, and the Windows one just goes to a prompt and sits there.

I tried to find a way to load the original GRUB menu over this one, but I'm stumped again. I can "see" the Ubuntu disk in the file manager and I can sudo into the menu.lst to make changes, but after that I'm stumped.

I presume the 1.96 version has overwritten the original?

The fdisk result follows: -


Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xf66fc667

Device Boot Start End Blocks Id System
/dev/sda1 * 63 300415499 150207718+ 83 Linux
/dev/sda2 300415500 312576704 6080602+ f W95 Ext'd (LBA)
/dev/sda5 300415563 312576704 6080571 82 Linux swap / Solaris

Disk /dev/sdb: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xa3f79c20

Device Boot Start End Blocks Id System
/dev/sdb1 16065 234436544 117210240 f W95 Ext'd (LBA)
/dev/sdb5 16128 234436544 117210208+ 7 HPFS/NTFS

Disk /dev/sdc: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x960c960c

Device Boot Start End Blocks Id System
/dev/sdc1 * 63 234436544 117218241 7 HPFS/NTFS


Is that enough info? TIA (again)

meierfra.
January 6th, 2009, 10:46 AM
I don't have any experience with Grub 2, so I have no idea what happened. But it does sound like Grub was replaced by Grub2.


So I suggest to reinstall Grub according to the instruction from post 665.
(If your menu.lst is messed up you can replace it by the one in post 659 and
then follow the instruction from post 665 to edit it)

If this does not solve your problem, delete "boot_info_script.txt" and "RESULTS.txt", run the command to download and execute the script, and post the new "RESULTS.txt"

meierfra.
January 6th, 2009, 11:01 AM
I just want to let you know that I edited my post a few times. But I'm done editing now.

von Stalhein
January 6th, 2009, 11:03 AM
I can't get it to find the menu.lst
I suppose I've borked the MBR again.


============================= Boot Info Summary: ==============================

=> No known boot loader is installed in the MBR of /dev/sda
=> Windows is installed in the MBR of /dev/sdb
=> Windows is installed in the MBR of /dev/sdc

sda1: __________________________________________________ _______________________

File system: ext3
Boot sector type: Windows XP
Boot sector info:
Operating System: Ubuntu 8.10
Boot files/dirs: /boot/grub/menu.lst /etc/fstab /boot /boot/grub

sda2: __________________________________________________ _______________________

File system: Extended Partition

sda5: __________________________________________________ _______________________

File system: swap

sdb1: __________________________________________________ _______________________

File system: Extended Partition

sdb5: __________________________________________________ _______________________

File system: ntfs
Boot sector type: Windows XP
Boot sector info:
Operating System:
Boot files/dirs:

sdc1: __________________________________________________ _______________________

File system: ntfs
Boot sector type: Windows XP
Boot sector info: No errors found in the Boot Parameter Block.
Operating System: Windows XP
Boot files/dirs: /boot.ini /ntldr /NTDETECT.COM

=========================== Drive/Partition Info: =============================

Drive sda: __________________________________________________ ___________________

fdisk -lu /dev/sda:

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xf66fc667

Device Boot Start End Blocks Id System
/dev/sda1 * 63 300415499 150207718+ 83 Linux
/dev/sda2 300415500 312576704 6080602+ f W95 Ext'd (LBA)
/dev/sda5 300415563 312576704 6080571 82 Linux swap / Solaris

sfdisk -V /dev/sda:

/dev/sda: OK

Drive sdb: __________________________________________________ ___________________

fdisk -lu /dev/sdb:

Disk /dev/sdb: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xa3f79c20

Device Boot Start End Blocks Id System
/dev/sdb1 16065 234436544 117210240 f W95 Ext'd (LBA)
/dev/sdb5 16128 234436544 117210208+ 7 HPFS/NTFS

sfdisk -V /dev/sdb:

Warning: no primary partition is marked bootable (active)
This does not matter for LILO, but the DOS MBR will not boot this disk.
/dev/sdb: OK

Drive sdc: __________________________________________________ ___________________

fdisk -lu /dev/sdc:

Disk /dev/sdc: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x960c960c

Device Boot Start End Blocks Id System
/dev/sdc1 * 63 234436544 117218241 7 HPFS/NTFS

sfdisk -V /dev/sdc:

/dev/sdc: OK

blkid -c /dev/null: __________________________________________________ __________

/dev/sda1: UUID="756b6798-621b-4d0c-a622-d079cd159cf0" TYPE="ext3"
/dev/sda5: TYPE="swap" UUID="4e2664d2-a70a-469b-9242-1adb97db8229"
/dev/sdb5: UUID="A83CB1173CB0E18C" LABEL="Disk 2" TYPE="ntfs"
/dev/sdc1: UUID="01C3D871F965AC80" LABEL="DSK1_VOL1" TYPE="ntfs"
/dev/loop0: TYPE="squashfs"

=============================== "mount" output: ===============================

/proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
tmpfs on /lib/modules/2.6.27-7-generic/volatile type tmpfs (rw,mode=0755)
tmpfs on /lib/modules/2.6.27-7-generic/volatile type tmpfs (rw,mode=0755)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
varrun on /var/run type tmpfs (rw,nosuid,mode=0755)
varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
rootfs on / type rootfs (rw)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
/dev/scd1 on /cdrom type iso9660 (ro,noatime)
/dev/loop0 on /rofs type squashfs (ro,noatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
gvfs-fuse-daemon on /home/ubuntu/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=ubuntu)
/dev/sda1 on /media/disk type ext3 (rw,nosuid,nodev,uhelper=hal)
/dev/sda1 on /mnt type ext3 (rw)

=========================== sda1/boot/grub/menu.lst: ===========================


# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not change this entry to 'saved' or your
# array will desync and will not let you boot your system.
default 10

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 20

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu

# Pretty colours
#color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
## password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title Windows 95/98/NT/2000
# uuid 756b6798-621b-4d0c-a622-d079cd159cf0
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=756b6798-621b-4d0c-a622-d079cd159cf0 ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,0)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash vga=771

## should update-grub lock old automagic boot options
## e.g. lockold=false
## lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(single-user) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

## ## End Default Options ##

splashimage=(hd0,0)/boot/grub/splash.xpm.gz

title Chainload into GRUB 2
uuid 756b6798-621b-4d0c-a622-d079cd159cf0
kernel /boot/grub/core.img

title ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
root

title When you have verified GRUB 2 works, you can use this command to
root

title complete the upgrade: upgrade-from-grub-legacy
root

title ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
root

title Debian GNU/Linux, kernel 2.6.27-11-generic
uuid 756b6798-621b-4d0c-a622-d079cd159cf0
kernel /boot/vmlinuz-2.6.27-11-generic root=UUID=756b6798-621b-4d0c-a622-d079cd159cf0 ro quiet splash vga=771
initrd /boot/initrd.img-2.6.27-11-generic

title Debian GNU/Linux, kernel 2.6.27-11-generic (recovery mode)
uuid 756b6798-621b-4d0c-a622-d079cd159cf0
kernel /boot/vmlinuz-2.6.27-11-generic root=UUID=756b6798-621b-4d0c-a622-d079cd159cf0 ro single
initrd /boot/initrd.img-2.6.27-11-generic

title Debian GNU/Linux, kernel 2.6.27-10-generic
uuid 756b6798-621b-4d0c-a622-d079cd159cf0
kernel /boot/vmlinuz-2.6.27-10-generic root=UUID=756b6798-621b-4d0c-a622-d079cd159cf0 ro quiet splash vga=771
initrd /boot/initrd.img-2.6.27-10-generic

title Debian GNU/Linux, kernel 2.6.27-10-generic (recovery mode)
uuid 756b6798-621b-4d0c-a622-d079cd159cf0
kernel /boot/vmlinuz-2.6.27-10-generic root=UUID=756b6798-621b-4d0c-a622-d079cd159cf0 ro single
initrd /boot/initrd.img-2.6.27-10-generic

title Debian GNU/Linux, kernel 2.6.27-8-generic
uuid 756b6798-621b-4d0c-a622-d079cd159cf0
kernel /boot/vmlinuz-2.6.27-8-generic root=UUID=756b6798-621b-4d0c-a622-d079cd159cf0 ro quiet splash vga=771
initrd /boot/initrd.img-2.6.27-8-generic

title Debian GNU/Linux, kernel 2.6.27-8-generic (recovery mode)
uuid 756b6798-621b-4d0c-a622-d079cd159cf0
kernel /boot/vmlinuz-2.6.27-8-generic root=UUID=756b6798-621b-4d0c-a622-d079cd159cf0 ro single
initrd /boot/initrd.img-2.6.27-8-generic

title Debian GNU/Linux, kernel memtest86+
uuid 756b6798-621b-4d0c-a622-d079cd159cf0
kernel /boot/memtest86+.bin

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title Systems for teh n00bs!!!:-
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sdb1

title Microsoft Windows XP Home Edition
root (hd2,0)
savedefault
makeactive
map (hd0) (hd2)
map (hd2) (hd0)
chainloader +1


=============================== sda1/etc/fstab: ===============================

# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/sda1
UUID=756b6798-621b-4d0c-a622-d079cd159cf0 / ext3 defaults,errors=remount-ro,relatime 0 1
# /dev/sda5
UUID=059e0975-883a-4693-9bf3-6bec10b11ea6 none swap sw 0 0
/dev/cdrom /media/cdrom0 udf,iso9660 user,noauto 0 0
/dev/scd1 /media/cdrom1 udf,iso9660 user,noauto 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto 0 0

================================== sda1/boot: ==================================

total 83500
drwxr-xr-x 3 root root 4096 2009-01-03 19:51 .
drwxrwxrwx 23 root root 4096 2008-12-21 12:28 ..
-rw-r--r-- 1 root root 414274 2007-09-23 20:28 abi-2.6.20-16-generic
-rw-r--r-- 1 root root 422838 2008-10-22 03:12 abi-2.6.24-21-generic
-rw-r--r-- 1 root root 507990 2008-11-21 13:46 abi-2.6.27-10-generic
-rw-r--r-- 1 root root 508385 2008-12-19 17:57 abi-2.6.27-11-generic
-rw-r--r-- 1 root root 507665 2008-11-04 21:00 abi-2.6.27-7-generic
-rw-r--r-- 1 root root 507735 2008-11-06 19:20 abi-2.6.27-8-generic
-rw-r--r-- 1 root root 83217 2007-09-23 17:47 config-2.6.20-16-generic
-rw-r--r-- 1 root root 80062 2008-10-22 03:12 config-2.6.24-21-generic
-rw-r--r-- 1 root root 91358 2008-11-21 13:46 config-2.6.27-10-generic
-rw-r--r-- 1 root root 91358 2008-12-19 17:57 config-2.6.27-11-generic
-rw-r--r-- 1 root root 91364 2008-11-04 21:00 config-2.6.27-7-generic
-rw-r--r-- 1 root root 91364 2008-11-06 19:20 config-2.6.27-8-generic
drwxr-xr-x 3 root root 4096 2009-01-06 08:26 grub
-rw-r--r-- 1 root root 7635391 2008-06-04 10:54 initrd.img-2.6.20-16-generic
-rw-r--r-- 1 root root 6948833 2007-09-25 09:40 initrd.img-2.6.20-16-generic.bak
-rw-r--r-- 1 root root 7910888 2008-10-28 09:43 initrd.img-2.6.24-21-generic
-rw-r--r-- 1 root root 7912815 2008-10-01 11:58 initrd.img-2.6.24-21-generic.bak
-rw-r--r-- 1 root root 8202482 2008-12-01 11:01 initrd.img-2.6.27-10-generic
-rw-r--r-- 1 root root 8203809 2009-01-03 19:51 initrd.img-2.6.27-11-generic
-rw-r--r-- 1 root root 8179651 2008-11-06 11:36 initrd.img-2.6.27-7-generic
-rw-r--r-- 1 root root 8200306 2008-11-17 20:15 initrd.img-2.6.27-8-generic
-rw-r--r-- 1 root root 124152 2008-09-11 20:11 memtest86+.bin
-rw-r--r-- 1 root root 807071 2007-09-23 20:30 System.map-2.6.20-16-generic
-rw-r--r-- 1 root root 905617 2008-10-22 03:12 System.map-2.6.24-21-generic
-rw-r--r-- 1 root root 1029828 2008-11-21 13:46 System.map-2.6.27-10-generic
-rw-r--r-- 1 root root 1031799 2008-12-19 17:57 System.map-2.6.27-11-generic
-rw-r--r-- 1 root root 1029585 2008-11-04 21:00 System.map-2.6.27-7-generic
-rw-r--r-- 1 root root 1029612 2008-11-06 19:20 System.map-2.6.27-8-generic
-rw-r--r-- 1 root root 1074 2008-11-21 13:48 vmcoreinfo-2.6.27-10-generic
-rw-r--r-- 1 root root 1074 2008-12-19 17:58 vmcoreinfo-2.6.27-11-generic
-rw-r--r-- 1 root root 1073 2008-11-04 21:02 vmcoreinfo-2.6.27-7-generic
-rw-r--r-- 1 root root 1073 2008-11-06 19:22 vmcoreinfo-2.6.27-8-generic
-rw-r--r-- 1 root root 1747372 2007-09-23 20:28 vmlinuz-2.6.20-16-generic
-rw-r--r-- 1 root root 1920760 2008-10-22 03:12 vmlinuz-2.6.24-21-generic
-rw-r--r-- 1 root root 2247280 2008-11-21 13:46 vmlinuz-2.6.27-10-generic
-rw-r--r-- 1 root root 2248912 2008-12-19 17:57 vmlinuz-2.6.27-11-generic
-rw-r--r-- 1 root root 2244464 2008-11-04 21:00 vmlinuz-2.6.27-7-generic
-rw-r--r-- 1 root root 2244304 2008-11-06 19:20 vmlinuz-2.6.27-8-generic

=============================== sda1/boot/grub: ===============================

total 744
drwxr-xr-x 3 root root 4096 2009-01-06 08:26 .
drwxr-xr-x 3 root root 4096 2009-01-03 19:51 ..
-rw-r--r-- 1 root root 2236 2009-01-06 08:26 acorn.mod
-rw-r--r-- 1 root root 4876 2009-01-06 08:26 affs.mod
-rw-r--r-- 1 root root 6808 2009-01-06 08:26 afs.mod
-rw-r--r-- 1 root root 2612 2009-01-06 08:26 amiga.mod
-rw-r--r-- 1 root root 1144 2009-01-06 08:26 aout.mod
-rw-r--r-- 1 root root 2680 2009-01-06 08:26 apple.mod
-rw-r--r-- 1 root root 4724 2009-01-06 08:26 ata.mod
-rw-r--r-- 1 root root 4300 2009-01-06 08:26 biosdisk.mod
-rw-r--r-- 1 root root 2568 2009-01-06 08:26 bitmap.mod
-rw-r--r-- 1 root root 2248 2009-01-06 08:26 blocklist.mod
-rw-r--r-- 1 root root 512 2009-01-06 08:26 boot.img
-rw-r--r-- 1 root root 1456 2009-01-06 08:26 boot.mod
-rw-r--r-- 1 root root 8756 2009-01-06 08:26 _bsd.mod
-rw-r--r-- 1 root root 2324 2009-01-06 08:26 bsd.mod
-rw-r--r-- 1 root root 2076 2009-01-06 08:26 cat.mod
-rw-r--r-- 1 root root 512 2009-01-06 08:26 cdboot.img
-rw-r--r-- 1 root root 2508 2009-01-06 08:26 _chain.mod
-rw-r--r-- 1 root root 1816 2009-01-06 08:26 chain.mod
-rw-r--r-- 1 root root 2312 2009-01-06 08:26 cmp.mod
-rw-r--r-- 1 root root 713 2009-01-06 08:26 command.lst
-rw-r--r-- 1 root root 1908 2009-01-06 08:26 configfile.mod
-rw-r--r-- 1 root root 28746 2009-01-06 08:26 core.img
-rw-r--r-- 1 root root 3208 2009-01-06 08:26 cpio.mod
-rw-r--r-- 1 root root 1588 2009-01-06 08:26 cpuid.mod
-rw-r--r-- 1 root root 197 2007-09-20 19:04 default
-rw-r--r-- 1 root root 45 2009-01-03 11:34 device.map
-rw-r--r-- 1 root root 512 2009-01-06 08:26 diskboot.img
-rw-r--r-- 1 root root 2096 2009-01-06 08:26 echo.mod
-rw-r--r-- 1 root root 4484 2009-01-06 08:26 elf.mod
-rw-r--r-- 1 root root 4352 2009-01-06 08:26 ext2.mod
-rw-r--r-- 1 root root 4972 2009-01-06 08:26 fat.mod
-rw-r--r-- 1 root root 2716 2009-01-06 08:26 font.mod
-rw-r--r-- 1 root root 2564 2009-01-06 08:26 fshelp.mod
-rw-r--r-- 1 root root 83 2009-01-06 08:26 fs.lst
-rw-r--r-- 1 root root 8548 2009-01-06 08:26 gfxterm.mod
-rw-r--r-- 1 root root 2896 2009-01-06 08:26 gpt.mod
-r--r--r-- 1 root root 3572 2009-01-03 11:34 grub.cfg
-rw-r--r-- 1 root root 7860 2009-01-06 08:26 gzio.mod
-rw-r--r-- 1 root root 1632 2009-01-06 08:26 halt.mod
-rw-r--r-- 1 root root 1384 2009-01-06 08:26 hello.mod
-rw-r--r-- 1 root root 2084 2009-01-06 08:26 help.mod
-rw-r--r-- 1 root root 3104 2009-01-06 08:26 hexdump.mod
-rw-r--r-- 1 root root 6348 2009-01-06 08:26 hfs.mod
-rw-r--r-- 1 root root 6432 2009-01-06 08:26 hfsplus.mod
-rw-r--r-- 1 root root 15 2007-09-20 19:04 installed-version
-rw-r--r-- 1 root root 5576 2009-01-06 08:26 iso9660.mod
-rw-r--r-- 1 root root 5208 2009-01-06 08:26 jfs.mod
-rw-r--r-- 1 root root 6568 2009-01-06 08:26 jpeg.mod
-rw-r--r-- 1 root root 30924 2009-01-06 08:26 kernel.img
-rw-r--r-- 1 root root 4872 2009-01-06 08:26 _linux.mod
-rw-r--r-- 1 root root 1576 2009-01-06 08:26 linux.mod
-rw-r--r-- 1 root root 1024 2009-01-06 08:26 lnxboot.img
-rw-r--r-- 1 root root 3156 2009-01-06 08:26 loopback.mod
-rw-r--r-- 1 root root 3928 2009-01-06 08:26 ls.mod
-rw-r--r-- 1 root root 4236 2009-01-06 08:26 lspci.mod
-rw-r--r-- 1 root root 5424 2009-01-06 08:26 lvm.mod
-rw-r--r-- 1 root root 2216 2009-01-06 08:26 memdisk.mod
-rw-r--r-- 1 root root 6150 2009-01-06 08:16 menu.lst
-rw-r--r-- 1 root root 6150 2009-01-06 08:13 menu.lst~
-rw-r--r-- 1 root root 7440 2009-01-03 22:03 menu.lst_20080104
-rw-r--r-- 1 root root 5967 2008-06-04 10:52 menu.lst.backup
-rw-r--r-- 1 root root 6847 2009-01-03 11:34 menu.lst_backup_by_grub2_postinst
-rw-r--r-- 1 root root 6460 2008-06-04 11:24 menu.lst.bak
-rw-r--r-- 1 root root 5950 2008-05-11 10:05 menu.lst_original
-rw-r--r-- 1 root root 4344 2009-01-06 08:26 minix.mod
-rw-r--r-- 1 root root 990 2009-01-06 08:26 moddep.lst
-rw-r--r-- 1 root root 11924 2009-01-06 08:26 _multiboot.mod
-rw-r--r-- 1 root root 1660 2009-01-06 08:26 multiboot.mod
-rw-r--r-- 1 root root 41436 2009-01-06 08:26 normal.mod
-rw-r--r-- 1 root root 3400 2009-01-06 08:26 ntfscomp.mod
-rw-r--r-- 1 root root 8600 2009-01-06 08:26 ntfs.mod
-rw-r--r-- 1 root root 29 2009-01-06 08:26 partmap.lst
-rw-r--r-- 1 root root 936 2009-01-06 08:26 pci.mod
-rw-r--r-- 1 root root 3328 2009-01-06 08:26 pc.mod
-rw-r--r-- 1 root root 2292 2009-01-06 08:26 play.mod
-rw-r--r-- 1 root root 6576 2009-01-06 08:26 png.mod
-rw-r--r-- 1 root root 1024 2009-01-06 08:26 pxeboot.img
-rw-r--r-- 1 root root 5192 2009-01-06 08:26 raid.mod
-rw-r--r-- 1 root root 1784 2009-01-06 08:26 read.mod
-rw-r--r-- 1 root root 1372 2009-01-06 08:26 reboot.mod
-rw-r--r-- 1 root root 9760 2009-01-06 08:26 reiserfs.mod
-rw-r--r-- 1 root root 3272 2009-01-06 08:26 search.mod
-rw-r--r-- 1 root root 5588 2009-01-06 08:26 serial.mod
-rw-r--r-- 1 root root 4484 2009-01-06 08:26 sfs.mod
-rw-r--r-- 1 root root 2300 2009-01-06 08:26 sleep.mod
drwxr-xr-x 2 root root 4096 2008-06-04 10:52 splashimages
-rw-r--r-- 1 root root 38321 2008-05-08 11:35 splash.xpm.gz
-rw-r--r-- 1 root root 2632 2009-01-06 08:26 sun.mod
-rw-r--r-- 1 root root 1980 2009-01-06 08:26 terminal.mod
-rw-r--r-- 1 root root 10040 2009-01-06 08:26 terminfo.mod
-rw-r--r-- 1 root root 1664 2009-01-06 08:26 test.mod
-rw-r--r-- 1 root root 2960 2009-01-06 08:26 tga.mod
-rw-r--r-- 1 root root 5028 2009-01-06 08:26 udf.mod
-rw-r--r-- 1 root root 5128 2009-01-06 08:26 ufs.mod
-rw-r--r-- 1 root root 2292 2009-01-06 08:26 vbeinfo.mod
-rw-r--r-- 1 root root 14084 2009-01-06 08:26 vbe.mod
-rw-r--r-- 1 root root 3172 2009-01-06 08:26 vbetest.mod
-rw-r--r-- 1 root root 3944 2009-01-06 08:26 vga.mod
-rw-r--r-- 1 root root 4084 2009-01-06 08:26 video.mod
-rw-r--r-- 1 root root 2884 2009-01-06 08:26 videotest.mod
-rw-r--r-- 1 root root 12379 2008-11-02 11:25 wyvern-luke-tuxwalker-1944.xpm.gz
-rw-r--r-- 1 root root 6624 2009-01-06 08:26 xfs.mod

================================ sdc1/boot.ini: ================================

[boot loader]

timeout=30

default=multi(0)disk(0)rdisk(0)partition(1)\WINDOW S

[operating systems]

multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Home Edition" /fastdetect /NoExecute=OptIn


=========================== Unknown MBRs or Boot Sectors =======================

Unknown MBR on /dev/sda

00000000 eb 4c 90 d0 bc 00 7c fb 50 07 50 1f fc be 1b 7c |.L....|.P.P....||
00000010 bf 1b 06 50 57 b9 e5 01 f3 a4 cb bd be 07 b1 04 |...PW...........|
00000020 38 6e 00 7c 09 75 13 83 c5 10 e2 f4 cd 18 8b f5 |8n.|.u..........|
00000030 83 c6 10 49 74 19 38 2c 74 f6 a0 b5 07 b4 04 00 |...It.8,t.......|
00000040 00 80 00 08 01 00 00 00 00 00 00 00 ff ff fa 90 |................|
00000050 90 f6 c2 80 75 02 b2 80 ea 5d 7c 00 00 31 c0 8e |....u....]|..1..|
00000060 d8 8e d0 bc 00 20 fb a1 4c 7c 88 e6 3c ff 74 02 |..... ..L|..<.t.|
00000070 88 c2 52 be 76 7d e8 25 01 be 05 7c f6 c2 80 74 |..R.v}.%...|...t|
00000080 48 b4 41 bb aa 55 cd 13 5a 52 72 3d 81 fb 55 aa |H.A..U..ZRr=..U.|
00000090 75 37 83 e1 01 74 32 31 c0 89 44 04 40 88 44 ff |u7...t21..D.@.D.|
000000a0 89 44 02 c7 04 10 00 66 8b 1e 44 7c 66 89 5c 08 |.D.....f..D|f.\.|
000000b0 66 8b 1e 48 7c 66 89 5c 0c c7 44 06 00 70 b4 42 |f..H|f.\..D..p.B|
000000c0 cd 13 72 05 bb 00 70 eb 74 b4 08 cd 13 73 0a f6 |..r...p.t....s..|
000000d0 c2 80 0f 84 ed 00 e9 85 00 66 0f b6 c6 88 64 ff |.........f....d.|
000000e0 40 66 89 44 04 0f b6 d1 c1 e2 02 88 e8 88 f4 40 |@f.D...........@|
000000f0 89 44 08 0f b6 c2 c0 e8 02 66 89 04 66 a1 48 7c |.D.......f..f.H||
00000100 66 09 c0 75 51 66 a1 44 7c 66 31 d2 66 f7 34 88 |f..uQf.D|f1.f.4.|
00000110 d1 31 d2 66 f7 74 04 3b 44 08 7d 3a fe c1 88 c5 |.1.f.t.;D.}:....|
00000120 30 c0 c1 e8 02 08 c1 88 d0 5a 52 88 c6 bb 00 70 |0........ZR....p|
00000130 8e c3 31 db b8 01 02 cd 13 72 2b 8c c3 8e 06 42 |..1......r+....B|
00000140 7c 60 1e b9 00 01 8e db 31 f6 31 ff fc f3 a5 1f ||`......1.1.....|
00000150 61 5a ff 26 40 7c be 7c 7d e8 42 00 eb 0e be 81 |aZ.&@|.|}.B.....|
00000160 7d e8 3a 00 eb 06 be 8b 7d e8 32 00 be 90 7d e8 |}.:.....}.2...}.|
00000170 2c 00 cd 18 eb fe 47 52 55 42 20 00 47 65 6f 6d |,.....GRUB .Geom|
00000180 00 48 61 72 64 20 44 69 73 6b 00 52 65 61 64 00 |.Hard Disk.Read.|
00000190 20 45 72 72 6f 72 00 bb 01 00 b4 0e cd 10 ac 3c | Error.........<|
000001a0 00 75 f4 c3 00 00 00 00 00 00 00 00 00 00 00 00 |.u..............|
000001b0 00 00 00 00 00 00 00 00 67 c6 6f f6 00 00 80 01 |........g.o.....|
000001c0 01 00 83 fe ff ff 3f 00 00 00 cd f9 e7 11 00 fe |......?.........|
000001d0 ff ff 0f fe ff ff 0c fa e7 11 b5 90 b9 00 00 00 |................|
000001e0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
00000200


=============================== StdErr Messages: ===============================

No errors were reported.

unutbu
January 6th, 2009, 03:06 PM
Note that your /boot/grub on sda1 does not contain a stage1 or stage2 file. Instead it has many interesting-looking .mod files. Perhaps this is related to your use of GRUB 2 instead of GRUB 1.9x.

So the grub command


find /boot/grub/stage2

will not work, but something like


find /boot/grub/menu.lst

may.

Perhaps try meierfra's instructions in post #665 (http://ubuntuforums.org/showpost.php?p=6492306&postcount=665) again, substituting the find command as described above.

von Stalhein
January 6th, 2009, 10:51 PM
I've had a look at my Ubuntu disk, it still contains all the GRUB menu.lst etc.

Unfortunately, whatever calls the bootloader now uses GRUB2, which uses a grub.cfg file to boot rather than the menu.lst, and it's in a completely different format.

From some reading, I came across one person who had manually deleted all the GRUB2 files and dependencies, but there must be a better way.

I'd like to be able to remove the GRUB2 from wherever it's taken over, and replace it with the legacy GRUB. I did another fixmbr late last night without any result, so that's not the way.

It boots to GRUB 1.96, and any editing I do on the cli results in the message that I need to load the kernel first, and I haven't found how this is done.

unutbu
January 7th, 2009, 12:55 AM
Since you are using Ibex, the version of GRUB that comes with Ibex is 0.97. I wonder how it is you have version 2 and version 0.96.

If you installed GRUB version 2 from a package, then perhaps it would be best to uninstall the package. If you installed it from a tar.gz file, see if you can uninstall it with "sudo make uninstall".

Whether or not you can uninstall GRUB version 2, the following should reinstall GRUB version 0.97:

Boot from the LiveCD
Open a Terminal


sudo mount /dev/sda1
sudo grub-install --root-directory=/mnt /dev/sda
sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo chroot /mnt # this gives you root shell with /mnt as /
apt-get install grub
update-grub

The grub-install command copies GRUB stage* files into the /mnt/boot directory.

The update-grub command then installs the stage* files to the MBR and beyond.

meierfra.
January 7th, 2009, 01:29 AM
+1

von Stalhein
January 7th, 2009, 03:02 AM
Thanks again guys!

I'm looking forward to getting home to try that - not the least because the a/c has gone west here at work, and it's 37C outside atm (lunch time).

I'll report back this evening.

von Stalhein
January 7th, 2009, 08:55 AM
Rightyho.

I get this message from the second line, and can get no further:

Could not find device for /mnt/boot: Not found or not a block device

I have run

sudo e2fsck -fy /dev/sda1 and no error reports follow.

fdisk returns

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xf66fc667

Device Boot Start End Blocks Id System
/dev/sda1 * 63 300415499 150207718+ 83 Linux
/dev/sda2 300415500 312576704 6080602+ f W95 Ext'd (LBA)
/dev/sda5 300415563 312576704 6080571 82 Linux swap / Solaris

Disk /dev/sdb: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xa3f79c20

Device Boot Start End Blocks Id System
/dev/sdb1 16065 234436544 117210240 f W95 Ext'd (LBA)
/dev/sdb5 16128 234436544 117210208+ 7 HPFS/NTFS

Disk /dev/sdc: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x960c960c

Device Boot Start End Blocks Id System
/dev/sdc1 * 63 234436544 117218241 7 HPFS/NTFS


Results.txt

============================= Boot Info Summary: ==============================

=> Grub2 is installed in the MBR of /dev/sda
=> Windows is installed in the MBR of /dev/sdb
=> Windows is installed in the MBR of /dev/sdc

sda1: __________________________________________________ _______________________

File system: ext3
Boot sector type: Windows XP
Boot sector info:
Operating System: Ubuntu 8.10
Boot files/dirs: /boot/grub/menu.lst /etc/fstab /boot /boot/grub

sda2: __________________________________________________ _______________________

File system: Extended Partition

sda5: __________________________________________________ _______________________

File system: swap

sdb1: __________________________________________________ _______________________

File system: Extended Partition

sdb5: __________________________________________________ _______________________

File system: ntfs
Boot sector type: Windows XP
Boot sector info:
Mounting failed:
$LogFile indicates unclean shutdown (0, 0)
Failed to mount '/dev/sdb5': Operation not supported
Mount is denied because NTFS is marked to be in use. Choose one action:

Choice 1: If you have Windows then disconnect the external devices by
clicking on the 'Safely Remove Hardware' icon in the Windows
taskbar then shutdown Windows cleanly.

Choice 2: If you don't have Windows then you can use the 'force' option for
your own responsibility. For example type on the command line:

mount -t ntfs-3g /dev/sdb5 sdb5 -o force

Or add the option to the relevant row in the /etc/fstab file:

/dev/sdb5 sdb5 ntfs-3g force 0 0

sdc1: __________________________________________________ _______________________

File system: ntfs
Boot sector type: Windows XP
Boot sector info: No errors found in the Boot Parameter Block.
Mounting failed:
$LogFile indicates unclean shutdown (0, 0)
Failed to mount '/dev/sdc1': Operation not supported
Mount is denied because NTFS is marked to be in use. Choose one action:

Choice 1: If you have Windows then disconnect the external devices by
clicking on the 'Safely Remove Hardware' icon in the Windows
taskbar then shutdown Windows cleanly.

Choice 2: If you don't have Windows then you can use the 'force' option for
your own responsibility. For example type on the command line:

mount -t ntfs-3g /dev/sdc1 sdc1 -o force

Or add the option to the relevant row in the /etc/fstab file:

/dev/sdc1 sdc1 ntfs-3g force 0 0

=========================== Drive/Partition Info: =============================

Drive sda: __________________________________________________ ___________________

fdisk -lu /dev/sda:

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xf66fc667

Device Boot Start End Blocks Id System
/dev/sda1 * 63 300415499 150207718+ 83 Linux
/dev/sda2 300415500 312576704 6080602+ f W95 Ext'd (LBA)
/dev/sda5 300415563 312576704 6080571 82 Linux swap / Solaris

sfdisk -V /dev/sda:

/dev/sda: OK

Drive sdb: __________________________________________________ ___________________

fdisk -lu /dev/sdb:

Disk /dev/sdb: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xa3f79c20

Device Boot Start End Blocks Id System
/dev/sdb1 16065 234436544 117210240 f W95 Ext'd (LBA)
/dev/sdb5 16128 234436544 117210208+ 7 HPFS/NTFS

sfdisk -V /dev/sdb:

Warning: no primary partition is marked bootable (active)
This does not matter for LILO, but the DOS MBR will not boot this disk.
/dev/sdb: OK

Drive sdc: __________________________________________________ ___________________

fdisk -lu /dev/sdc:

Disk /dev/sdc: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x960c960c

Device Boot Start End Blocks Id System
/dev/sdc1 * 63 234436544 117218241 7 HPFS/NTFS

sfdisk -V /dev/sdc:

/dev/sdc: OK

blkid -c /dev/null: __________________________________________________ __________

/dev/sda1: UUID="756b6798-621b-4d0c-a622-d079cd159cf0" SEC_TYPE="ext2" TYPE="ext3"
/dev/sda5: TYPE="swap" UUID="4e2664d2-a70a-469b-9242-1adb97db8229"
/dev/sdb5: UUID="A83CB1173CB0E18C" LABEL="Disk 2" TYPE="ntfs"
/dev/sdc1: UUID="01C3D871F965AC80" LABEL="DSK1_VOL1" TYPE="ntfs"
/dev/loop0: TYPE="squashfs"

=============================== "mount" output: ===============================

/proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
tmpfs on /lib/modules/2.6.27-7-generic/volatile type tmpfs (rw,mode=0755)
tmpfs on /lib/modules/2.6.27-7-generic/volatile type tmpfs (rw,mode=0755)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
varrun on /var/run type tmpfs (rw,nosuid,mode=0755)
varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
rootfs on / type rootfs (rw)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
/dev/scd1 on /cdrom type iso9660 (ro,noatime)
/dev/loop0 on /rofs type squashfs (ro,noatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
gvfs-fuse-daemon on /home/ubuntu/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=ubuntu)
/dev/sda1 on /media/disk type ext3 (rw,nosuid,nodev,uhelper=hal)

=========================== sda1/boot/grub/menu.lst: ===========================


# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not change this entry to 'saved' or your
# array will desync and will not let you boot your system.
default 10

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 20

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu

# Pretty colours
#color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
## password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title Windows 95/98/NT/2000
# uuid 756b6798-621b-4d0c-a622-d079cd159cf0
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=756b6798-621b-4d0c-a622-d079cd159cf0 ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,0)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash vga=771

## should update-grub lock old automagic boot options
## e.g. lockold=false
## lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(single-user) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

## ## End Default Options ##

splashimage=(hd0,0)/boot/grub/splash.xpm.gz

title Chainload into GRUB 2
uuid 756b6798-621b-4d0c-a622-d079cd159cf0
kernel /boot/grub/core.img

title ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
root

title When you have verified GRUB 2 works, you can use this command to
root

title complete the upgrade: upgrade-from-grub-legacy
root

title ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ
root

title Debian GNU/Linux, kernel 2.6.27-11-generic
uuid 756b6798-621b-4d0c-a622-d079cd159cf0
kernel /boot/vmlinuz-2.6.27-11-generic root=UUID=756b6798-621b-4d0c-a622-d079cd159cf0 ro quiet splash vga=771
initrd /boot/initrd.img-2.6.27-11-generic

title Debian GNU/Linux, kernel 2.6.27-11-generic (recovery mode)
uuid 756b6798-621b-4d0c-a622-d079cd159cf0
kernel /boot/vmlinuz-2.6.27-11-generic root=UUID=756b6798-621b-4d0c-a622-d079cd159cf0 ro single
initrd /boot/initrd.img-2.6.27-11-generic

title Debian GNU/Linux, kernel 2.6.27-10-generic
uuid 756b6798-621b-4d0c-a622-d079cd159cf0
kernel /boot/vmlinuz-2.6.27-10-generic root=UUID=756b6798-621b-4d0c-a622-d079cd159cf0 ro quiet splash vga=771
initrd /boot/initrd.img-2.6.27-10-generic

title Debian GNU/Linux, kernel 2.6.27-10-generic (recovery mode)
uuid 756b6798-621b-4d0c-a622-d079cd159cf0
kernel /boot/vmlinuz-2.6.27-10-generic root=UUID=756b6798-621b-4d0c-a622-d079cd159cf0 ro single
initrd /boot/initrd.img-2.6.27-10-generic

title Debian GNU/Linux, kernel 2.6.27-8-generic
uuid 756b6798-621b-4d0c-a622-d079cd159cf0
kernel /boot/vmlinuz-2.6.27-8-generic root=UUID=756b6798-621b-4d0c-a622-d079cd159cf0 ro quiet splash vga=771
initrd /boot/initrd.img-2.6.27-8-generic

title Debian GNU/Linux, kernel 2.6.27-8-generic (recovery mode)
uuid 756b6798-621b-4d0c-a622-d079cd159cf0
kernel /boot/vmlinuz-2.6.27-8-generic root=UUID=756b6798-621b-4d0c-a622-d079cd159cf0 ro single
initrd /boot/initrd.img-2.6.27-8-generic

title Debian GNU/Linux, kernel memtest86+
uuid 756b6798-621b-4d0c-a622-d079cd159cf0
kernel /boot/memtest86+.bin

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title Systems for teh n00bs!!!:-
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sdb1

title Microsoft Windows XP Home Edition
root (hd2,0)
savedefault
makeactive
map (hd0) (hd2)
map (hd2) (hd0)
chainloader +1


=============================== sda1/etc/fstab: ===============================

# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/sda1
UUID=756b6798-621b-4d0c-a622-d079cd159cf0 / ext3 defaults,errors=remount-ro,relatime 0 1
# /dev/sda5
UUID=059e0975-883a-4693-9bf3-6bec10b11ea6 none swap sw 0 0
/dev/cdrom /media/cdrom0 udf,iso9660 user,noauto 0 0
/dev/scd1 /media/cdrom1 udf,iso9660 user,noauto 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto 0 0

================================== sda1/boot: ==================================

total 83500
drwxr-xr-x 3 root root 4096 2009-01-03 19:51 .
drwxrwxrwx 23 root root 4096 2008-12-21 12:28 ..
-rw-r--r-- 1 root root 414274 2007-09-23 20:28 abi-2.6.20-16-generic
-rw-r--r-- 1 root root 422838 2008-10-22 03:12 abi-2.6.24-21-generic
-rw-r--r-- 1 root root 507990 2008-11-21 13:46 abi-2.6.27-10-generic
-rw-r--r-- 1 root root 508385 2008-12-19 17:57 abi-2.6.27-11-generic
-rw-r--r-- 1 root root 507665 2008-11-04 21:00 abi-2.6.27-7-generic
-rw-r--r-- 1 root root 507735 2008-11-06 19:20 abi-2.6.27-8-generic
-rw-r--r-- 1 root root 83217 2007-09-23 17:47 config-2.6.20-16-generic
-rw-r--r-- 1 root root 80062 2008-10-22 03:12 config-2.6.24-21-generic
-rw-r--r-- 1 root root 91358 2008-11-21 13:46 config-2.6.27-10-generic
-rw-r--r-- 1 root root 91358 2008-12-19 17:57 config-2.6.27-11-generic
-rw-r--r-- 1 root root 91364 2008-11-04 21:00 config-2.6.27-7-generic
-rw-r--r-- 1 root root 91364 2008-11-06 19:20 config-2.6.27-8-generic
drwxr-xr-x 3 root root 4096 2009-01-06 08:26 grub
-rw-r--r-- 1 root root 7635391 2008-06-04 10:54 initrd.img-2.6.20-16-generic
-rw-r--r-- 1 root root 6948833 2007-09-25 09:40 initrd.img-2.6.20-16-generic.bak
-rw-r--r-- 1 root root 7910888 2008-10-28 09:43 initrd.img-2.6.24-21-generic
-rw-r--r-- 1 root root 7912815 2008-10-01 11:58 initrd.img-2.6.24-21-generic.bak
-rw-r--r-- 1 root root 8202482 2008-12-01 11:01 initrd.img-2.6.27-10-generic
-rw-r--r-- 1 root root 8203809 2009-01-03 19:51 initrd.img-2.6.27-11-generic
-rw-r--r-- 1 root root 8179651 2008-11-06 11:36 initrd.img-2.6.27-7-generic
-rw-r--r-- 1 root root 8200306 2008-11-17 20:15 initrd.img-2.6.27-8-generic
-rw-r--r-- 1 root root 124152 2008-09-11 20:11 memtest86+.bin
-rw-r--r-- 1 root root 807071 2007-09-23 20:30 System.map-2.6.20-16-generic
-rw-r--r-- 1 root root 905617 2008-10-22 03:12 System.map-2.6.24-21-generic
-rw-r--r-- 1 root root 1029828 2008-11-21 13:46 System.map-2.6.27-10-generic
-rw-r--r-- 1 root root 1031799 2008-12-19 17:57 System.map-2.6.27-11-generic
-rw-r--r-- 1 root root 1029585 2008-11-04 21:00 System.map-2.6.27-7-generic
-rw-r--r-- 1 root root 1029612 2008-11-06 19:20 System.map-2.6.27-8-generic
-rw-r--r-- 1 root root 1074 2008-11-21 13:48 vmcoreinfo-2.6.27-10-generic
-rw-r--r-- 1 root root 1074 2008-12-19 17:58 vmcoreinfo-2.6.27-11-generic
-rw-r--r-- 1 root root 1073 2008-11-04 21:02 vmcoreinfo-2.6.27-7-generic
-rw-r--r-- 1 root root 1073 2008-11-06 19:22 vmcoreinfo-2.6.27-8-generic
-rw-r--r-- 1 root root 1747372 2007-09-23 20:28 vmlinuz-2.6.20-16-generic
-rw-r--r-- 1 root root 1920760 2008-10-22 03:12 vmlinuz-2.6.24-21-generic
-rw-r--r-- 1 root root 2247280 2008-11-21 13:46 vmlinuz-2.6.27-10-generic
-rw-r--r-- 1 root root 2248912 2008-12-19 17:57 vmlinuz-2.6.27-11-generic
-rw-r--r-- 1 root root 2244464 2008-11-04 21:00 vmlinuz-2.6.27-7-generic
-rw-r--r-- 1 root root 2244304 2008-11-06 19:20 vmlinuz-2.6.27-8-generic

=============================== sda1/boot/grub: ===============================

total 744
drwxr-xr-x 3 root root 4096 2009-01-06 08:26 .
drwxr-xr-x 3 root root 4096 2009-01-03 19:51 ..
-rw-r--r-- 1 root root 2236 2009-01-06 08:26 acorn.mod
-rw-r--r-- 1 root root 4876 2009-01-06 08:26 affs.mod
-rw-r--r-- 1 root root 6808 2009-01-06 08:26 afs.mod
-rw-r--r-- 1 root root 2612 2009-01-06 08:26 amiga.mod
-rw-r--r-- 1 root root 1144 2009-01-06 08:26 aout.mod
-rw-r--r-- 1 root root 2680 2009-01-06 08:26 apple.mod
-rw-r--r-- 1 root root 4724 2009-01-06 08:26 ata.mod
-rw-r--r-- 1 root root 4300 2009-01-06 08:26 biosdisk.mod
-rw-r--r-- 1 root root 2568 2009-01-06 08:26 bitmap.mod
-rw-r--r-- 1 root root 2248 2009-01-06 08:26 blocklist.mod
-rw-r--r-- 1 root root 512 2009-01-06 08:26 boot.img
-rw-r--r-- 1 root root 1456 2009-01-06 08:26 boot.mod
-rw-r--r-- 1 root root 8756 2009-01-06 08:26 _bsd.mod
-rw-r--r-- 1 root root 2324 2009-01-06 08:26 bsd.mod
-rw-r--r-- 1 root root 2076 2009-01-06 08:26 cat.mod
-rw-r--r-- 1 root root 512 2009-01-06 08:26 cdboot.img
-rw-r--r-- 1 root root 2508 2009-01-06 08:26 _chain.mod
-rw-r--r-- 1 root root 1816 2009-01-06 08:26 chain.mod
-rw-r--r-- 1 root root 2312 2009-01-06 08:26 cmp.mod
-rw-r--r-- 1 root root 713 2009-01-06 08:26 command.lst
-rw-r--r-- 1 root root 1908 2009-01-06 08:26 configfile.mod
-rw-r--r-- 1 root root 28746 2009-01-06 08:26 core.img
-rw-r--r-- 1 root root 3208 2009-01-06 08:26 cpio.mod
-rw-r--r-- 1 root root 1588 2009-01-06 08:26 cpuid.mod
-rw-r--r-- 1 root root 197 2007-09-20 19:04 default
-rw-r--r-- 1 root root 45 2009-01-03 11:34 device.map
-rw-r--r-- 1 root root 512 2009-01-06 08:26 diskboot.img
-rw-r--r-- 1 root root 2096 2009-01-06 08:26 echo.mod
-rw-r--r-- 1 root root 4484 2009-01-06 08:26 elf.mod
-rw-r--r-- 1 root root 4352 2009-01-06 08:26 ext2.mod
-rw-r--r-- 1 root root 4972 2009-01-06 08:26 fat.mod
-rw-r--r-- 1 root root 2716 2009-01-06 08:26 font.mod
-rw-r--r-- 1 root root 2564 2009-01-06 08:26 fshelp.mod
-rw-r--r-- 1 root root 83 2009-01-06 08:26 fs.lst
-rw-r--r-- 1 root root 8548 2009-01-06 08:26 gfxterm.mod
-rw-r--r-- 1 root root 2896 2009-01-06 08:26 gpt.mod
-r--r--r-- 1 root root 3572 2009-01-03 11:34 grub.cfg
-rw-r--r-- 1 root root 7860 2009-01-06 08:26 gzio.mod
-rw-r--r-- 1 root root 1632 2009-01-06 08:26 halt.mod
-rw-r--r-- 1 root root 1384 2009-01-06 08:26 hello.mod
-rw-r--r-- 1 root root 2084 2009-01-06 08:26 help.mod
-rw-r--r-- 1 root root 3104 2009-01-06 08:26 hexdump.mod
-rw-r--r-- 1 root root 6348 2009-01-06 08:26 hfs.mod
-rw-r--r-- 1 root root 6432 2009-01-06 08:26 hfsplus.mod
-rw-r--r-- 1 root root 15 2007-09-20 19:04 installed-version
-rw-r--r-- 1 root root 5576 2009-01-06 08:26 iso9660.mod
-rw-r--r-- 1 root root 5208 2009-01-06 08:26 jfs.mod
-rw-r--r-- 1 root root 6568 2009-01-06 08:26 jpeg.mod
-rw-r--r-- 1 root root 30924 2009-01-06 08:26 kernel.img
-rw-r--r-- 1 root root 4872 2009-01-06 08:26 _linux.mod
-rw-r--r-- 1 root root 1576 2009-01-06 08:26 linux.mod
-rw-r--r-- 1 root root 1024 2009-01-06 08:26 lnxboot.img
-rw-r--r-- 1 root root 3156 2009-01-06 08:26 loopback.mod
-rw-r--r-- 1 root root 3928 2009-01-06 08:26 ls.mod
-rw-r--r-- 1 root root 4236 2009-01-06 08:26 lspci.mod
-rw-r--r-- 1 root root 5424 2009-01-06 08:26 lvm.mod
-rw-r--r-- 1 root root 2216 2009-01-06 08:26 memdisk.mod
-rw-r--r-- 1 root root 6150 2009-01-06 08:16 menu.lst
-rw-r--r-- 1 root root 6150 2009-01-06 08:13 menu.lst~
-rw-r--r-- 1 root root 7440 2009-01-03 22:03 menu.lst_20080104
-rw-r--r-- 1 root root 5967 2008-06-04 10:52 menu.lst.backup
-rw-r--r-- 1 root root 6847 2009-01-03 11:34 menu.lst_backup_by_grub2_postinst
-rw-r--r-- 1 root root 6460 2008-06-04 11:24 menu.lst.bak
-rw-r--r-- 1 root root 5950 2008-05-11 10:05 menu.lst_original
-rw-r--r-- 1 root root 4344 2009-01-06 08:26 minix.mod
-rw-r--r-- 1 root root 990 2009-01-06 08:26 moddep.lst
-rw-r--r-- 1 root root 11924 2009-01-06 08:26 _multiboot.mod
-rw-r--r-- 1 root root 1660 2009-01-06 08:26 multiboot.mod
-rw-r--r-- 1 root root 41436 2009-01-06 08:26 normal.mod
-rw-r--r-- 1 root root 3400 2009-01-06 08:26 ntfscomp.mod
-rw-r--r-- 1 root root 8600 2009-01-06 08:26 ntfs.mod
-rw-r--r-- 1 root root 29 2009-01-06 08:26 partmap.lst
-rw-r--r-- 1 root root 936 2009-01-06 08:26 pci.mod
-rw-r--r-- 1 root root 3328 2009-01-06 08:26 pc.mod
-rw-r--r-- 1 root root 2292 2009-01-06 08:26 play.mod
-rw-r--r-- 1 root root 6576 2009-01-06 08:26 png.mod
-rw-r--r-- 1 root root 1024 2009-01-06 08:26 pxeboot.img
-rw-r--r-- 1 root root 5192 2009-01-06 08:26 raid.mod
-rw-r--r-- 1 root root 1784 2009-01-06 08:26 read.mod
-rw-r--r-- 1 root root 1372 2009-01-06 08:26 reboot.mod
-rw-r--r-- 1 root root 9760 2009-01-06 08:26 reiserfs.mod
-rw-r--r-- 1 root root 3272 2009-01-06 08:26 search.mod
-rw-r--r-- 1 root root 5588 2009-01-06 08:26 serial.mod
-rw-r--r-- 1 root root 4484 2009-01-06 08:26 sfs.mod
-rw-r--r-- 1 root root 2300 2009-01-06 08:26 sleep.mod
drwxr-xr-x 2 root root 4096 2008-06-04 10:52 splashimages
-rw-r--r-- 1 root root 38321 2008-05-08 11:35 splash.xpm.gz
-rw-r--r-- 1 root root 2632 2009-01-06 08:26 sun.mod
-rw-r--r-- 1 root root 1980 2009-01-06 08:26 terminal.mod
-rw-r--r-- 1 root root 10040 2009-01-06 08:26 terminfo.mod
-rw-r--r-- 1 root root 1664 2009-01-06 08:26 test.mod
-rw-r--r-- 1 root root 2960 2009-01-06 08:26 tga.mod
-rw-r--r-- 1 root root 5028 2009-01-06 08:26 udf.mod
-rw-r--r-- 1 root root 5128 2009-01-06 08:26 ufs.mod
-rw-r--r-- 1 root root 2292 2009-01-06 08:26 vbeinfo.mod
-rw-r--r-- 1 root root 14084 2009-01-06 08:26 vbe.mod
-rw-r--r-- 1 root root 3172 2009-01-06 08:26 vbetest.mod
-rw-r--r-- 1 root root 3944 2009-01-06 08:26 vga.mod
-rw-r--r-- 1 root root 4084 2009-01-06 08:26 video.mod
-rw-r--r-- 1 root root 2884 2009-01-06 08:26 videotest.mod
-rw-r--r-- 1 root root 12379 2008-11-02 11:25 wyvern-luke-tuxwalker-1944.xpm.gz
-rw-r--r-- 1 root root 6624 2009-01-06 08:26 xfs.mod

=============================== StdErr Messages: ===============================

No errors were reported.

I am in control, I just can't find the right lever.

whyette
January 7th, 2009, 09:05 AM
This worked flawlessly for me. Thanks a lot!

meierfra.
January 7th, 2009, 09:20 AM
von Stalhein: Try


sudo mount /dev/sda1 /mnt
sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo chroot /mnt
apt-get install grub
grub-install --recheck /dev/sda
update-grub

von Stalhein
January 7th, 2009, 09:27 AM
Awesome!
One small issue - it got through all the way until it tried to get into the repos - I have some local ones set - error messages follow:

root@ubuntu:/# apt-get install grub
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
libconvert-binhex-perl libsoap-lite-perl libuser-perl libmime-types-perl
libhyphen0 libwpg-0.1-1 libossp-uuid-perl libmime-tools-perl libossp-uuid15
python-soappy python-brlapi libio-stringy-perl libnet-google-perl
libemail-date-format-perl nullmailer libwww-search-perl libgnome-speech7
libmime-lite-perl libfcgi-perl discover1-data python-fpconst
libjcode-pm-perl
Use 'apt-get autoremove' to remove them.
Suggested packages:
grub-doc mdadm
The following packages will be REMOVED:
grub-pc grub2
The following NEW packages will be installed:
grub
0 upgraded, 1 newly installed, 2 to remove and 1 not upgraded.
Need to get 402kB of archives.
After this operation, 1946kB disk space will be freed.
Do you want to continue [Y/n]? y
Err http://mirror.3fl.net.au intrepid/main grub 0.97-29ubuntu45
Could not resolve 'mirror.3fl.net.au'
Err http://au.archive.ubuntu.com intrepid/main grub 0.97-29ubuntu45
Could not resolve 'au.archive.ubuntu.com'
Failed to fetch http://au.archive.ubuntu.com/ubuntu/pool/main/g/grub/grub_0.97-29ubuntu45_i386.deb Could not resolve 'au.archive.ubuntu.com'
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?



Where would the "--fix-missing" go assuming that it would allow a continuance?
Or do I need to specify the repo in the cl?

meierfra.
January 7th, 2009, 09:45 AM
Sound like you have no internet connection in the chroot environment. Try this

sudo mount /dev/sda1 /mnt
sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo cp /etc/resolv.conf /mnt/etc/resolv.conf
sudo chroot /mnt
apt-get install grub
grub-install --recheck /dev/sda
update-grub

Iif you haven't rebooted since the last time, you won't have to repeat the first three lines. If you still have the terminal open from the last time, close it and open a new one.
If you still have a problem with the "apt-get install grub" line, type

ping -c 3 www.google.com

to check whether you have a working internet connection.

von Stalhein
January 7th, 2009, 10:05 AM
You are the Guru meierfra, there's no doubt about that!!

I'm a bit gunshy now though, I've been presented with some options:

install the package maintainer's version │
│ keep the local version currently installed │
│ show the differences between the versions │
│ show a side-by-side difference between the versions │
│ show a 3-way difference between available versions │
│ do a 3-way merge between available versions (experimental) │
│ start a new shell to examine the situation

Which is the right one here for my situation? I'm surmising the package maintainer? Or is the local version the one I had last that worked after your previous advice?

meierfra.
January 7th, 2009, 10:09 AM
It shouldn't really matter, but I suggest


install the package maintainer's version

von Stalhein
January 7th, 2009, 10:12 AM
Done, so, now I reboot and see the GRUB goodness?

Sorry about the baby steps, but I think that I've shown if I'm left to make my own decisions it leads to an exponential increase in takeup of your time.

meierfra.
January 7th, 2009, 10:14 AM
now I reboot
yes.

von Stalhein
January 7th, 2009, 10:20 AM
Okay, thanks.

"See" you soon, I hope.

The other thing I'd like to do is thank you for your patience - it might not look like it, but I have learnt heaps over the last week, and it's blokes like you and unutbu that inspire me to persist with this sort of stuff.



edit: Oh sensational, it's all good!! You blokes are worth more money!!

I've been stuffing up on PCs since around '90, and I can get around a DOS prompt with my eyes closed, but this thing has so much more power and interest - and community - thanks again.

T3v4
January 7th, 2009, 06:36 PM
Hello everybody
Please I need some help !

I have WinXP and Ubuntu in on partitions sda1,sda2 and the boot loader is in the ubuntu partition sda2 and it is the active part.
Now i need to reinstall XP and surely I'll lost GRUP so the questions are:
1-If I install the grup from the live cd , Does the Windows appear in the boot menu or ubuntu only?

2-I can not understand why I lost the GRUP in the face of I install the loader in the linux partition!! :confused:
is that means that the grup needs MBR anyway?

sorry if the second question was stupid, but I want to now it cuz I'm a new in linux :D

Thanks in advance :)

unutbu
January 7th, 2009, 07:10 PM
@ von Stalhein: It's great to read you are back up and running!

@ T3v4: Welcome to ubuntuforums.


1-If I install the grup from the live cd , Does the Windows appear in the boot menu or ubuntu only?

When you reach the GRUB menu, you probably see an option for Windows and Ubuntu presently.
Those options are listed in /boot/grub/menu.lst. When you reinstall GRUB, it will again read /boot/grub/menu.lst (which should survive an installation of Windows untouched), and so you would again have both options (Windows and Ubuntu) available at the GRUB menu.


2-I can not understand why I lost the GRUP in the face of I install the loader in the linux partition!!

The GRUB stage1 file is installed in the first 512 bytes of your hard drive (also known as the MBR). When you reinstall XP, the Windows installer writes its own bootloader on to the MBR, overwriting GRUB. This is why you would need to reinstall GRUB.

Catlett describes how to reinstall GRUB using the LiveCD here:
http://ubuntuforums.org/showpost.php?p=1308395&postcount=1

bored_lurker
January 10th, 2009, 07:28 PM
Hi all,
I am having issues trying to restore GRUB. I had XP (32bit) and Ubuntu 8.10 64 bit up and running fine. I decided to install Windows 7 so I used Gparted live to partition and installed W7 in the unallocated space. Windows booted with its MBR as expected so I found this and many other threads on how to fix it.

I booted from LiveCD, sudo grub, found stage1 as (hd0,4), and did the set up. There where 2 errors that it said were not fatal, exited, rebooted - right back into Window's MBR. I did this twice with the same results. Any ideas?

meierfra.
January 10th, 2009, 07:38 PM
It sounds like you did "setup (hd0,4)". Try "setup (hd0)":



sudo grub
root (hd0,4)
setup (hd0)
quit

getnripped
January 21st, 2009, 11:34 PM
Thanks for this tut. It was really helpful in my reinstall of grub. Got to love windows.... it trashed my Grub and could not reinstall it. Turns out the step I needed was mounting the /dev

thanks again.
GNR

tubunu
January 27th, 2009, 10:35 AM
I've recently had a problem with partition table on my PC and managed to solve it with the help of a very friendly fellow Ubuntu geek. The problem and solution can be found here: http://ubuntuforums.org/showthread.php?t=1041545

After finally installing Ubuntu I cannot restore Grub at all!
I tried: Super Grub disk
I tried:

sudo grub
find /boot/grub/stage1
(hd1,6)
root (hd1,6)
setup (hd0)
quit


It finds my root partition and sets up grub to (hd0) but when I reboot there's no grub whatsoever, Windows starts immediately. Would anyone be kind enough to help out? Thank you.

caljohnsmith
January 27th, 2009, 02:37 PM
Sorry to hear you're still having problems after reinstalling Ubuntu, Tubunu; it sounds like it may be a simple issue with which drive you are booting on start up. How about trying:

sudo grub
grub> root (hd1,6)
grub> setup (hd1)
grub> quit
The reboot, set your BIOS to boot your Ubuntu drive, and let me know how far you get. If you run into problems, how about downloading the Boot Info Script (https://sourceforge.net/projects/bootinfoscript/) to your Ubuntu desktop (on the Live CD) and do:

sudo bash ~/Desktop/boot_info_script*.sh
That will create a "RESULTS.txt" file in the same directory from where the script is run, namely your desktop; please copy/paste the contents of that file to your next post. The results of that script will help clarify your setup and hopefully what the solution to your booting problem might be.

AbdulRahiem
January 27th, 2009, 07:34 PM
Well, one doesn't learn without experimenting, but experimenting also gives great headache.

I tried to install Fedora 10 alongside my Ubuntu Intrepid, on a separate partition, whilst sharing the /home directory. Of course, Fedora wanted to reinstall grub. I chose the option to include my existing Ubtuntu and set it as default.

The reason I wanted to install Fedora is that my Bandrich GSM modem will not work with Ubuntu, whilst they have a patch for Fedora. So, when on the move I may have to use Fedora.

Anyhow, I cannot boot anything at all now. Super Grub Disk was unable to reinstall grub. It gave 'fatal errors'. But when I run Live CDs I can see everything; nothing seems to be missing.

Now, I am not sure how to set my hard disk parameters in the little listing of commands in the preceding posting. So, I attach my RESULTS.TXT in the hope that someone can tell me.

Alternatively, how can I do a repair or upgrade of my existing system, rather than a fresh install? The alternative Gutsy CD had an ' upgrade' option, but the alternative Intrepid CD does not. Unless I have sand in my eyes. It does have a repair option, but since automatic repair doesn' t work (I tried), I get into a realm of commands that are (as yet) beyond my knowledge.

Best regards

caljohnsmith
January 27th, 2009, 07:51 PM
AbdulRahiem, I wouldn't recommend trying to share the same home partition across distros, because you can run into problems with the configuration files in your home directory. Instead I would suggest just sharing a common data partition where you can put all your personal files. About restoring Grub, which Live CD are you booting? You should try to use the latest Intrepid Live CD, because the Grub that comes with previous Ubuntu versions won't be able to deal with your Intrepid partition. But if you don't have an Intrepid Live CD, do you at least have a 64-bit Live CD? Your sda1 Ubuntu install is 64-bit, true? Also, do you have any preference whether Ubuntu or Fedora is in charge of the booting process? And lastly, what exactly happens when you try to boot the HDD right now?

AbdulRahiem
January 27th, 2009, 07:53 PM
Just to add to my message of a few minutes ago, I attach my original menu.lst from the /boot/grub directory. I cannot find the one that Fedora is supposed to have created. There is a link sitting on the volume I installed Fedora on (sda6), but seems to be pointing to nowhere.

Regards

AbdulRahiem
January 27th, 2009, 07:56 PM
Yes, I have both the 64-bit Intrepid Live CD and the 64-bit Intrepid alternative cd.

What I get when I boot now I will post in a few minutes. I have to reboot to have a look....

Thank you for your very fast reponse. It is much appreciated.

AbdulRahiem

AbdulRahiem
January 27th, 2009, 08:20 PM
It is running a menu.lst created by Fedora and says it will boot Ubuntu. It only gives 3 seconds to press 'esc', but my system does not seem to respond to that. The, when it tries to boot it fails almost immediately with: Error 13: Invalid or unsupported executable format.

Yes, my Ubuntu is 64-bit. It was installed on a new machine two weeks ago. The machine is self-assembled from all new parts. Quad CPU. 6GB RAM. The disks were also new, so nothing but Ubuntu has ever been installed on them.

I wish Ubuntu to be in charge. In fact, I was testing for my laptop, because that is where I may have to install Fedora in order to have internet on the move through my Bandluxe/Bandrich GSM modem. But my main OS is and will remain Ubuntu. (On my laptop I have Windows XP as guest in VirtualBox, but I find that I rarely, if ever, need to run it.

Best regards

AbdulRahiem

caljohnsmith
January 27th, 2009, 08:23 PM
OK, how about from your Intrepid 64-bit Live CD, try:

sudo grub
grub> root (hd0,0)
grub> setup (hd0)
grub> quit
And please post the output of the commands before typing "quit". When you reboot, press "ESC" to get the Grub menu on start up, and if all goes well you should be able to boot into Ubuntu. If that works you can add an entry in your Ubuntu menu.lst to boot Fedora, but let me know if you can boot into Ubuntu first; we can work from there.

AbdulRahiem
January 27th, 2009, 09:15 PM
Thank you. You are magic. All is working well.

As per your request, I did save the output of the commands to a text file, which I copied to an attached USB hard disk and checked whether I could see it there. However, after rebooting, the file wasn't there. (Maybe the cache had not completed writing, I don't know. Sorry about that.) But there were no error messages of any kind. The output merely confirmed correct execution. Instead, though it probably is no good to you, I attach the output of dmesg.

The reason my system would not respond to ESC when grub is loading, is that I disable legacy usb support in the bios. I do that to avoid the EHCI BIOS Handoff error message and the long wait. (My keyboard and mouse are wireless usb.) I did re-enable it for this reboot and was able to ESC to the menu list. There were only the usual Ubuntu entries there.

I am a bit wary of Fedora now. I looked at its file structure and saw that, in spite of me having pointed to the /home directory that I use under under Ubuntu, which sits on a separate partition, by the way (sda5), it had created an empty /home directory on its own partition (sda6). Partitions sda5, 6, 7 and 8 (swap) are logical drives in extended partition sda2. sda3 and sda4 are not used for reasons beyond me.

Best regards

AbdulRahiem
(BTW, where is the Thankyou Button?)

caljohnsmith
January 27th, 2009, 09:26 PM
AbdulRahiem, actually we would expect that your Fedora partition has an empty /home directory, because it needs that directory in order to mount your home partition on that directory at start up. According to your Fedora /etc/fstab, your home partition (sda5) is being mounted there, so it should be working like you expect. Also, if you still want to boot Fedora from the Ubuntu Grub menu you get on start up, how about first opening your menu.lst while you are in Ubuntu:

gksudo gedit /boot/grub/menu.lst
And at the very bottom add:

title Fedora Grub Menu
configfile (hd0,5)/boot/grub/grub.conf
Then I think you should be able to boot Fedora from Grub, but let me know if you run into problems. Otherwise, cheers and enjoy your linux distros. :)

tubunu
January 27th, 2009, 09:27 PM
How about trying:

sudo grub
grub> root (hd1,6)
grub> setup (hd1)
grub> quit

This was all I needed to do. How silly of me not to notice it was saving grub to hd0 rather than hd1. I'm typing this from my brand new installation of Ubuntu LTS! :D

THANK YOU, caljohnsmith, you've done it again! Much appreciated. Here's a bucket of yummy popcorn for you. :popcorn:

caljohnsmith
January 27th, 2009, 09:34 PM
This was all I needed to do. How silly of me not to notice it was saving grub to hd0 rather than hd1. I'm typing this from my brand new installation of Ubuntu LTS! :D

THANK YOU, caljohnsmith, you've done it again! Much appreciated. Here's a bucket of yummy popcorn for you. :popcorn:
I'm always glad too when the solution turns out to be simple, Tubunu, so I'm glad that's all it took; cheers and enjoy your Ubuntu install. :)

AbdulRahiem
January 27th, 2009, 09:55 PM
Thank you very much. It is all working. I did not expect to see my Ubuntu desktop when running Fedora. Just goes to show how much I still need to learn.

When I selected the Fedora Grub menu I did again get that Error 13: Invalid or unsupported executable format, but then it proceeded with listing the choice of booting between Fedora (mentioned first) and Ubuntu, but with Ubuntu highlighted as default.

I have not tested booting to Ubuntu from that menu, as it is a round-about way that I would never actually need to use.

Again, thank you very much for your fast and effective help. If thereś anything I can do, please let me know. But not right now, as it is midnight and my bed beckons.

Best regards

AbdulRahiem

caljohnsmith
January 27th, 2009, 10:01 PM
AbdulRahiem, after looking over your Fedora's grub.conf file more closely, I believe I see the problem. The next time you boot into Fedora, how about opening your grub.conf:

gksudo gedit /boot/grub/grub.conf
And you can delete the Ubuntu entry in it:

title Ubuntu64
rootnoverify (hd0,0)
chainloader +1
Also change the "default 1" line to:

default 0
Then you shouldn't get a Grub error 13 when choosing the Fedora Grub menu from your Ubuntu Grub menu. Let me know though if you run into any problems.

AbdulRahiem
January 28th, 2009, 08:10 AM
Dear caljohnsmith

Thanks again for your very great help.

Having had a good lookover by now, in my assessment Ubuntu is far more user-friendly. So, if and when I find a solution for my Bandluxe/Bandrich GSM modem on Ubuntu, I should be glad to abandon Fedora again. Of course, other people may be happy with Fedora. No problem.

In case you wonder how I connect to the internet now. My modem is connected to a Bandluxe/Bandrich router. Only it does not work when connected directly to PC or laptop. And of course, on the road I do not want to have to carry my router with me everywhere. That's too cumbersome. (Not for the security risk; the router is setup to accept connections from certain MAC addresses only. So, no-one else can sneak in.)

Again, if I can be of any help to anyone, please let me know.

Best ragards

AbdulRahiem

russlar
January 31st, 2009, 05:22 AM
This worked great for me. I got home, and my laptop displayed the word "GRUB" and went no further after POST. no error code, no cli, nothing.

Thanks for saving me from (another) long night of re-installing!


Since you are using Ibex, the version of GRUB that comes with Ibex is 0.97. I wonder how it is you have version 2 and version 0.96.

If you installed GRUB version 2 from a package, then perhaps it would be best to uninstall the package. If you installed it from a tar.gz file, see if you can uninstall it with "sudo make uninstall".

Whether or not you can uninstall GRUB version 2, the following should reinstall GRUB version 0.97:

Boot from the LiveCD
Open a Terminal


sudo mount /dev/sda1
sudo grub-install --root-directory=/mnt /dev/sda
sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo chroot /mnt # this gives you root shell with /mnt as /
apt-get install grub
update-grub

The grub-install command copies GRUB stage* files into the /mnt/boot directory.

The update-grub command then installs the stage* files to the MBR and beyond.

Tom_T
February 2nd, 2009, 12:49 AM
Hi.

Acer Aspire 1694 Laptop with 100GB Hard Disk.

Disk was split 75/25 with XP and a data partition.
I installed Ubuntu 8.10 from a live CD and followed the default installation keeping XP.

This has worked for a few weeks with grub allowing me to select which OS to boot.

Today I had to reinstall XP, now I get the XP Boot loader and no grub.

I've booted from the Ubuntu LiveCD, but partition manager doesn't show any recognisable partitions.

fdisk -lu only shows the XP partition.

Yet in places I can see the ubuntu disk and can get into /boot/grub

How do I reinstall Grub ??

In XP I can see:

5 partitions

47.95GB FAT32 XP
24.87GB Ubuntu
1.12GB
19.58GB
19.58GB NTFS (data partition)

Any ideas ??

Thanks :)

caljohnsmith
February 2nd, 2009, 12:52 AM
Tom_T, please post the full output of:

sudo fdisk -lu
So we can first see exactly what you mean.

zengrits
February 2nd, 2009, 02:44 AM
Thanks Catlett. I lost grub when I installed Windows 7. Your instructions worked perfectly and saved me from having to reinstall Ubuntu with all my personal tweaks.

I was prepared to do more, using the additional steps posted by others, but didn't need them.

Tom_T
February 2nd, 2009, 12:34 PM
Tom_T, please post the full output of:

sudo fdisk -lu
So we can first see exactly what you mean.

I'll post the details tonight (when I'm not at work)
But it only showed the one partition which is FAT32 (XP)

Tom_T
February 2nd, 2009, 07:48 PM
Here are the results from fdisk -lu, I did this when booted from a parted magic USB key.





omitting empty partition (5)

Disk /dev/hda: 100.0 GB, 100030242816 bytes
255 heads, 63 sectors/track, 12161 cylinders, total 195371568 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x10321031

Device Boot Start End Blocks Id System
/dev/hda1 * 63 99795779 49897858+ c W95 FAT32 (LBA)
/dev/hda2 99795780 195366464 47785342+ 5 Extended
/dev/hda3 154304388 195366464 20531038+ 17 Hidden HPFS/NTFS
/dev/hda5 99795906 151958834 26081464+ 83 Linux
/dev/hda6 151958898 154304324 1172713+ 82 Linux swap / Solaris

Disk /dev/sda: 1048 MB, 1048444928 bytes
255 heads, 63 sectors/track, 127 cylinders, total 2047744 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x003cff6a

Device Boot Start End Blocks Id System
/dev/sda1 * 63 2047743 1023840+ c W95 FAT32 (LBA)
Partition 1 has different physical/logical endings:
phys=(126, 254, 63) logical=(127, 118, 55)


Now what ?? :)

caljohnsmith
February 2nd, 2009, 08:08 PM
omitting empty partition (5)

Disk /dev/hda: 100.0 GB, 100030242816 bytes
255 heads, 63 sectors/track, 12161 cylinders, total 195371568 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x10321031

Device Boot Start End Blocks Id System
/dev/hda1 * 63 99795779 49897858+ c W95 FAT32 (LBA)
/dev/hda2 99795780 195366464 47785342+ 5 Extended
/dev/hda3 154304388 195366464 20531038+ 17 Hidden HPFS/NTFS
/dev/hda5 99795906 151958834 26081464+ 83 Linux
/dev/hda6 151958898 154304324 1172713+ 82 Linux swap / Solaris



I don't think I understand, because you said that fdisk previously didn't show any of your partitions except the Windows XP partition, yet they are showing above? Did you maybe mean that gparted won't show the partitions? It looks like the problem is that your partition table is corrupt right now; as shown highlighted in red above, your hda3 partition is inside of your hda2 extended partition, so hda3 should either be a logical partition, or the hda2 extended partition should be shrunk so that it does not contain hda3. Do you have a preference for whether the NTFS hda3 partition is a logical or primary partition? If you don't have a preference, my recommendation would be to make it a primary partition if that partition is Windows. So if you want help fixing your partition table, please post the output of:

sudo sfdisk -d
And let me know if you want hda3 to remain as a primary partition or if you want it as a logical partition. We can work from there.

Tom_T
February 2nd, 2009, 08:15 PM
Hi
Last night when I ran fdisk -lu it came back with one partition !!


And let me know if you want hda3 to remain as a primary partition or if you want it as a logical partition. We can work from there.

What benefit is there to either option ?? All I want is to be able to boot between XP Pro & Ubuntu !!

sudo sfdisk -d output (done via parted magic) :


root@PartedMagic:~# sfdisk -d
# partition table of /dev/hda
unit: sectors

/dev/hda1 : start= 63, size= 99795717, Id= c, bootable
/dev/hda2 : start= 99795780, size= 95570685, Id= 5
/dev/hda3 : start=154304388, size= 41062077, Id=17
/dev/hda4 : start= 0, size= 0, Id= 0
/dev/hda5 : start= 99795906, size= 52162929, Id=83
/dev/hda6 : start=151958898, size= 2345427, Id=82
# partition table of /dev/sda
unit: sectors

/dev/sda1 : start= 63, size= 2047681, Id= c, bootable
/dev/sda2 : start= 0, size= 0, Id= 0
/dev/sda3 : start= 0, size= 0, Id= 0
/dev/sda4 : start= 0, size= 0, Id= 0

Thanks for your help :)

caljohnsmith
February 2nd, 2009, 08:27 PM
Considering the hda3 NTFS partition is just a data partition, there's no advantage to making it a primary partition; I think we should go ahead and just make it a logical partition since it looks like that is what it is meant to be based on the sector start/stop values for the partitions in your partition table. Fortunately your type of partition table problem is not usually hard to correct, so how about downloading the attached "partition_table.txt" file to your Ubuntu desktop, and then do:

sudo sfdisk --no-reread -f /dev/hda -O ~/Desktop/hda_sectors_modified.save < ~/Desktop/partition_table.txt
And please post the output. The above command will create a backup of the few sectors being modified as a small "hda_sectors_modified.save" file on your desktop, so if for some reason anything were to go wrong, we can easily restore your original partition table with that file. Therefore, please copy that file to a different drive, or you could for instance save it to your email account or something like that. Just for convenience, here is the contents of the partition_table.txt file:

# partition table of /dev/hda
unit: sectors

/dev/hda1 : start= 63, size= 99795717, Id= c, bootable
/dev/hda2 : start= 99795780, size= 95570685, Id= 5
/dev/hda3 : start= 0, size= 0, Id= 0
/dev/hda4 : start= 0, size= 0, Id= 0
/dev/hda5 : start= 99795906, size= 52162929, Id=83
/dev/hda6 : start=151958898, size= 2345427, Id=82
/dev/hda7 : start=154304388, size= 41062077, Id= 7
Since your NTFS partition (Id=7) all ready starts 63 sectors after the hda6 swap partition, it is all ready to become a logical partition. Thus to make it a logical partition, all I did was move it in your partition table so it is now hda7 rather than hda3. Once you've run the above sfdisk command and posted the output, next reboot, and please post the new output of:

sudo fdisk -lu
sudo sfdisk -d
sudo parted /dev/hda print
And we can work from there.

Tom_T
February 2nd, 2009, 08:34 PM
sudo sfdisk --no-reread -f /dev/hda -O ~/Desktop/hda_sectors_modified.save < ~/Desktop/partition_table.txt

Resulted in :


Disk /dev/hda: 12161 cylinders, 255 heads, 63 sectors/track
Old situation:
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

Device Boot Start End #cyls #blocks Id System
/dev/hda1 * 0+ 6211 6212- 49897858+ c W95 FAT32 (LBA)
/dev/hda2 6212 12160 5949 47785342+ 5 Extended
start: (c,h,s) expected (1023,254,63) found (1023,0,1)
/dev/hda3 9605+ 12160 2556- 20531038+ 17 Hidden HPFS/NTFS
start: (c,h,s) expected (1023,254,63) found (1023,1,1)
/dev/hda4 0 - 0 0 0 Empty
/dev/hda5 6212+ 9458 3247- 26081464+ 83 Linux
start: (c,h,s) expected (1023,254,63) found (1023,2,1)
/dev/hda6 9459+ 9604 146- 1172713+ 82 Linux swap / Solaris
start: (c,h,s) expected (1023,254,63) found (1023,1,1)
New situation:
Units = sectors of 512 bytes, counting from 0

Device Boot Start End #sectors Id System
/dev/hda1 * 63 99795779 99795717 c W95 FAT32 (LBA)
/dev/hda2 99795780 195366464 95570685 5 Extended
/dev/hda3 0 - 0 0 Empty
/dev/hda4 0 - 0 0 Empty
/dev/hda5 99795906 151958834 52162929 83 Linux
/dev/hda6 151958898 154304324 2345427 82 Linux swap / Solaris
/dev/hda7 154304388 195366464 41062077 7 HPFS/NTFS
Successfully wrote the new partition table

Re-reading the partition table ...

If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)
to zero the first 512 bytes: dd if=/dev/zero of=/dev/foo7 bs=512 count=1
(See fdisk(8).)


Just about to reboot.

Tom_T
February 2nd, 2009, 08:42 PM
sudo fdisk -lu


root@PartedMagic:~# fdisk -lu

Disk /dev/hda: 100.0 GB, 100030242816 bytes
255 heads, 63 sectors/track, 12161 cylinders, total 195371568 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x10321031

Device Boot Start End Blocks Id System
/dev/hda1 * 63 99795779 49897858+ c W95 FAT32 (LBA)
/dev/hda2 99795780 195366464 47785342+ 5 Extended
/dev/hda5 99795906 151958834 26081464+ 83 Linux
/dev/hda6 151958898 154304324 1172713+ 82 Linux swap / Solaris
/dev/hda7 154304388 195366464 20531038+ 7 HPFS/NTFS

Disk /dev/sda: 1048 MB, 1048444928 bytes
255 heads, 63 sectors/track, 127 cylinders, total 2047744 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x003cff6a

Device Boot Start End Blocks Id System
/dev/sda1 * 63 2047743 1023840+ c W95 FAT32 (LBA)
Partition 1 has different physical/logical endings:
phys=(126, 254, 63) logical=(127, 118, 55)


sudo sfdisk -d



root@PartedMagic:~# sfdisk -d
# partition table of /dev/hda
unit: sectors

/dev/hda1 : start= 63, size= 99795717, Id= c, bootable
/dev/hda2 : start= 99795780, size= 95570685, Id= 5
/dev/hda3 : start= 0, size= 0, Id= 0
/dev/hda4 : start= 0, size= 0, Id= 0
/dev/hda5 : start= 99795906, size= 52162929, Id=83
/dev/hda6 : start=151958898, size= 2345427, Id=82
/dev/hda7 : start=154304388, size= 41062077, Id= 7
# partition table of /dev/sda
unit: sectors

/dev/sda1 : start= 63, size= 2047681, Id= c, bootable
/dev/sda2 : start= 0, size= 0, Id= 0
/dev/sda3 : start= 0, size= 0, Id= 0
/dev/sda4 : start= 0, size= 0, Id= 0


sudo parted /dev/hda print


root@PartedMagic:~# parted /dev/hda print
Model: ST9100822A (ide)
Disk /dev/hda: 100GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number Start End Size Type File system Flags
1 32.3kB 51.1GB 51.1GB primary fat32 boot, lba
2 51.1GB 100GB 48.9GB extended
5 51.1GB 77.8GB 26.7GB logical ext3
6 77.8GB 79.0GB 1201MB logical linux-swap
7 79.0GB 100GB 21.0GB logical ntfs


Does that look right ?? Now what :)
Thanks for all your patience and time !

caljohnsmith
February 2nd, 2009, 08:45 PM
That's great, your partition table looks just fine now. :) If you pull up gparted, I think you will see that it shows your partitions OK now. Anyway, if you need to reinstall Grub to that HDD to get it booting again, how about doing:

sudo grub
grub> root (hd0,4)
grub> setup (hd0)
grub> quit
If the above commands complete successfully, how about rebooting and let me know how far you get. We can work from there.

Tom_T
February 2nd, 2009, 08:56 PM
Grub is back :)

Booting into Ubuntu & Windows works again :p
Thank you very much for your help ..

Can you add rep to a member on this forum ??

Just need to sort my Top Task bar out in Ubuntu then I'm sorted on this laptop... Next to try and sort Triple booting my Acer One!!

Thanks again.

caljohnsmith
February 2nd, 2009, 09:21 PM
You're welcome, Tom_T, I'm glad you can boot Windows and Ubuntu OK again. Cheers and enjoy your Ubuntu install. :)

sharks_me
February 12th, 2009, 12:32 PM
hi
I am a newbie and i dont know much about dual booting
i installed win xp on my xps m1330 and then ubuntu
the grub seemed to have managed all the things before i had to reinstall windows for some stupid reasons. Now i cant boot into ubuntu. Please help

ubuntu@ubuntu:~$ sudo fdisk -lu

Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x00000080

Device Boot Start End Blocks Id System
/dev/sda1 63 96389 48163+ de Dell Utility
/dev/sda2 * 96390 52532549 26218080 7 HPFS/NTFS
/dev/sda3 52532550 488392064 217929757+ f W95 Ext'd (LBA)
/dev/sda5 52532613 452984804 200226096 7 HPFS/NTFS
/dev/sda6 452984868 476375444 11695288+ 83 Linux
/dev/sda7 476375508 484183034 3903763+ 82 Linux swap / Solaris
/dev/sda8 484183098 488392064 2104483+ dd Unknown




i had even backed up my grub settings.. how to restore that
i cant boot into ubuntu now :(

von Stalhein
February 13th, 2009, 01:32 PM
Can you post your /boot/grub/menu.lst ?
Perhaps not - they were prolly backed up in Ubuntu :-)

The first time I had what you describe, it was fixed by doing a fixmbr on my hdd.

Start here (http://www.users.bigpond.net.au/hermanzone/p18.htm#MbrFix.exe) and then branch out from that page on that site if it doesn't help.

There are many gurus in this particular forum - if the above doesn't work I'm sure that someone who actually knows what they are talking about will be able to help :)

sharks_me
February 13th, 2009, 07:00 PM
thanx von but the link u gave could be of no help to me .. i can boot into windows but ubuntu is gone .. i can access the ext3 partition of ubuntu when i boot with the help of a live cd .. i guess i had backed up the menu.lst there but now i cant find it :P

unutbu
February 13th, 2009, 08:25 PM
sharks_me, have you tried reinstalling GRUB using Catlett's instructions here: http://ubuntuforums.org/showthread.php?t=224351 ?

If you run into any problems, post the commands you've tried and the output you see.

themusicdan
February 15th, 2009, 06:59 PM
I'm pretty new to linux, and have been exploring it as a hobby. My XP install became unstable last week, though, and when I re-installed XP, I lost the ability to boot into ubuntu, but when I try to follow the instructions to install grub, it gives me the following message:


grub> root (hd0,5)

grub> setup (hd0)
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 (hd0)"... 16 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd0) (hd0)1+16 p (hd0,5)/boot/grub/stage2 /boot/grub
/menu.lst"... failed

Error 12: Invalid device requested

grub>

It appears that my problem is my menu.lst file, so here is the content of that.



default 0
timeout 10

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=ff295998-270d-4885-ab4d-c4fbace77b11 ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=ff295998-270d-4885-ab4d-c4fbace77b11

## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash

## should update-grub lock old automagic boot options
## e.g. lockold=false
## lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

## ## End Default Options ##

title Ubuntu 8.10, kernel 2.6.27-11-generic
kernel /boot/vmlinuz-2.6.27-11-generic root=UUID=ff295998-270d-4885-ab4d-c4fbace77b11 ro quiet splash
initrd /boot/initrd.img-2.6.27-11-generic

title Ubuntu 8.10, kernel 2.6.27-11-generic (recovery mode)
kernel /boot/vmlinuz-2.6.27-11-generic root=UUID=ff295998-270d-4885-ab4d-c4fbace77b11 ro single
initrd /boot/initrd.img-2.6.27-11-generic

title Ubuntu 8.10, memtest86+
kernel /boot/memtest86+.bin

### END DEBIAN AUTOMAGIC KERNELS LIST

title Other operating systems:
root

title Microsoft Windows XP Professional
root (hd0,0)
chainloader +1
savedefault
makeactive

Also, I'm not sure how to edit the menu.lst, because when I try to edit it and save it, it tells me I don't have the permissions required to save it. If it helps, I am including the output of my fdisk.



root@ubuntu:/# sudo fdisk -lu
sudo: unable to resolve host ubuntu
omitting empty partition (5)

Disk /dev/sda: 750.1 GB, 750156374016 bytes
255 heads, 63 sectors/track, 91201 cylinders, total 1465149168 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xff28ff28

Device Boot Start End Blocks Id System
/dev/sda1 * 63 40965749 20482843+ 7 HPFS/NTFS
/dev/sda2 102398310 1465127999 681364845 f W95 Ext'd (LBA)
/dev/sda3 204796683 614389859 204796588+ 7 HPFS/NTFS
/dev/sda5 102398436 165726539 31664052 83 Linux
/dev/sda6 165726603 204796619 19535008+ 82 Linux swap / Solaris
/dev/sda7 614389923 1465127999 425369038+ 7 HPFS/NTFS

Disk /dev/sdb: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xc47fc47f

Device Boot Start End Blocks Id System
/dev/sdb1 63 488392064 244196001 7 HPFS/NTFS
root@ubuntu:/#

I really appreciate anything you can do to help me out here. I can access all of the files on my linux install, but I can't do anything with them, and it's extremely frustrating.

unutbu
February 15th, 2009, 07:11 PM
The output from fdisk shows your Linux partition is on /dev/sda5.


/dev/sda5 102398436 165726539 31664052 83 Linux

In GRUB notation, this is (hd0,4), since GRUB starts counting at 0 rather than 1.

So how about trying


grub> root (hd0,4)
grub> setup (hd0)

You should not need to edit /boot/grub/menu.lst since reinstalling XP should not have altered this file. However, for future reference, if you need to edit a system file owned by root, you can do so by typing


gksu gedit

as this will launch the gedit text editor with root privileges.

themusicdan
February 15th, 2009, 07:25 PM
Thanks for the advice on being able to edit. When I try using (hd0,4) here's what it tells me:


grub> root (hd0,4)

grub> setup (hd0)

Error 17: Cannot mount selected partition

grub>

caljohnsmith
February 15th, 2009, 07:42 PM
root@ubuntu:/# sudo fdisk -lu
sudo: unable to resolve host ubuntu
omitting empty partition (5)

Disk /dev/sda: 750.1 GB, 750156374016 bytes
255 heads, 63 sectors/track, 91201 cylinders, total 1465149168 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xff28ff28

Device Boot Start End Blocks Id System
/dev/sda1 * 63 40965749 20482843+ 7 HPFS/NTFS
/dev/sda2 102398310 1465127999 681364845 f W95 Ext'd (LBA)
/dev/sda3 204796683 614389859 204796588+ 7 HPFS/NTFS
/dev/sda5 102398436 165726539 31664052 83 Linux
/dev/sda6 165726603 204796619 19535008+ 82 Linux swap / Solaris
/dev/sda7 614389923 1465127999 425369038+ 7 HPFS/NTFS

As shown highlighted above, any time you get an "omitting empty partition (X)" error from fdisk, that's unfortunately a sure sign your partition table is corrupt. It looks like the problem is that your sda3 primary partition is inside your sda2 extended partition, so therefore sda3 really should be a logical partition. Grub is extremely sensitive to problems with your partition table, so that's why you are having problems running the Grub commands right now. If you would like some help fixing your partition table, how about posting the output of:

sudo sfdisk -d /dev/sda
And we can work from there if you want.

themusicdan
February 15th, 2009, 07:54 PM
I have two physical drives, one 750 GB and and one 250 GB. The 750 GB drive has one primary partition and one extended partition with 3 logical drives in it. One of those logical drives is my linux drive, and the rest are all ntfs. Here is the output of sfdisk:


ubuntu@ubuntu:~$ sudo sfdisk -d /dev/sda
# partition table of /dev/sda
unit: sectors

/dev/sda1 : start= 63, size= 40965687, Id= 7, bootable
/dev/sda2 : start=102398310, size=1362729690, Id= f
/dev/sda3 : start=204796683, size=409593177, Id= 7
/dev/sda4 : start= 0, size= 0, Id= 0
/dev/sda5 : start=102398436, size= 63328104, Id=83
/dev/sda6 : start=165726603, size= 39070017, Id=82
/dev/sda7 : start=614389923, size=850738077, Id= 7
ubuntu@ubuntu:~$

unutbu
February 15th, 2009, 07:55 PM
Edit: Sorry -- I am too slow.
themusicdan, I'll leave what I've written, but caljohnsmith is much more knowledgable than I am, and I'd recommend listening to what he says first.

I just noticed this:


root@ubuntu:/# sudo fdisk -lu
sudo: unable to resolve host ubuntu
omitting empty partition (5)

I believe when you see "omitting empty partition" it is a sign that the partition table is corrupted. To fix this, boot from the LiveCD, go to System>Admin>Software Sources and make sure the Ubuntu universe repository is enabled. Then install the testdisk package.

To run testdisk, type


sudo testdisk

Then follow caljohnsmith's instructions here: http://ubuntu-virginia.ubuntuforums.org/showpost.php?p=6284607&postcount=3.

Testdisk can repair partition tables.
Currently, fdisk is saying that sda5 is empty. That's not good, since sda5 contained your Linux installation. Testdisk may be able to recover the old partition table, and all the files within it.

After you do the testdisk "Quick Search" or "Deeper Search", use the up/down arrows to move among your partitions. Press 'p' to try to list files inside the sda5 partition. See if you can find a partition with your Linux files inside.

caljohnsmith
February 15th, 2009, 08:07 PM
Themusicdan, how about downloading the attached "partition_table.txt" file to your Ubuntu desktop, and then do:

sudo sfdisk --no-reread -f /dev/sda < ~/Desktop/partition_table.txt
And please post the output. Then reboot your Live CD, and please post the output of all the following commands:

sudo fdisk -lu
sudo parted /dev/sda print
sudo grub
grub> root (hd0,4)
grub> setup (hd0)
grub> quit
And we can work from there.

EDIT: Sorry, just saw your post Unutbu. Testdisk would work, but since all we need to do is change sda3 into a logical partition, I think the above method is quicker and easier; it's up to themusicdan though.

themusicdan
February 15th, 2009, 09:33 PM
Unutbu, I didn't find testdisk in the repository, so I am going to try caljohnsmith's method. Here's the output:


ubuntu@ubuntu:~$ sudo sfdisk --no-reread -f /dev/sda < ~/Desktop/partition_table.txt

Disk /dev/sda: 91201 cylinders, 255 heads, 63 sectors/track
Old situation:
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

Device Boot Start End #cyls #blocks Id System
/dev/sda1 * 0+ 2549 2550- 20482843+ 7 HPFS/NTFS
/dev/sda2 6374 91199 84826 681364845 f W95 Ext'd (LBA)
start: (c,h,s) expected (1023,254,63) found (1023,0,1)
/dev/sda3 12748+ 38243 25496- 204796588+ 7 HPFS/NTFS
start: (c,h,s) expected (1023,254,63) found (1023,1,1)
/dev/sda4 0 - 0 0 0 Empty
/dev/sda5 6374+ 10315 3942- 31664052 83 Linux
start: (c,h,s) expected (1023,254,63) found (1023,2,1)
/dev/sda6 10316+ 12747 2432- 19535008+ 82 Linux swap / Solaris
start: (c,h,s) expected (1023,254,63) found (1023,1,1)
/dev/sda7 38244+ 91199 52956- 425369038+ 7 HPFS/NTFS
start: (c,h,s) expected (1023,254,63) found (1023,1,1)

sfdisk: long or incomplete input line - quitting
ubuntu@ubuntu:~$

caljohnsmith
February 15th, 2009, 09:41 PM
I think I didn't get the spacing exactly right in that last partition_table.txt file that I uploaded, themusicdan; sfdisk is unfortunately very finicky about things like that. I uploaded a new partition_table.txt file to my previous post that I think should work. Please use that and post the output; we can work from there.

themusicdan
February 15th, 2009, 09:52 PM
I tried using the updated file and the output is the same.


ubuntu@ubuntu:~$ sudo sfdisk --no-reread -f /dev/sda < ~/Desktop/partition_table2.txt

Disk /dev/sda: 91201 cylinders, 255 heads, 63 sectors/track
Old situation:
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

Device Boot Start End #cyls #blocks Id System
/dev/sda1 * 0+ 2549 2550- 20482843+ 7 HPFS/NTFS
/dev/sda2 6374 91199 84826 681364845 f W95 Ext'd (LBA)
start: (c,h,s) expected (1023,254,63) found (1023,0,1)
/dev/sda3 12748+ 38243 25496- 204796588+ 7 HPFS/NTFS
start: (c,h,s) expected (1023,254,63) found (1023,1,1)
/dev/sda4 0 - 0 0 0 Empty
/dev/sda5 6374+ 10315 3942- 31664052 83 Linux
start: (c,h,s) expected (1023,254,63) found (1023,2,1)
/dev/sda6 10316+ 12747 2432- 19535008+ 82 Linux swap / Solaris
start: (c,h,s) expected (1023,254,63) found (1023,1,1)
/dev/sda7 38244+ 91199 52956- 425369038+ 7 HPFS/NTFS
start: (c,h,s) expected (1023,254,63) found (1023,1,1)

sfdisk: long or incomplete input line - quitting
ubuntu@ubuntu:~$

caljohnsmith
February 15th, 2009, 10:01 PM
Themusicdan, would you please repost the output of the "sudo -d /dev/sda" command, but this time do not put it in quotes? If you don't use the "quick reply" box, but instead hit the "reply" button in the lower left corner of the thread, in that message box there should be a pound/hash sign "#" graphic near the quote button to put "code" tags around the result (it's right next to the quote button graphic). Please try that, because I think I must be getting the spacing messed up with the partition_table.txt file.

themusicdan
February 15th, 2009, 10:04 PM
Sorry about that. Here is the output. Thanks for the tip.


ubuntu@ubuntu:~$ sudo sfdisk -d /dev/sda
# partition table of /dev/sda
unit: sectors

/dev/sda1 : start= 63, size= 40965687, Id= 7, bootable
/dev/sda2 : start=102398310, size=1362729690, Id= f
/dev/sda3 : start=204796683, size=409593177, Id= 7
/dev/sda4 : start= 0, size= 0, Id= 0
/dev/sda5 : start=102398436, size= 63328104, Id=83
/dev/sda6 : start=165726603, size= 39070017, Id=82
/dev/sda7 : start=614389923, size=850738077, Id= 7
ubuntu@ubuntu:~$

themusicdan
February 15th, 2009, 10:08 PM
I edited the partition_table.txt, and tried again using the output I just posted. I attached the partition_table3.txt that I made, and here is the new output:


ubuntu@ubuntu:~$ sudo sfdisk --no-reread -f /dev/sda < ~/Desktop/partition_table3.txt

Disk /dev/sda: 91201 cylinders, 255 heads, 63 sectors/track
Old situation:
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

Device Boot Start End #cyls #blocks Id System
/dev/sda1 * 0+ 2549 2550- 20482843+ 7 HPFS/NTFS
/dev/sda2 6374 91199 84826 681364845 f W95 Ext'd (LBA)
start: (c,h,s) expected (1023,254,63) found (1023,0,1)
/dev/sda3 12748+ 38243 25496- 204796588+ 7 HPFS/NTFS
start: (c,h,s) expected (1023,254,63) found (1023,1,1)
/dev/sda4 0 - 0 0 0 Empty
/dev/sda5 6374+ 10315 3942- 31664052 83 Linux
start: (c,h,s) expected (1023,254,63) found (1023,2,1)
/dev/sda6 10316+ 12747 2432- 19535008+ 82 Linux swap / Solaris
start: (c,h,s) expected (1023,254,63) found (1023,1,1)
/dev/sda7 38244+ 91199 52956- 425369038+ 7 HPFS/NTFS
start: (c,h,s) expected (1023,254,63) found (1023,1,1)
Warning: given size (850738077) exceeds max allowable size (0)
cannot build surrounding extended partition

sfdisk: bad input

caljohnsmith
February 15th, 2009, 10:12 PM
OK, I think I got it this time, so please download the attached partition_table.txt and give it a try.

themusicdan
February 15th, 2009, 10:15 PM
Well, it gave me an error again. Here it is:


ubuntu@ubuntu:~$ sudo sfdisk --no-reread -f /dev/sda < ~/Desktop/partition_table4.txt

Disk /dev/sda: 91201 cylinders, 255 heads, 63 sectors/track
Old situation:
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

Device Boot Start End #cyls #blocks Id System
/dev/sda1 * 0+ 2549 2550- 20482843+ 7 HPFS/NTFS
/dev/sda2 6374 91199 84826 681364845 f W95 Ext'd (LBA)
start: (c,h,s) expected (1023,254,63) found (1023,0,1)
/dev/sda3 12748+ 38243 25496- 204796588+ 7 HPFS/NTFS
start: (c,h,s) expected (1023,254,63) found (1023,1,1)
/dev/sda4 0 - 0 0 0 Empty
/dev/sda5 6374+ 10315 3942- 31664052 83 Linux
start: (c,h,s) expected (1023,254,63) found (1023,2,1)
/dev/sda6 10316+ 12747 2432- 19535008+ 82 Linux swap / Solaris
start: (c,h,s) expected (1023,254,63) found (1023,1,1)
/dev/sda7 38244+ 91199 52956- 425369038+ 7 HPFS/NTFS
start: (c,h,s) expected (1023,254,63) found (1023,1,1)

sfdisk: long or incomplete input line - quitting
ubuntu@ubuntu:~$

caljohnsmith
February 15th, 2009, 10:33 PM
EDIT: Please see meierfra's post below and try that partition table.

meierfra.
February 15th, 2009, 10:33 PM
The last attachment from caljohnsmith was missing a "end of line" character. I attached a new version.

caljohnsmith
February 15th, 2009, 10:39 PM
The last attachment from caljohnsmith was missing a "end of line" character. I attached a new version.
Thanks meierfra, I'm not on my Ubuntu computer right now, so I'm stuck in Windows on this particular computer. It sure makes it more difficult to make a text file with Unix-style line endings (and to make sure all lines have a Unix-style ending), but I think I'm getting it now.

themusicdan
February 15th, 2009, 11:32 PM
Here is the new output of the sfdisk.


ubuntu@ubuntu:~$ sudo sfdisk --no-reread -f /dev/sda < ~/Desktop/partition_table5.txt

Disk /dev/sda: 91201 cylinders, 255 heads, 63 sectors/track
Old situation:
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

Device Boot Start End #cyls #blocks Id System
/dev/sda1 * 0+ 2549 2550- 20482843+ 7 HPFS/NTFS
/dev/sda2 6374 91199 84826 681364845 f W95 Ext'd (LBA)
/dev/sda3 0 - 0 0 0 Empty
/dev/sda4 0 - 0 0 0 Empty
/dev/sda5 6374+ 10315 3942- 31664052 83 Linux
/dev/sda6 10316+ 12747 2432- 19535008+ 82 Linux swap / Solaris
/dev/sda7 12748+ 38243 25496- 204796588+ 7 HPFS/NTFS
/dev/sda8 38244+ 91199 52956- 425369038+ 7 HPFS/NTFS
New situation:
Units = sectors of 512 bytes, counting from 0

Device Boot Start End #sectors Id System
/dev/sda1 * 63 40965749 40965687 7 HPFS/NTFS
/dev/sda2 102398310 1465127999 1362729690 f W95 Ext'd (LBA)
/dev/sda3 0 - 0 0 Empty
/dev/sda4 0 - 0 0 Empty
/dev/sda5 102398436 165726539 63328104 83 Linux
/dev/sda6 165726603 204796619 39070017 82 Linux swap / Solaris
/dev/sda7 204796683 614389859 409593177 7 HPFS/NTFS
/dev/sda8 614389923 1465127999 850738077 7 HPFS/NTFS
Successfully wrote the new partition table

Re-reading the partition table ...
BLKRRPART: Device or resource busy

If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)
to zero the first 512 bytes: dd if=/dev/zero of=/dev/foo7 bs=512 count=1
(See fdisk(8).)
ubuntu@ubuntu:~$

caljohnsmith
February 15th, 2009, 11:35 PM
Looks good, themusicdan, so how about running the Grub commands again and post the output:

sudo grub
grub> root (hd0,4)
grub> setup (hd0)
grub> quit
If they complete successfully, try rebooting your computer and let us know how far you get.

themusicdan
February 15th, 2009, 11:51 PM
It worked! I have my kubuntu back! Yippee! Thank you sooo much. This was my first attempt at asking for help on the forums, and you have made my experience wonderful. Thanks so much!

caljohnsmith
February 15th, 2009, 11:59 PM
That's great, glad it worked OK. We can thank meierfra for getting the partition table file to work. Cheers and enjoy your Kubuntu install.

von Stalhein
February 16th, 2009, 09:37 AM
I've made a boo-boo again:rolleyes:

I can't start XP from GRUB, it just sits at the "Starting up" prompt.

I've made no changes to hardware.
XP is on /dev/sdc1

sudo fdisk -lu

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xf66fc667

Device Boot Start End Blocks Id System
/dev/sda1 * 63 300415499 150207718+ 83 Linux
/dev/sda2 300415500 312576704 6080602+ f W95 Ext'd (LBA)
/dev/sda5 300415563 312576704 6080571 82 Linux swap / Solaris

Disk /dev/sdb: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xa3f79c20

Device Boot Start End Blocks Id System
/dev/sdb1 16065 234436544 117210240 f W95 Ext'd (LBA)
/dev/sdb5 16128 234436544 117210208+ 7 HPFS/NTFS

Disk /dev/sdc: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x960c960c

Device Boot Start End Blocks Id System
/dev/sdc1 * 63 234436544 117218241 7 HPFS/NTFS



menu.lst

splashimage=(hd0,0)/boot/grub/splash.xpm.gz
default 6
timeout 25

title Ubuntu 8.10, kernel 2.6.27-11-generic
root (hd0,0)
kernel /boot/vmlinuz-2.6.27-11-generic root=UUID=756b6798-621b-4d0c-a622-d079cd159cf0 ro quiet splash vga=771
initrd /boot/initrd.img-2.6.27-11-generic
quiet

title Ubuntu 8.10, kernel 2.6.27-11-generic (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.27-11-generic root=UUID=756b6798-621b-4d0c-a622-d079cd159cf0 ro single
initrd /boot/initrd.img-2.6.27-11-generic

title Ubuntu 8.10, kernel 2.6.27-10-generic
root (hd0,0)
kernel /boot/vmlinuz-2.6.27-10-generic root=UUID=756b6798-621b-4d0c-a622-d079cd159cf0 ro quiet splash vga=771
initrd /boot/initrd.img-2.6.27-10-generic
quiet

title Ubuntu 8.10, kernel 2.6.27-10-generic (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.27-10-generic root=UUID=756b6798-621b-4d0c-a622-d079cd159cf0 ro single
initrd /boot/initrd.img-2.6.27-10-generic

title Ubuntu 8.10, memtest86+
root (hd0,0)
kernel /boot/memtest86+.bin
quiet

title Systems for teh n00bs!!!:-
root

title Microsoft Windows XP Home Edition
rootnoverify (hd2,0)
chainloader +1
savedefault
makeactive


find /boot/grub/stage1 or find /boot/grub/stage2 reports (hd0,0)

I've done a fixmbr, re-installed GRUB as per earlier posts, and tried the remedy that worked when I tried to update to GRUB2.

Any help appreciated.

caljohnsmith
February 16th, 2009, 02:44 PM
Von Stalhein, how about trying this Windows entry instead:

title Microsoft Windows XP Home Edition
rootnoverify (hd2,0)
map (hd2) (hd0)
map (hd0) (hd2)
chainloader +1
savedefault
makeactive
Let us know what happens when you try that from the Grub menu on start up.

von Stalhein
February 17th, 2009, 10:22 AM
Thanks caljohnsmith that's done the job.

It seems to sit at the prompt for a bit longer than it used to, but it goes!!!

:redface: Thanks again!!

neelesh_jn
February 17th, 2009, 01:46 PM
hi...
i installed suse 11.1. i already had ubuntu8.10 installed..and i gave suse a separate partition...but now when i try to log in to my ubuntu it gives me a message--"filesystem type unknown, partition type 0x8e configfile /boot/grub/menu.1st
error 17:cannot mount selected partition"

please help ,,, i have my important data in there and i really want them..
thankyou...

caljohnsmith
February 17th, 2009, 01:55 PM
Neelesh_jn, it sounds like you probably just need to correct your Grub's menu.lst. How about trying this first when you get the Grub menu on start up: select the Ubuntu entry you want to boot, press "e" to edit it, select the line that says "root (hdX,Y)" where X and Y are numbers, press "e" to edit it, and try changing the "Y" number to something else (like changing it just by +/-1 to start with), press return to save the change, then press "b" to boot. Based on the info you gave, that might be all it takes to boot Ubuntu. Note that the change is not permanent, so you'll need to modify your menu.lst to make it permanent. If that doesn't work, then how about downloading the Boot Info Script to your desktop (can be OpenSUSE or a Live CD):

https://sourceforge.net/projects/bootinfoscript/

Then open a terminal (Applications > Accessories > Terminal) and do:

sudo bash ~/Desktop/boot_info_script*.sh
That will create a "RESULTS.txt" file in the same directory from where the script is run, namely your desktop; please copy/paste the contents of the RESULTS.txt file to your next post, highlight the copied text, and click the pound/hash sign "#" graphic button in the Ubuntu forum message box so that the text will get "code" tags put around it. The results of that script will help clarify your setup and hopefully what the solution to your booting problem might be.

So if it works, when you get into Ubuntu, just do:

gksudo gedit /boot/grub/menu.lst
And change the line that says "# groot=(hdX,Y)" to use the (hd0,Y) that worked to boot Ubuntu. Save, quit gedit, then run:

sudo update-grub
And you should be all set. Let me know how it goes or if you run into problems.


Thanks caljohnsmith that's done the job.

It seems to sit at the prompt for a bit longer than it used to, but it goes!!!

Thanks again!!
You're welcome, glad it turned out to be a simple fix. Cheers and enjoy Ubuntu and Windows. :)

ftpaddict
February 17th, 2009, 11:25 PM
Hey, everybody. Monumental n00b here, and I'm having some issues with my "installation".
I don't know if this has been covered before; I've searched the forums but came up empty-handed. Here goes...

I've followed the instructions posted on the first page of this thread, but something went wrong at one point. Here is the output of my Terminal:



grub> find /boot/grub/stage1
(hd0,5)

grub> root (hd0,5)

grub> setup (hd0)
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 (hd0)"... 16 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd0) (hd0)1+16 p (hd0,5)/boot/grub/stage2
/boot/grub/menu.lst"... failed

Error 12: Invalid device requested
I've reinstalled XP (cause of Grub going kaput). Got 2 NTFS partitions and two other for Ubuntu 8.10 + swap.

If you need to know more, just ask. But please, remember: baby steps. I know very little about Bash.

Thank you in advance!

caljohnsmith
February 17th, 2009, 11:31 PM
Ftpaddict, your name reminds me of the days when I used to use "anonymous" ftp in college all the time to get the latest and greatest free software. Do you still use ftp a lot, or why did you choose that name? But anyway, sorry for the digression, about your problem: how about from your Ubuntu Live CD (the Ubuntu install CD), download the Boot Info Script to the Live CD desktop:

https://sourceforge.net/projects/bootinfoscript/

Then open a terminal (Applications > Accessories > Terminal) and do:

sudo bash ~/Desktop/boot_info_script*.sh
That will create a "RESULTS.txt" file in the same directory from where the script is run, namely your desktop; please copy/paste the contents of the RESULTS.txt file to your next post, highlight the copied text, and click the pound/hash sign "#" graphic button in the Ubuntu forum message box so that the text will get "code" tags put around it. The results of that script will help clarify your setup and hopefully what the solution to your booting problem might be. (If you have any trouble finding the code-tag button, make sure when you reply to the thread you click the "reply" button in the lower left corner of the thread, rather than use the "quick reply" box at the bottom of the thread).

ftpaddict
February 17th, 2009, 11:47 PM
Ftpaddict, your name reminds me of the days when I used to use "anonymous" ftp in college all the time to get the latest and greatest free software. Do you still use ftp a lot, or why did you choose that name?

Thank you for the speedy reply!

I was 15 when I chose that nickname, and yes I used to use ftp a lot. The name just stuck, and here I am today. Do a search for my nickname and you'll find me all over the internet. In retrospect, I'm not sure using the same nickname everywhere was the smartest idea... :-|

Anyway, onto my problem:


============================= Boot Info Summary: ==============================

=> Windows is installed in the MBR of /dev/sda

sda1: __________________________________________________ _______________________

File system: ntfs
Boot sector type: Windows XP
Boot sector info: No errors found in the Boot Parameter Block.
Operating System: Windows XP
Boot files/dirs: /boot.ini /ntldr /NTDETECT.COM

sda2: __________________________________________________ _______________________

File system: Extended Partition
Boot sector type: -
Boot sector info:

sda5: __________________________________________________ _______________________

File system: ext3
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 8.10
Boot files/dirs: /boot/grub/menu.lst /etc/fstab

sda6: __________________________________________________ _______________________

File system: swap
Boot sector type: -
Boot sector info:

sda3: __________________________________________________ _______________________

File system: vfat
Boot sector type: MSWIN4.1: Fat 32
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files/dirs:

=========================== Drive/Partition Info: =============================

Drive sda: __________________________________________________ ___________________

Disk /dev/sda: 203.9 GB, 203928109056 bytes
255 heads, 63 sectors/track, 24792 cylinders, total 398297088 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x1ebc1ebb

Partition Boot Start End Size Id System

/dev/sda1 * 63 183,542,624 183,542,562 7 HPFS/NTFS
/dev/sda2 183,542,625 398,283,479 214,740,855 f W95 Ext d (LBA)
/dev/sda5 183,542,751 203,800,589 20,257,839 83 Linux
/dev/sda6 203,800,653 204,796,619 995,967 82 Linux swap / Solaris
/dev/sda3 204,796,683 398,283,479 193,486,797 b W95 FAT32

/dev/sda2 overlaps with /dev/sda3

blkid -c /dev/null: __________________________________________________ __________

/dev/sda1: UUID="9CAC736DAC7340B6" TYPE="ntfs"
/dev/sda3: LABEL="DEE" UUID="47E0-5701" TYPE="vfat"
/dev/sda5: UUID="7f7bce90-a141-48d9-a8d4-b29e8f79f476" TYPE="ext3"
/dev/sda6: TYPE="swap" UUID="2e113968-97a8-44a9-b592-ade42351d689"
/dev/loop0: TYPE="squashfs"

=============================== "mount" output: ===============================

/proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
tmpfs on /lib/modules/2.6.27-7-generic/volatile type tmpfs (rw,mode=0755)
tmpfs on /lib/modules/2.6.27-7-generic/volatile type tmpfs (rw,mode=0755)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
varrun on /var/run type tmpfs (rw,nosuid,mode=0755)
varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
rootfs on / type rootfs (rw)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
/dev/scd0 on /cdrom type iso9660 (ro,noatime)
/dev/loop0 on /rofs type squashfs (ro,noatime)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
gvfs-fuse-daemon on /home/ubuntu/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=ubuntu)
/dev/sda5 on /media/disk type ext3 (rw,nosuid,nodev,uhelper=hal)


================================ sda1/boot.ini: ================================

[boot loader]
timeout=3
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOW S
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /noexecute=optin /fastdetect /usepmtimer /noguiboot

=========================== sda5/boot/grub/menu.lst: ===========================

# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not use 'savedefault' or your
# array will desync and will not let you boot your system.
default 0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 10

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu

# Pretty colours
#color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=7f7bce90-a141-48d9-a8d4-b29e8f79f476 ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=7f7bce90-a141-48d9-a8d4-b29e8f79f476

## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash

## should update-grub lock old automagic boot options
## e.g. lockold=false
## lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

## ## End Default Options ##

title Ubuntu 8.10, kernel 2.6.27-11-generic
uuid 7f7bce90-a141-48d9-a8d4-b29e8f79f476
kernel /boot/vmlinuz-2.6.27-11-generic root=UUID=7f7bce90-a141-48d9-a8d4-b29e8f79f476 ro quiet splash
initrd /boot/initrd.img-2.6.27-11-generic
quiet

title Ubuntu 8.10, kernel 2.6.27-11-generic (recovery mode)
uuid 7f7bce90-a141-48d9-a8d4-b29e8f79f476
kernel /boot/vmlinuz-2.6.27-11-generic root=UUID=7f7bce90-a141-48d9-a8d4-b29e8f79f476 ro single
initrd /boot/initrd.img-2.6.27-11-generic

title Ubuntu 8.10, kernel 2.6.27-9-generic
uuid 7f7bce90-a141-48d9-a8d4-b29e8f79f476
kernel /boot/vmlinuz-2.6.27-9-generic root=UUID=7f7bce90-a141-48d9-a8d4-b29e8f79f476 ro quiet splash
initrd /boot/initrd.img-2.6.27-9-generic
quiet

title Ubuntu 8.10, kernel 2.6.27-9-generic (recovery mode)
uuid 7f7bce90-a141-48d9-a8d4-b29e8f79f476
kernel /boot/vmlinuz-2.6.27-9-generic root=UUID=7f7bce90-a141-48d9-a8d4-b29e8f79f476 ro single
initrd /boot/initrd.img-2.6.27-9-generic

title Ubuntu 8.10, kernel 2.6.27-7-generic
uuid 7f7bce90-a141-48d9-a8d4-b29e8f79f476
kernel /boot/vmlinuz-2.6.27-7-generic root=UUID=7f7bce90-a141-48d9-a8d4-b29e8f79f476 ro quiet splash
initrd /boot/initrd.img-2.6.27-7-generic
quiet

title Ubuntu 8.10, kernel 2.6.27-7-generic (recovery mode)
uuid 7f7bce90-a141-48d9-a8d4-b29e8f79f476
kernel /boot/vmlinuz-2.6.27-7-generic root=UUID=7f7bce90-a141-48d9-a8d4-b29e8f79f476 ro single
initrd /boot/initrd.img-2.6.27-7-generic

title Ubuntu 8.10, memtest86+
uuid 7f7bce90-a141-48d9-a8d4-b29e8f79f476
kernel /boot/memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title Other operating systems:
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title Windows NT/2000/XP (loader)
root (hd0,0)
savedefault
makeactive
chainloader +1


=============================== sda5/etc/fstab: ===============================

# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/sda6
UUID=7f7bce90-a141-48d9-a8d4-b29e8f79f476 / ext3 relatime,errors=remount-ro 0 1
# /dev/sda7
UUID=2e113968-97a8-44a9-b592-ade42351d689 none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0

=================== sda5: Location of files loaded by Grub: ===================


97.5GB: boot/grub/menu.lst
97.4GB: boot/grub/stage2
97.3GB: boot/initrd.img-2.6.27-11-generic
97.4GB: boot/initrd.img-2.6.27-7-generic
97.4GB: boot/initrd.img-2.6.27-9-generic
97.4GB: boot/vmlinuz-2.6.27-11-generic
97.4GB: boot/vmlinuz-2.6.27-7-generic
97.4GB: boot/vmlinuz-2.6.27-9-generic
97.3GB: initrd.img
97.4GB: initrd.img.old
97.4GB: vmlinuz
97.4GB: vmlinuz.old

caljohnsmith
February 18th, 2009, 12:14 AM
Disk /dev/sda: 203.9 GB, 203928109056 bytes
255 heads, 63 sectors/track, 24792 cylinders, total 398297088 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x1ebc1ebb

Partition Boot Start End Size Id System

/dev/sda1 * 63 183,542,624 183,542,562 7 HPFS/NTFS
/dev/sda2 183,542,625 398,283,479 214,740,855 f W95 Ext d (LBA)
/dev/sda5 183,542,751 203,800,589 20,257,839 83 Linux
/dev/sda6 203,800,653 204,796,619 995,967 82 Linux swap / Solaris
/dev/sda3 204,796,683 398,283,479 193,486,797 b W95 FAT32

/dev/sda2 overlaps with /dev/sda3


As I've highlighted in red, the problem is that your HDD's partition table is unfortunately corrupt; your sda3 primary partition is inside of your sda2 extended partition, so sda3 should either be a logical partition, or your sda2 extended partition should be shrunk so that it doesn't include sda3 inside of itself. I think I would recommend making the sda3 a logical partition, because it looks like it was originally intended to be a logical partition based on the starting sector point. So if that sounds good to you, how about downloading the attached "partition_table.txt" file to your Ubuntu desktop, and then do:

sudo sfdisk --no-reread -f /dev/sda < ~/Desktop/partition_table.txt
And please post the output. Next reboot your Live CD, and please post the output of all the following commands:

sudo fdisk -lu
sudo parted /dev/sda print
sudo grub
grub> root (hd0,4)
grub> setup (hd0)
grub> quit
And we can work from there.

ftpaddict
February 18th, 2009, 12:29 AM
Here's hoping I don't lose any data...

ftpaddict
February 18th, 2009, 12:40 AM
Output from the first step:


Disk /dev/sda: 24792 cylinders, 255 heads, 63 sectors/track
Old situation:
Units = cylinders of 8225280 bytes, blocks of 1024 bytes, counting from 0

Device Boot Start End #cyls #blocks Id System
/dev/sda1 * 0+ 11424 11425- 91771281 7 HPFS/NTFS
/dev/sda2 11425 24791 13367 107370427+ f W95 Ext'd (LBA)
/dev/sda3 0 - 0 0 0 Empty
/dev/sda4 0 - 0 0 0 Empty
/dev/sda5 11425+ 12685 1261- 10128919+ 83 Linux
/dev/sda6 12686+ 12747 62- 497983+ 82 Linux swap / Solaris
/dev/sda7 12748+ 24791 12044- 96743398+ b W95 FAT32
New situation:
Units = sectors of 512 bytes, counting from 0

Device Boot Start End #sectors Id System
/dev/sda1 * 63 183542624 183542562 7 HPFS/NTFS
/dev/sda2 183542625 398283479 214740855 f W95 Ext'd (LBA)
/dev/sda3 0 - 0 0 Empty
/dev/sda4 0 - 0 0 Empty
/dev/sda5 183542751 203800589 20257839 83 Linux
/dev/sda6 203800653 204796619 995967 82 Linux swap / Solaris
/dev/sda7 204796683 398283479 193486797 b W95 FAT32
Successfully wrote the new partition table

Re-reading the partition table ...
BLKRRPART: Device or resource busy

If you created or changed a DOS partition, /dev/foo7, say, then use dd(1)
to zero the first 512 bytes: dd if=/dev/zero of=/dev/foo7 bs=512 count=1
(See fdisk(8).)

Device or resource busy? I have not mounted anything. I will await further instructions before proceeding with step #2.

caljohnsmith
February 18th, 2009, 12:42 AM
It's OK, ftpaddict, the partition table change looks like it went just fine. How about rebooting and post the output of all the commands from the second part of my previous post. :)

ftpaddict
February 18th, 2009, 12:56 AM
ubuntu@ubuntu:~$ sudo fdisk -lu

Disk /dev/sda: 203.9 GB, 203928109056 bytes
255 heads, 63 sectors/track, 24792 cylinders, total 398297088 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x1ebc1ebb

Device Boot Start End Blocks Id System
/dev/sda1 * 63 183542624 91771281 7 HPFS/NTFS
/dev/sda2 183542625 398283479 107370427+ f W95 Ext'd (LBA)
/dev/sda5 183542751 203800589 10128919+ 83 Linux
/dev/sda6 203800653 204796619 497983+ 82 Linux swap / Solaris
/dev/sda7 204796683 398283479 96743398+ b W95 FAT32

ubuntu@ubuntu:~$ sudo parted /dev/sda print
Model: ATA Maxtor 6V200E0 (scsi)
Disk /dev/sda: 204GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos

Number Start End Size Type File system Flags
1 32.3kB 94.0GB 94.0GB primary ntfs boot
2 94.0GB 204GB 110GB extended lba
5 94.0GB 104GB 10.4GB logical ext3
6 104GB 105GB 510MB logical linux-swap
7 105GB 204GB 99.1GB logical fat32
grub> root (hd0,4)

Error 21: Selected disk does not exist
I stopped here. I suppose that wasn't part of the expected output. (?) (I feel stupid)

caljohnsmith
February 18th, 2009, 01:00 AM
OK, first just to check, but did you make sure you rebooted the Live CD? If so, did you run the Grub command as root, i.e. with "sudo grub"? If so, how about also posting:

sudo grub
grub> geometry (hd0)
grub> quit

wsonar
February 18th, 2009, 01:12 AM
How do I get from the live cd to my linux partition

everything was find I booted top a gpart cd to stretch out my windows c: partion

when I got to gpart it didn't recognize and filesystem types just showed one big unallocated partition

I can see my partitions are still there with fdisk -l

need to get grub to recognize them tried to fix grub but it can only see the filesystem from the live cd and my windows partition but not my linux partion

caljohnsmith
February 18th, 2009, 01:13 AM
Wsonar, how about posting the output of:

sudo fdisk -lu
sudo sfdisk -d

ftpaddict
February 18th, 2009, 01:14 AM
OK, first just to check, but did you make sure you rebooted the Live CD? If so, did you run the Grub command as root, i.e. with "sudo grub"? If so, how about also posting:

sudo grub
grub> geometry (hd0)
grub> quit



It seems my first reply didn't go through, but I got it working. Probably my fault. Rebooted and lo and behold, Grub works! I hope that was the last step because it's 2 AM and I'm really sleepy. :redface:

Thank you for all the help! I'll buy you a beer next time you're in Romania http://smilies.vidahost.com/contrib/drowned/dork.gif


Dan

caljohnsmith
February 18th, 2009, 01:16 AM
Glad to hear that worked OK, ftpaddict; cheers and enjoy your dual-boot Ubuntu and Windows setup.

ftpaddict
February 18th, 2009, 01:18 AM
Glad to hear that worked OK, ftpaddict; cheers and enjoy your dual-boot Ubuntu and Windows setup.

Actually toying with the idea of giving up on XP completely. Thanks again for all the help. I'll do my best to be more active on these forums and learn as much as I can. Some day, maybe, I'll be able to help others.

wsonar
February 18th, 2009, 01:20 AM
ubuntu@ubuntu:~$ sudo fdisk -lu
omitting empty partition (5)

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders, total 156301488 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x41ab2316

Device Boot Start End Blocks Id System
/dev/sda1 * 63 78879149 39439543+ 7 HPFS/NTFS
/dev/sda2 137966220 156296384 9165082+ 5 Extended
/dev/sda5 ? 2030731983 4087084725 1028176371+ e3 DOS R/O
/dev/sda6 152264133 153019124 377496 82 Linux swap / Solaris
/dev/sda7 153019188 156296384 1638598+ 82 Linux swap / Solaris

Partition table entries are not in disk order
ubuntu@ubuntu:~$ sudo sfdisk -d
# partition table of /dev/sda
unit: sectors

/dev/sda1 : start= 63, size= 78879087, Id= 7, bootable
/dev/sda2 : start=137966220, size= 18330165, Id= 5
/dev/sda3 : start= 0, size= 0, Id= 0
/dev/sda4 : start= 0, size= 0, Id= 0
/dev/sda5 : start=2030731983, size=2056352743, Id=e3
/dev/sda6 : start=152264133, size= 754992, Id=82
/dev/sda7 : start=153019188, size= 3277197, Id=82

caljohnsmith
February 18th, 2009, 01:26 AM
ubuntu@ubuntu:~$ sudo fdisk -lu
omitting empty partition (5)

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders, total 156301488 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x41ab2316

Device Boot Start End Blocks Id System
/dev/sda1 * 63 78879149 39439543+ 7 HPFS/NTFS
/dev/sda2 137966220 156296384 9165082+ 5 Extended
/dev/sda5 ? 2030731983 4087084725 1028176371+ e3 DOS R/O
/dev/sda6 152264133 153019124 377496 82 Linux swap / Solaris
/dev/sda7 153019188 156296384 1638598+ 82 Linux swap / Solaris

Wsonar, just like ftpaddict, your partition table is also corrupt. The start/stop sectors for the sda5 partition completely exceed the total number of sectors of the drive. Obviously that must be a bogus partition. But that also means you are missing your linux partition, so I would recommend using testdisk to recover your correct partitions. To use testdisk, how about downloading the testdisk-6.10.linux26.tar.bz2 (http://www.cgsecurity.org/testdisk-6.10.linux26.tar.bz2) package to your desktop, and then do:


cd ~/Desktop
tar xvf testdisk-6.10.linux26.tar.bz2
sudo testdisk-6.10/linux/testdisk_static
After starting testdisk with the above command, choose "No Log", select HDD and "Proceed", "Intel", "Analyze", "Quick search", Y/N depending on if you have any Vista partitions, hit enter to continue, select "Deeper Search" so it does a deeper search, which could take a while. Please post the output of the screen that has the deep search results. Also, use your up/down arrow keys to select each partition listed in the deep search results, and press "p" to get a directory listing; please let me know exactly which partitions give you a directory listing, and we can work from there.

wsonar
February 18th, 2009, 01:53 AM
TestDisk 6.10, Data Recovery Utility, July 2008
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org

Disk /dev/sda - 80 GB / 74 GiB - CHS 9729 255 63
Partition Start End Size in sectors
D HPFS - NTFS 0 1 1 4909 254 63 78879087
D HPFS - NTFS 0 1 1 9728 254 63 156296322
D HPFS - NTFS 0 1 15 4909 254 63 78879073
D HPFS - NTFS 4910 0 1 8587 254 63 59087070 [stuff]
D HPFS - NTFS 4910 0 1 9524 254 63 74139975 [stuff]
D HPFS - NTFS 4910 0 14 8587 254 63 59087057
D Linux 8588 2 1 9477 254 63 14297724
D Linux Swap 9478 1 1 9524 254 63 754992
D Linux Swap 9525 1 1 9728 254 63 3277197
D Linux Swap 9556 1 1 9728 254 63 2779182

wsonar
February 18th, 2009, 01:56 AM
the third and 6th one say cannot open

caljohnsmith
February 18th, 2009, 02:08 AM
TestDisk 6.10, Data Recovery Utility, July 2008
Christophe GRENIER <grenier@cgsecurity.org>
http://www.cgsecurity.org

Disk /dev/sda - 80 GB / 74 GiB - CHS 9729 255 63
Partition Start End Size in sectors
* HPFS - NTFS 0 1 1 4909 254 63 78879087
D HPFS - NTFS 0 1 1 9728 254 63 156296322
D HPFS - NTFS 0 1 15 4909 254 63 78879073
P HPFS - NTFS 4910 0 1 8587 254 63 59087070 [stuff]
D HPFS - NTFS 4910 0 1 9524 254 63 74139975 [stuff]
D HPFS - NTFS 4910 0 14 8587 254 63
L Linux 8588 2 1 9477 254 63 14297724
L Linux Swap 9478 1 1 9524 254 63 754992
D Linux Swap 9525 1 1 9728 254 63 3277197
D Linux Swap 9556 1 1 9728 254 63 2779182
OK, first use your up/down arrow keys to select each partition, and then use your right/left arrow keys to mark each partition as I've shown above highlighted in red. Once you are sure each partition is marked exactly as shown above, press enter to proceed, then "Write" to write the new partition table. Then reboot, and please post the new output of:

sudo fdisk -lu
sudo parted /dev/sda print
sudo grub
grub> root (hd0,4)
grub> setup (hd0)
grub> quit
And we can work from there.

sharks_me
February 18th, 2009, 08:59 AM
it worked /... thanx a lot guys
happy ubuntuing

wsonar
February 22nd, 2009, 03:43 AM
I appreciate all the help I got the grub menu up and can boot to windows xp now but when trying to boot to linux says cannot mount selected partition


Thanks

wsonar
February 22nd, 2009, 05:12 AM
got it fixed

the root was set to (hd0,5) so after editing it to (hd0,4) then was able to boot to it.

Thanks again:D

Dbzdude707
February 24th, 2009, 01:30 AM
Um, if I got this, is this really bad?


grub> find /boot/grub/stage1

Error 15: File not found

...Cause that's what I got... I'm booting from the live cd right now because my computer got a blue screen in windows (dual booting vista and ubuntu) and now GRUB won't work.

For more info: http://ubuntuforums.org/showthread.php?t=1078837

wsonar
February 25th, 2009, 12:37 AM
I now boot directly to grub Setup

and also get this

grub> find /boot/grub/stage1

Error 15: File not found

here's kinda an update on the scenario the drive I had was going bad dell sent me a new one just got it today fresh install XP, then vista, then Ubuntu 8.10 tested booting to all all was good, took updates, then wanted to install the gfxboot so I could have a cool themed OS switcher thats when I ran into trouble followed directions in this thread

http://ubuntuforums.org/showthread.php?t=208855&page=69

/boot/grub$ sudo fdisk -l

Disk /dev/sda: 80.0 GB, 80026361856 bytes
255 heads, 63 sectors/track, 9729 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x916e916e

Device Boot Start End Blocks Id System
/dev/sda1 * 1 2550 20482843+ 7 HPFS/NTFS
/dev/sda2 2551 4463 15360000 7 HPFS/NTFS
/dev/sda3 6083 9729 29294527+ 83 Linux
/dev/sda4 4464 4866 3237097+ 5 Extended
/dev/sda5 4464 4866 3237066 82 Linux swap / Solaris

would like to get the gfxboot working properly

thanks

wsonar
February 25th, 2009, 08:32 PM
my grub log shows

grub error 2: bad file or directory type

InfectedJ11
February 25th, 2009, 08:54 PM
so yeah I read this treat and nothing could help me! I just installed Ubuntu 8.10 on my Quad Core Intel and when I restard it, it gives me and Error, Grub loading, error 21, I have a windows vista installation, windows 7 and last ubuntu, after I installed ubuntu it messed everything up so I did what I could from the live cd, but I give up, those anybody knows how I can restored my grub back?

wsonar
February 25th, 2009, 10:13 PM
how can I edit the files on my drive through the live cd when I try mounting /dev/sda6 it apears to work but I can't cd to the directory and nothing there apears Im still working off live cd

I think I need to remove the line I added to the menu.lst for gfxboot

because I reinstalled grub but forgot to remove the line

now when booting I get

grub error loading
error 2

I think if I can remove the first line in my menu.lst I can boot again

still don't know if it's a bug or why gfxboot will not work

wsonar
February 25th, 2009, 10:40 PM
just downloaded super grub

pretty cool lets me get back in and fix things


still want gfxboot to work tho

wsonar
February 25th, 2009, 11:09 PM
so with the super grub I can boot up to ubuntu I edited my menu.lst and took out the gfx line

I did

sudo grub

grub find /boot/grub/stage1

says (hd0,5)

I do

root (hd0,5)

setup (hd0)

everything seems to go good but when reboot still get grub error 2


after fixing grub I still want to get gfxboot to work on 8.10 if anybody can tell me how

wsonar
February 25th, 2009, 11:16 PM
Thisd dosen't make sence I reinstalled grub

sudo grub

find /boot/grub/stag1

(hd0,5)

root (hd0,5)

setu (hd0)

no problem but when reboot still'

get grub error 2?

why is this not working?????

wsonar
February 25th, 2009, 11:32 PM
this dosen't make any sence why grub isn't repairing

everything looks good

i've even done

update-grub

then tried setting grub up again get no errors but reboot and still get error 2

can boot to ubuntu using super grub cd

LoungeLizard
February 26th, 2009, 04:56 AM
OK - I read tons of web pages concerning the infamous "Error 21" issue. I recently installed Ubuntu 8.10 on a new build... it was going fine for a while. Added a 4-SATA disk RAID (Mobo is an ASUS M2N-SLI having a nVidia RAID thingy built-in) with 4 320Gb disks. Got it working just fine using the DMRaid util. A new file server has been born!

Joy lasted for about 72 hours... Moved a ton of files onto the RAID array, setup a few cron jobs to backup files from family machines (I have a few fam members within my local net). All seemed to be peachy...

Then, disaster struck... I have a KVM setup, and a couple of days ago I popped over to look at the machine and all I had was a dead screen.

So, I do what any red-blooded geek would do - I kill power and reboot...

Only... now I'm getting the Error 21 crap no matter what I try.

I really don't wanna re-install. I want to figure this thing out...

What's weird is when I boot with my original Ubuntu CD and I do an fdisk - my boot disk shows up as sde1 and it shows up in grub as hd4,0. My entry in menu.lst is hd0,0... Editing the menu.lst to accomodate doesn't resolve anything - I still have an Error 21 upn a reboot. If I boot with a Fedora 10 and use the "fix broken install" option, I get a shell and fdisk shows my boot disk to be sda1 and grub shows it to be hd0,0. No matter what I try, I always get an Error 21...

Just for grins, I ran fsck -f -y on the drive (in both Ubuntu and Fedora) - everything is peachy as far as it's concerned.

Does anyone have any ideas what I should try to get my system back operational, short of the last resort - re-installing?

-- da Lizard

LoungeLizard
February 26th, 2009, 05:41 AM
Just did a tail -100 on my fstab while perusing all the logs and trying to make heads or tails of what's happening...

only entries are:

aufs / aufs rw 0 0
tmpfs /tmp tmpfs nosuid, nodev 0 0
/dev/sde5 swap swap defaults 0 0
hmmm... this definitely don't look right... I have a 500Gb primary drive that Ubuntu thinks is sde and the boot partition according to grub is sde1 (and fdisk in Ubuntu as hd4,0). Also, I should have mapper entries, I believe, for the nvidia DMRaid array...

any ideas why this is wrong - how to fix???

- da lizard

LoungeLizard
February 26th, 2009, 06:49 AM
Also... if I try doing 'sudo grub-install /dev/sde' I always get a msg: /dev/sde does not have any corrsponding BIOS drive. same thing happens if I specify partition # (/dev/sde1).

No matter what I try... even though it shows under fdisk that /dev/sde1 is a boot partition and has ID of 83 (and I created it as ext3)

If I sudo grub, and evoke:
geometry (hd4,0)I get

drive 0x84: C/H/S = 60801/255/63, The number of sectors = 976773168, /dev/sde
Partition num: 0, Filesystem type is ext2fs, partition type 0x83
Partition num: 4, Filesystem type is unknown, partition type 0x82

But - here's a caveat... I'm noticing something different than I've seen in other systems. My boot drive periodically, at random times, seems to lose itself and is not visible to the OS and I get a slew of disk read errors. When I do a reboot, BIOS does not always see the drive during POST. If I power off the drive (I have the drive in a rack which is capable of cycling power to the drive) and turn it on, then reboot - BIOS sees it during POST. Could I be having a hardware issue??? Is this a bad drive - works for a while and then gets lost? I've never run into anything like this before (and let me tell you, I've been around for quite some time - circa s-100 Heathkits and stuff... well before the famous and doomed C-64).

Methinks, I should see about swapping out this primary drive. Only question, anyone have a spare IDE Pata HDD I could test with?...

-- da Lizard

caljohnsmith
February 26th, 2009, 01:40 PM
LoungeLizard, it seems like the intermittent problems you are having with your HDD could be a signal of a hardware problem as you are all ready suspicious of, but it would first help a lot to get more info about your system if you want help with your Grub problems. How about downloading the Boot Info Script to your Ubuntu desktop:

https://sourceforge.net/projects/bootinfoscript/

Then do:

sudo bash ~/Desktop/boot_info_script*.sh
That will create a "RESULTS.txt" file in the same directory from where the script is run, namely your desktop; please start a new thread, copy/paste the contents of the RESULTS.txt file to your first post, and PM me with the URL of your new thread. It will be much easier to help troubleshoot your problem if you have your own thread.

donfletcher
March 2nd, 2009, 11:27 PM
It is stage1, not stag1

Berri82
March 3rd, 2009, 02:58 PM
How do I do to uninstall Grub completely?

LoungeLizard
March 5th, 2009, 01:57 AM
Thanks for the reply, caljohnsmith...

Turns out, you and I and others agree I didn't need to waste any more time on messing around with GRUB since all indicators pointed to a hardware issue - namely a faulty HDD. So, I went out to Seagate's website and found they have a diagnostic program that can run a few tests on the drive in question. It failed immediately and since the drive was still under warranty, I packed it up and its now on the way to Texas (where I assume their warranty exchange warehouse is at).

In the meantime, I looked around for a reasonable drive to use in the interrim and found one of my old circa-2004 Maxtor 200GB IDE drives was in a reasonable shape, passing Seagate's diagnostics, passing HDSentinel's tests. I had a few of those drives in an older machine; but had marked this drive as 'questionable' but I'm thinking it was due to other problems I was having with older hardware (hard to remember, I've had so many variations of machines and their components over the years). I do know, them 200Gb Maxtor drives were not very good, tending to run hot and I've had a few (not just one or two, but a FEW) of them develop issues where they got sick and progressively come down with bad sectors - I retired most around what HD Sentinel (A Winders Ute) calls 25% health and there were many SMART triggers showing unusual block moves and excessive LBA errors. But, the one I have here doesn't seem to have any aberrant data stored in the SMART and has a relatively short time-in-service (power-on hours is only 278.32) and zero bad sectors, operating temperature peak after 10 hours is only 31 degrees (Celsius).

So, without further ado, I make another install of Interpid, enable Samba editing the conf file to my tastes, installing DMRAID and mounting the 960Gb RAID Array and updating everything to current updates and adjusting GRUB for my tastes... Then - onion test time - reboot

AND I GET ==> ERROR 21 <==

{sigh}

So, refering to Herman's explanation on Error 21 (http://users.bigpond.net.au/hermanzone/p15.htm#21) this time, I see a reference he makes to an entry in his Error 18 text - which in essence suggests double-checking the BIOS ordering of the HDD devices. So, I did that - and OMG do I feel embarrassed now!!! :oops: No wonder GRUB has a problem setting up [hd0,0] where it seemed to be looking in the wrong place (hence the error 21 - meaning it can't find the file on the device referenced in the MBR - in essence GRUB could never find the 1_5 wrapper binary). My BIOS showed my HDD priority order had the RAID array in front of the primary IDE! I'm not sure how I could've missed that - but, apparently this has been my problem all along. So, GRUB was looking for a logical ZERO drive which happened to be a member of the RAID array and which did not have a boot partition.

The discovery of the flakey HDD I warranty-returned to Seagate was simply incidental and utter SERENDIPITY!!! It's a good thing though - saved me from more heartache in the future when the drive failed even worse or died with dramatic flair when I had tons of unrecoverable and important data on it.

Changing the HDD Boot priority so the logical HD0 was in fact the Primary IDE drive in BIOS COMPLETELY SOLVED THE PROBLEM!!!! My file server is completely operational and everything is fine.

da Lizard...

LoungeLizard
March 5th, 2009, 03:30 AM
How do I do to uninstall Grub completely?

Uh... why on earth would ya wanna do that??? Please - start a new thread (suggest Title be: How to uninstall GRUB???) and explain what you are wanting to do and why you are asking how to uninstall GRUB.

da Lizard

Berri82
March 5th, 2009, 02:43 PM
Already done (http://ubuntuforums.org/showthread.php?t=1086003)

souravmohanty
March 16th, 2009, 11:15 AM
Hi all,
Try fixing MBR from windows CD and then try installing Ubuntu again this may solve it. Otherwise verfiy for Windows drive where it is installed it may be NTFS. try defrag it it may solve ur problem too.
I too experienced the same with Kubuntu 8.04 , may be Kubuntu 8.10 version doesnot experiences this problem me yet to verify.

https://bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/180089

regards,
Sourav Mohanty

prabhakaran1989
March 20th, 2009, 02:43 AM
thanks it helped me...the first method ( to enter the live CD mode i tried upto15 times restarting )

Na$$im
March 21st, 2009, 08:21 PM
Hey ,
thanks a lot Catlett ! i had the same problem ... grub couldn't find the stage1 ....your second step saved it easily ;)

VeryLost
March 26th, 2009, 01:10 AM
I just wanted to say thanks for this write up.

I have a single HD partitioned in 5 slices and out of no where this problem came up.

I followed the guide posted and I am now able to boot to all of my partitions.

Thank you for taking the time to write this guide up.

elfstone2
April 1st, 2009, 12:43 PM
Hello..

I have problems with reinstalling my grub after screwing up.



sudo grub
find /boot/grub/stage1
root (hd0,6)
setup (hd0)

gives:
Running "install /boot/grub/stage1 (hd0) (hd0)1+16 p (hd0,6)/boot/grub/stage2 /boot/grub/menu.lst" ... failed


After chrooting like in the first post i get:


grub-install /dev/sda
Searching for GRUB installation directory... found /boot/grub
The file /boot/grub/stage1 not read correctly

Although the file is there and readable.

What can i do, to get my grub back? thx for help... (and sorry if i missed some important information)

Mr Fredrick
April 2nd, 2009, 01:47 PM
Hi All,

Could someone please give me some help. I have read lots of posts and tried many things but still I get an grub error when attempting to boot.

In grub itself I always get this error even though I know that the stage1 file is in that directory because I copied it there myself.


[ 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> root (hd0,2)

grub> find /boot/grub/stage1

Error 15: File not found

grub> find /boot/grub/stage1

Error 15: File not found

grub>

Also, when I boot up any files in /boot/grub and the directory itself are deleted.

Any help appreciated

MrFred.

PS. I need my system back!!

unutbu
April 2nd, 2009, 02:30 PM
elfstone2 and Mr Fredrick,
please use the instructions posted here
http://ubuntuforums.org/showpost.php?p=6725571&postcount=3
to run boot_info_script. This will give us more information about your boot situation.

Also, please start new threads since it is hard to deal with two problems at once in the same thread. Post back here with a link to your new thread and I and others will take a look at it.

elfstone2
April 2nd, 2009, 03:15 PM
Just a notice on how i "solved" my problem. After trying everything google came up with, i just reinstalled ubuntu 8.10 from a live cd. It resized the partitions of the exisiting ubuntu installation.
In the new grub menu.list a also have entries of the old ubuntu installation, so i got my old system back to work (windows seems to be screwed so, but at least i can work again)

Mr Fredrick
April 2nd, 2009, 09:53 PM
Hi Utnubu,

Sorry for the delay, had to go to bed. Just got up and read your response. Thanks for the help.

Here are the results of running the script.

MrFred

unutbu
April 2nd, 2009, 10:11 PM
So I understand your situation better, could you tell us what happened before your system became unbootable? Do you have a suspicion about what broke it?

The RESULTS.txt file says your have Ubuntu Jaunty installed, though your profile says you are running Intrepid. What OS was installed when your system was booting properly?

Mr Fredrick
April 2nd, 2009, 10:18 PM
I screwed it up when I decided to install Jaunty beta. There is a bug in Ubiquity which causes the problem.

Now I can't get back or go forward and I need my laptop to be operational by Tuesday for an interview.

unutbu
April 2nd, 2009, 10:34 PM
Boot from a Live CD.
Open a terminal (Applications>Accessories>Terminal) and type


sudo mkdir /sda1
sudo mkdir /sda2
sudo mkdir /sda3
sudo mount /dev/sda1 /sda1
sudo mount /dev/sda2 /sda2
sudo mount /dev/sda3 /sda3

ls -l /sda1 # This will list the top-level directory of HomePartition
ls -l /sda2 # This will list the top-level directory of WinXP
ls -l /sda3 # This will list the top-level directory of Jaunty's root directory

What do you see? You can also use a file browser like Nautilus to navigate to /sda1, /sda2, or /sda3 to see what files are there.

Can you find your personal data?
Please post the output of


ls -l /sda3

Mr Fredrick
April 2nd, 2009, 10:52 PM
Here is the output:


ubuntu@ubuntu:~$ sudo chroot /
root@ubuntu:/# ls -l /sda3
ls: cannot access /sda3: No such file or directory
root@ubuntu:/# sudo mount /dev/sda3 /sda3
mount: mount point /sda3 does not exist
root@ubuntu:/# ls -1 /sda3
ls: cannot access /sda3: No such file or directory
root@ubuntu:/#


ubuntu@ubuntu:~$ sudo chroot /
root@ubuntu:/# dir
bin cdrom etc initrd.img media opt rofs sbin srv tmp var
boot dev home lib mnt proc root selinux sys usr vmlinuz
root@ubuntu:/# cd dev
root@ubuntu:/dev# dir
adsp port tty tty46 usbdev3.2_ep00
audio ppp tty0 tty47 usbdev3.2_ep81
block psaux tty1 tty48 usbdev3.3_ep00
bus ptmx tty10 tty49 usbdev3.3_ep03
cdrom pts tty11 tty5 usbdev3.3_ep81
cdrw ram0 tty12 tty50 usbdev3.3_ep82
char ram1 tty13 tty51 usbdev4.1_ep00
console ram10 tty14 tty52 usbdev4.1_ep81
core ram11 tty15 tty53 usbdev5.1_ep00
cpu_dma_latency ram12 tty16 tty54 usbdev5.1_ep81
disk ram13 tty17 tty55 usbdev5.2_ep00
dsp ram14 tty18 tty56 usbdev5.2_ep81
dvd ram15 tty19 tty57 usbmon0
dvdrw ram2 tty2 tty58 usbmon1
ecryptfs ram3 tty20 tty59 usbmon2
fd ram4 tty21 tty6 usbmon3
full ram5 tty22 tty60 usbmon4
fuse ram6 tty23 tty61 usbmon5
hidraw0 ram7 tty24 tty62 vcs
hpet ram8 tty25 tty63 vcs1
initctl ram9 tty26 tty7 vcs2
input random tty27 tty8 vcs3
kmem rtc tty28 tty9 vcs4
kmsg rtc0 tty29 ttyS0 vcs5
log scd0 tty3 ttyS1 vcs6
loop0 sda tty30 ttyS2 vcs7
loop1 sda1 tty31 ttyS3 vcs8
loop2 sda2 tty32 urandom vcs9
loop3 sda3 tty33 usbdev1.1_ep00 vcsa
loop4 sda4 tty34 usbdev1.1_ep81 vcsa1
loop5 sequencer tty35 usbdev2.1_ep00 vcsa2
loop6 sequencer2 tty36 usbdev2.1_ep81 vcsa3
loop7 sg0 tty37 usbdev2.2_ep00 vcsa4
mapper sg1 tty38 usbdev2.2_ep81 vcsa5
mem shm tty39 usbdev2.3_ep00 vcsa6
mixer snapshot tty4 usbdev2.3_ep02 vcsa7
net snd tty40 usbdev2.3_ep03 vcsa8
network_latency sndstat tty41 usbdev2.3_ep81 vcsa9
network_throughput sr0 tty42 usbdev2.3_ep82 watchdog
null stderr tty43 usbdev2.3_ep83 xconsole
oldmem stdin tty44 usbdev3.1_ep00 zero
pktcdvd stdout tty45 usbdev3.1_ep81
root@ubuntu:/dev#


I hope this is the correct

unutbu
April 3rd, 2009, 12:01 AM
root@ubuntu:/# ls -l /sda3
ls: cannot access /sda3: No such file or directory
root@ubuntu:/# sudo mount /dev/sda3 /sda3
mount: mount point /sda3 does not exist

You get these errors if you don't make the directory first:


sudo mkdir /sda3

Please go back to my previous post and execute all the commands listed there.

Mr Fredrick
April 3rd, 2009, 12:15 AM
Stand corrected, here is are the outputs:


root@ubuntu:/# ls -1 /sda1
AAAAAAAA
app
BackupZips
boot
brochure_2page.ott
Building Parsers with Java
Code
CopyrightText2.xcf
CreateTables.sql
Derby-10
derby.log
Desktop
Documents
eclipse
Examples
exe.sh
file:
GenericsBook.odt
glassfish-v2ur2
glassfish-v3-prelude
hibernate-3.2
How to install ANYTHING in Ubuntu!.html
initrd.img-2.6.28-11-generic
IzPack
jar.sh
Java Programs
Languages.odt
lost+found
menu.lst
Music
nbm
netbeans-6.5
NetBeansProjects
notml
No-Update-0.3.txt
NutriTab
NutriTabOld
OpenOfficeBase.odb
PackJacket
PackJacket.ini
Pictures
PJ_log.txt
PJ_log.txt.1
PJ_XMLCreation_log.txt
PJ_XMLCreation_log.txt.1
Public
REXXCODE
REXXHOME
sitemesh-2.3
Templates
Videos
vmlinuz-2.6.28-11-generic
workspace
X.txt~



root@ubuntu:/# ls -1 /sda2
AUTOEXEC.BAT
boot.ini
CONFIG.SYS
dell
dell.sdr
Derby10
Documents and Settings
drivers
hiberfil.sys
i386
INFCACHE.1
IO.SYS
Java Programs
MDT
MSDOS.SYS
NTDETECT.COM
ntldr
pagefile.sys
Program Files
RECYCLER
Sun
System Volume Information
WINDOWS


root@ubuntu:/# ls -1 /sda3
bin
boot
cdrom
dev
etc
home
initrd.img
lib
lost+found
media
mnt
opt
proc
root
sbin
selinux
srv
sys
tmp
usr
var
vmlinuz

I think that that is all you requested.

unutbu
April 3rd, 2009, 12:28 AM
You have at least two options:


It looks like sda1 contains your home data. If that is the important part of your system, perhaps the easiest way to recover would be to use your Intrepid LiveCD to reinstall Intrepid to sda3 (leaving sda1 untouched).
Currently your /boot directory on sda3 is either empty or missing some important boot files. You can reinstall these boot files by following these commands:

Boot from LiveCD

sudo mount /dev/sda3 /mnt
sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo chroot /mnt
apt-get install grub
grub-install --recheck /dev/sda
update-grub

However, I don't know how far the Jaunty installer got before the install failed.
Your system may still not work if other parts of your system are missing.


The choice is up to you. I (and others) will try to help you out either way you choose to go, though I think option #1 is the safer (and easier) choice.

Mr Fredrick
April 3rd, 2009, 12:38 AM
My problem with the Intrepid LiveCD route is I DON'T have an Interpid LiveCd and I would somehow have to make one on this machine.

I will try option one first and let you know although I don't have much faith that it will be a success!!

Mr Fredrick
April 3rd, 2009, 12:42 AM
Just one more question beforee I continue:

Instead of this:


sudo mount /dev/sda3 /mnt
sudo mount --bind /dev /mnt/dev
sudo mount --bind /proc /mnt/proc
sudo chroot /mnt
apt-get install grub
grub-install --recheck /dev/sda
update-grub

can I do this:


sudo mount /dev/sda3 /
sudo mount --bind /dev /dev
sudo mount --bind /proc /proc
sudo chroot /
apt-get install grub
grub-install --recheck /dev/sda
update-grub

or is that wrong?

meierfra.
April 3rd, 2009, 12:44 AM
Perhaps the easiest way to recover would be to use your Intrepid LiveCD to reinstall Intrepid to sda3
I agree.

The commands suggested by unutbu won't get you very far:

Your fstab is messed up:


aufs / aufs rw 0 0
tmpfs /tmp tmpfs nosuid,nodev 0 0
/dev/sda4 swap swap defaults 0 0

Your kernel is on /dev/sda1:



=================== sda1: Location of files loaded by Grub: ===

22.0GB: initrd.img-2.6.28-11-generic
22.0GB: menu.lst
22.0GB: vmlinuz-2.6.28-11-generic


So in addition the reinstalling grub like unutbu suggested, you have to reinstall the kernel and write your own fstab. But just as unutbu said, who knows what else did go wrong.

meierfra.
April 3rd, 2009, 12:49 AM
sudo mount /dev/sda3 /
sudo mount --bind /dev /dev
sudo mount --bind /proc /proc
sudo chroot /
apt-get install grub
grub-install --recheck /dev/sda
update-grub

Please don't. That sounds like a very bad idea.

Mr Fredrick
April 3rd, 2009, 12:57 AM
I did EXACTLY what I was instructed (seems to be the best method). Anyway here is the output:


ubuntu@ubuntu:~$ sudo mount /dev/sda3 /mnt
ubuntu@ubuntu:~$ sudo mount --bind /dev /mnt/dev
ubuntu@ubuntu:~$ sudo mount --bind /proc /mnt/proc
ubuntu@ubuntu:~$ sudo chroot /mnt
root@ubuntu:/# apt-get install grub
Reading package lists... Done
Building dependency tree
Reading state information... Done
grub is already the newest version.
grub set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 271 not upgraded.
root@ubuntu:/# grub-install --recheck /dev/sda
Probing devices to guess BIOS drives. This may take a long time.
Could not find device for /boot: Not found or not a block device.
root@ubuntu:/# update-grub
Searching for GRUB installation directory ... found: /boot/grub
Searching for default file ... found: /boot/grub/default
Testing for an existing GRUB menu.lst file ... found: /boot/grub/menu.lst
Searching for splash image ... none found, skipping ...
Found kernel: /boot/vmlinuz-2.6.28-11-generic
Found kernel: /boot/memtest86+.bin
Replacing config file /var/run/grub/menu.lst with new version
Found kernel: /boot/vmlinuz-2.6.28-11-generic
Found kernel: /boot/memtest86+.bin
Updating /boot/grub/menu.lst ... done

It contains some error messages, I don't know how important they are, or if is means I can't continue!

I haven't rebooted yet.

Mr Fredrick
April 3rd, 2009, 01:11 AM
Well, it didn't work, so back to Intrepid, all I have to do is figure out HOW?

Anyway, thanks a lot for your help guys. ):P

meierfra.
April 3rd, 2009, 01:48 AM
The output from "update-grub" does not match the "RESULTS.txt". Could you post "RESULTS.txt" again? Make sure you post the whole file.

Also what is the exact error messages you get at boot up? Does the grub menu appear?

Mr Fredrick
April 3rd, 2009, 02:01 AM
Hi,

Attached is Results.txt,

On bootup I get:

Can't find/load stage2
Error 2.

Or something like that, I'd actually have to reboot to be exact, memory not so good anymore. I don't get any menu.

meierfra.
April 3rd, 2009, 02:25 AM
That Results.txt looks much better. Something must have went wrong the first time you run the script.

Also the "grub-install" did not work inside the chroot. So try this:



sudo mount /dev/sda3 /mnt
sudo grub-install --root-directory=/mnt --recheck /dev/sda


and update-grub put the wrong numbers into menu.lst. So menu.lst needs to be edited



gksudo gedit /boot/grub/menu.lst

change

# groot=(hd0,0)

to

# groot=(hd0,2)

and change all

root (hd0,0)

to

root (hd0,2)

Save the file, reboot and hope for the best.

Mr Fredrick
April 3rd, 2009, 02:26 AM
I rebooted, just to get the message again. Here it is:


GRUB Loading stage 1.5.

GRUB loading, please wait...
Error 2

I don't get any menu.

meierfra.
April 3rd, 2009, 02:32 AM
Just want to make sure you saw my last post. (we posted at the same time so you might have missed it).

Mr Fredrick
April 3rd, 2009, 02:32 AM
Before I do the second part (editing) I provide the output of the first part, just in case:


To run a command as administrator (user "root"), use "sudo <command>".
See "man sudo_root" for details.

ubuntu@ubuntu:~$ sudo mount /dev/sda3 /mnt
ubuntu@ubuntu:~$ sudo grub-install --root-directory=/mnt --recheck /dev/sda
Probing devices to guess BIOS drives. This may take a long time.
grub-probe: error: Cannot open `/boot/grub/device.map'
[: 494: =: unexpected operator
Installing GRUB to /dev/sda as (hd0)...
Installation finished. No error reported.
This is the contents of the device map /mnt/boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.

(fd0) /dev/fd0
(hd0) /dev/sda
ubuntu@ubuntu:~$

meierfra.
April 3rd, 2009, 02:34 AM
Looks good.

Mr Fredrick
April 3rd, 2009, 02:42 AM
I think I did something wrong with the editor, when the file opens its empty. How to fix?

meierfra.
April 3rd, 2009, 02:46 AM
My bad: It needs to be


gksudo gedit /mnt/boot/grub/menu.lst

Mr Fredrick
April 3rd, 2009, 02:54 AM
Content of /mnt/boot/grub/menu.lst AFTER editing:



# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not use 'savedefault' or your
# array will desync and will not let you boot your system.
default 0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 3

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
hiddenmenu

# Pretty colours
#color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title Windows 95/98/NT/2000
# root (hd0,2)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=/dev/hda1 ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,2)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash

## should update-grub lock old automagic boot options
## e.g. lockold=false
## lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all

## specify if running in Xen domU or have grub detect automatically
## update-grub will ignore non-xen kernels when running in domU and vice versa
## e.g. indomU=detect
## indomU=true
## indomU=false
# indomU=detect

## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

## ## End Default Options ##

title Ubuntu jaunty (development branch), kernel 2.6.28-11-generic
root (hd0,2)
kernel /boot/vmlinuz-2.6.28-11-generic root=/dev/hda1 ro quiet splash
initrd /boot/initrd.img-2.6.28-11-generic

title Ubuntu jaunty (development branch), kernel 2.6.28-11-generic (recovery mode)
root (hd0,2)
kernel /boot/vmlinuz-2.6.28-11-generic root=/dev/hda1 ro single
initrd /boot/initrd.img-2.6.28-11-generic

title Ubuntu jaunty (development branch), memtest86+
root (hd0,2)
kernel /boot/memtest86+.bin

### END DEBIAN AUTOMAGIC KERNELS LIST

Going to reboot right now.

Mr Fredrick
April 3rd, 2009, 03:17 AM
Partial success!!

GRUB came up but without a menu, I can't remember exactly what it said, went to fast. I think I had to press enter to continue.

Next up came the Ubuntu progress bar which then cleared after a while to a black screen with the following text:


Starting up...
Loading pleas wait...
WARNING bootdevice may be renamed. Try root=/dev/sda1
Gave up waiting for root device.

Common problems:
-Boot args (cat /proc/cmdline)
-Check rootdelay=(did system wait long enough?)
- check root= (did the system wait for the right device?)
-Missing modules (cat /proc/modules; ls /dev)

ALERT! /dev/hda1 does not exist. Dropping to shell!

BusyBox. v1.10.2 (Ubuntu1 1.1.10.2-2unbuntu6) built in shell (ash)
Enter 'help' for a list of commands

(initramfs)_



The last character above is the blinking prompt.

meierfra.
April 3rd, 2009, 03:27 AM
O.k your menu .lst needs more editing (and lets add XP to menu.lst at the same time)


Open menu.lst as before:


sudo mount /dev/sda3 /mnt
gksudo gedit /mnt/boot/grub/menu.lst

change "timeout 3" to "timeout 10"

change "hiddenmenu" to "#hiddenmenu"

change "root=/dev/hda1" to "root=/dev/sda3" (twice, in the kernel line of the Ubuntu items)

add this to the end of the file:


title Windows XP
root (hd0,1)
chainloader +1

Save the file and reboot.

Mr Fredrick
April 3rd, 2009, 03:41 AM
I send the contents of the edited menu.lst. I'm just about to reboot, next message may take a while cause the rebooting can take some time.


# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not use 'savedefault' or your
# array will desync and will not let you boot your system.
default 0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 10

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
# hiddenmenu

# Pretty colours
#color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title Windows 95/98/NT/2000
# root (hd0,2)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=/dev/hda1 ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,2)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash

## should update-grub lock old automagic boot options
## e.g. lockold=false
## lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all

## specify if running in Xen domU or have grub detect automatically
## update-grub will ignore non-xen kernels when running in domU and vice versa
## e.g. indomU=detect
## indomU=true
## indomU=false
# indomU=detect

## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

## ## End Default Options ##

title Ubuntu jaunty (development branch), kernel 2.6.28-11-generic
root (hd0,2)
kernel /boot/vmlinuz-2.6.28-11-generic root=/dev/sda3 ro quiet splash
initrd /boot/initrd.img-2.6.28-11-generic

title Ubuntu jaunty (development branch), kernel 2.6.28-11-generic (recovery mode)
root (hd0,2)
kernel /boot/vmlinuz-2.6.28-11-generic root=/dev/sda3 ro single
initrd /boot/initrd.img-2.6.28-11-generic

title Ubuntu jaunty (development branch), memtest86+
root (hd0,2)
kernel /boot/memtest86+.bin

title Window XP
root (hd0,1)
chainloader + 1

### END DEBIAN AUTOMAGIC KERNELS LIST

Mr Fredrick
April 3rd, 2009, 03:49 AM
:KSCALLING meierfra (and utnubu) FROM JAUNTY JACKALOPE !!:KS

Yes it worked and THANKYOU both so much for your patience. I envy you your knowledge!! ):P

Regards,

MrFred.

meierfra.
April 3rd, 2009, 03:50 AM
You windows item needs fixing:
Change



title Window XP
root (hd0,1)
chainloader + 1

### END DEBIAN AUTOMAGIC KERNELS LIST
to

### END DEBIAN AUTOMAGIC KERNELS LIST

title Window XP
root (hd0,1)
chainloader +1


So it needs to be below the line "### END DEBIAN AUTOMAGIC KERNELS LIST"
(otherwise it will disappear after the next kernel update)

and there should not be space between "+" and "1"


Otherwise it looks good, and hopefully you will be able to boot into Ubuntu.

meierfra.
April 3rd, 2009, 04:01 AM
FROM JAUNTY JACKALOPE

Great. Just fix the windows item and you should be all set.

(To open menu.lst from Ubuntu just use "gksudo gedit /boot/grub/menu.lst"


CALLING meierfra (and utnubu)

Actually unutbu deserves most of the credit. I wouldn't even tried to fix your system after I saw your first "RESULTS.txt".
I'm really puzzled. The first and the second "RESULTS.txt" displayed a different "/etc/fstab". Did you use

sudo bash boot_info_script*.sh

to run the script. Or did you do something different?

Or did you edit /etc/fstab at some stage?

Mr Fredrick
April 3rd, 2009, 04:26 AM
I'm really puzzled. The first and the second "RESULTS.txt" displayed a different "/etc/fstab". Did you use

sudo bash boot_info_script*.sh

to run the script. Or did you do something different?

Or did you edit /etc/fstab at some stage?

No, I don't recall doing anything other than whatever either of you told me. But then over the past two days I have tried hundreds of different possible solutions and I would have rebooted dozens and dozens of times. I have almost stayed glued to my machine and I'm just glad its over.

By the way Jaunty seems very nice, reboots really quickly!

MrFred.

PS. Moral of story: Don't install beta unless you know what ur doin!

unutbu
April 3rd, 2009, 04:32 AM
Congratulations Mr Fredrick, I'm glad you are back up and running!

And many thanks to meierfra., not only for writing the superb boot_info_script, but also for stepping in when you did. You guided Mr Fredrick over a number of obstacles much better than I would have done.

PS. I did not really believe his Jaunty installation would work either. I guess it sometimes pays to ignore the facts and proceed anyway, lol :)

xihad76
April 3rd, 2009, 12:46 PM
while trying to re-install grub according to the instruction stated in ur post i found the following messages:

grub> root (hd0,5)
grub> setup (hd0)
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 (hd0)"... 16 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd0) (hd0)1+16 p (hd0,5)/boot/grub/stage2
/boot/grub/menu.lst"... failed
Error 12: Invalid device requested

===

can anyone plz help me with that? thnx..

meierfra.
April 3rd, 2009, 12:53 PM
xihad76: That's sounds like your partition table is slightly corrupt. Could you start a new thread and post the output of


sudo fdisk -lu

sudo sfdisk -d

xihad76
April 3rd, 2009, 01:36 PM
thnx meierfra for ur quick reply. i have already posted with the output u asked but rite now it is awaiting for moderation.. thnx again

meierfra.
April 3rd, 2009, 03:22 PM
now it is awaiting for moderation.
Sorry, I should have told you: "Tutorials and Tips" is not the correct forum for your thread (because your post is not a tutorial) None of the other forums is moderated and you can start a new thread instantly.
I'm pretty sure the moderators will move your post to a different forum. In the meantime, just post your output here.

xihad76
April 3rd, 2009, 03:43 PM
never mind. It was my fault actually :-)

i have already posted it here (http://ubuntuforums.org/showthread.php?t=1114935)

in the mean time posting the outputs here as well.


ubuntu@ubuntu:~$ sudo fdisk -lu
omitting empty partition (5)

Disk /dev/sda: 40.0 GB, 40019582464 bytes
255 heads, 63 sectors/track, 4865 cylinders, total 78163247 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xab3fab3f

Device Boot Start End Blocks Id System
/dev/sda1 * 63 14329979 7164958+ 7 HPFS/NTFS
/dev/sda2 14329980 78140159 31905090 f W95 Ext'd (LBA)
/dev/sda3 28660023 45046259 8193118+ b W95 FAT32
/dev/sda5 14330106 25655804 5662849+ 83 Linux
/dev/sda6 25655868 28659959 1502046 82 Linux swap / Solaris
/dev/sda7 45046323 61432559 8193118+ b W95 FAT32
/dev/sda8 61432623 78140159 8353768+ b W95 FAT32


ubuntu@ubuntu:~$ sudo sfdisk -d
# partition table of /dev/sda
unit: sectors

/dev/sda1 : start= 63, size= 14329917, Id= 7, bootable
/dev/sda2 : start= 14329980, size= 63810180, Id= f
/dev/sda3 : start= 28660023, size= 16386237, Id= b
/dev/sda4 : start= 0, size= 0, Id= 0
/dev/sda5 : start= 14330106, size= 11325699, Id=83
/dev/sda6 : start= 25655868, size= 3004092, Id=82
/dev/sda7 : start= 45046323, size= 16386237, Id= b
/dev/sda8 : start= 61432623, size= 16707537, Id= b

meierfra.
April 3rd, 2009, 04:39 PM
xihad76: I responded in your new thread.

RaveJunkie
April 9th, 2009, 04:15 AM
Thank you so much sir, i installed windows 7 and it overwrote the MBR and this fixed it..... thank you

brayden13
April 9th, 2009, 02:34 PM
Oh my god! how can i thank you? you saved my life (damn windows XP!)

miden
April 19th, 2009, 10:17 PM
Hi guys...New Ubuntu user here... I did just this re-installed Windows Xp and it took out the Grub..

I have tried several times with all the tips on how to fix this and it does indeed show up the Ubuntu partition, but every time I get to the end of the process I get this...

grub> setup (hd0)
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 (hd0)"... 16 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd0) (hd0)1+16 p (hd0,5)/boot/grub/stage2
/boot/grub/menu.lst"... failed

Error 12: Invalid device requested

And then of course, I get no grub at bootup it goes straight to windows.

Any help really appreciated as this is getting SO frustrating. I have a highly modified Ubuntu setup, well its now Ubuntu Studio, and I REALLY do not want to have to re-install Ubuntu totally from fresh and start again... It took me long enough the first time LOL...

Thanks
Dennis

unutbu
April 19th, 2009, 10:27 PM
Please post the output of


sudo fdisk -l
sudo grub
find /boot/grub/stage1

miden
April 19th, 2009, 10:34 PM
Hi, I will run the first part of your request again, (need to reboot Live Cd)... but in reply to the second part it is (hd0,5)

Dennis

unutbu
April 19th, 2009, 10:36 PM
Okay, did you try


sudo grub
root (hd0,5)
setup (hd0)

?

miden
April 19th, 2009, 10:44 PM
Hi, just thought I would check back before re-booting... yes I did that, it was part of the first attempt to get this done..

From this thread..http://ubuntuforums.org/showthread.php?t=224351

Dennis

miden
April 19th, 2009, 10:45 PM
her are the results from fdisk -ls and sfidk -d

ubuntu@ubuntu:~$ sudo fdisk -lu
omitting empty partition (5)

Disk /dev/sda: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x866d866d

Device Boot Start End Blocks Id System
/dev/sda1 * 63 205021529 102510733+ 7 HPFS/NTFS
/dev/sda2 205021530 624864239 209921355 f W95 Ext'd (LBA)
/dev/sda3 307211058 624864239 158826591 7 HPFS/NTFS
/dev/sda5 205021656 300720734 47849539+ 83 Linux
/dev/sda6 300720798 307210994 3245098+ 82 Linux swap / Solaris
ubuntu@ubuntu:~$

ubuntu@ubuntu:~$ sudo sfdisk -d
# partition table of /dev/sda
unit: sectors

/dev/sda1 : start= 63, size=205021467, Id= 7, bootable
/dev/sda2 : start=205021530, size=419842710, Id= f
/dev/sda3 : start=307211058, size=317653182, Id= 7
/dev/sda4 : start= 0, size= 0, Id= 0
/dev/sda5 : start=205021656, size= 95699079, Id=83
/dev/sda6 : start=300720798, size= 6490197, Id=82



makes no sense to me..but you guys might be able to figure it :)

Dennis

unutbu
April 20th, 2009, 12:36 AM
Whenever fdisk gives the message
"omitting empty partition" it means your partition table has an error in it.

sda3 (by virtue of having a number between 1 and 4) is a primary partition. But according to fdisk, it is sitting inside your sda2 extended partition. Only logical (not primary) partitions are allowed inside extended partitions.

I think the easiest way to fix this is to rename sda3 --> sda7, thus making it a logical partition.

Boot the LiveCD.
Download the attached file "partition_table.txt". Save it at ~/Desktop/partition_table.txt.

Then run the command


sudo sfdisk -f /dev/sda -O ~/Desktop/sda_sectors_modified.save < ~/Desktop/partition_table.txt

This will produce a lot of output, including some warnings, so don't be alarmed.
The sfdisk command will create a backup of your current partition table in the file called ~/Desktop/sda_sectors_modified.save. With this backup we will be able to restore your current partition table easily if anything goes wrong. Be sure to copy it to a different drive, a USB flash key, or email it to yourself, since things left in the LiveCD filesystem are lost when you shutdown.

Then run


sudo grub
root (hd0,4)
setup (hd0)
quit

Let us know how it goes.

miden
April 20th, 2009, 12:56 AM
Hi thanks for that..this is the result.....
grub> setup (hd0)
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 (hd0)"... 16 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd0) (hd0)1+16 p (hd0,4)/boot/grub/stage2
/boot/grub/menu.lst"... succeeded
Done.


So I should now enter quit? and then re-boot?

Thanks

BTW, which thread should I stick to? I got in trouble for posting to another thread, and I dont usually multi post, but I read this is a tips thread only...

unutbu
April 20th, 2009, 01:02 AM
It looks good. Try rebooting.
This thread is often used as a support thread. I think you are almost done, so please report back here.

miden
April 20th, 2009, 01:24 AM
Thanks Unutbu.... Perfect solution. Greatly appreciate your help.

Dennis

mihata
April 20th, 2009, 11:07 AM
Hi,
I have a similar problem. When I use


root(hd0,5) or

root(hd0,7)
I have two distros. I get


Error 27: Unrecognized command
I have installed Xubuntu 8.10 and Ubuntu 9.04b
Does it matter what liveCd I use? I try with usb flash with Ubuntu 8.10

Best wishes,
mihata

meierfra.
April 20th, 2009, 12:08 PM
root(hd0,5)

There needs to be a space between "root" and "(hd0,5)" :


root (hd0,5)

camper365
April 22nd, 2009, 09:06 PM
Note that if you have /boot mounted on a separate partition, you will have to use


find /grub/stage1

instead of


find /boot/grub/stage1

Dan_Dranath999
April 25th, 2009, 07:08 PM
Hi everybody!

I'm trying to boot Jaunty from a Toshiba MK8026GAX 80 Gb external Hard disk. I put GRUB on "sdg" which is that disk... but nothing happens

i have tried the USB-boot on my desktop, and my laptop. Nothing.

Thanx in advance.

ranch hand
April 26th, 2009, 11:11 PM
Does your grub menu come up? You may have to hit escape to see the whole thing.

Do you have Linux on any other drive?

Do you have a live CD? I would assume you do but we must know?

Dan_Dranath999
April 27th, 2009, 12:50 PM
Does your grub menu come up? You may have to hit escape to see the whole thing.

Do you have Linux on any other drive?

Do you have a live CD? I would assume you do but we must know?

my grub menu comes up, but it's the one in the INTERNAL HD (I'M RUNNING HARDY on my desktop, and Windows XP on the laptop) i'm trying to USB BOOT the external disk, but it won't do it on any of the 2 machines.

jemmar
April 27th, 2009, 03:56 PM
Hi,

I had a problem with Grub when installing Ubuntu (9.04 netbook remix), there was an error message saying that Grub could not be installed.

When I restarted my netbook after the installation was finished, it went straight into XP (I wanted a dual boot, and got the installation to fix the partition sizes itself), instead of letting me choose which OS to use. I used the info on this thread to fix Grub, and it said it was successful. When I rebooted, all I got was a black screen saying grub:

Can anyone help me fix this? The only way I can use my netbook at the moment is to use the LiveCD version from my USB drive.

caljohnsmith
April 27th, 2009, 04:21 PM
Jemmar, in order to get a clearer picture of your setup and booting problems, how about downloading the Boot Info Script to your Live CD desktop:

https://sourceforge.net/projects/bootinfoscript/

Then open a terminal (Applications > Accessories > Terminal) and do:

sudo bash ~/Desktop/boot_info_script*.sh
That will create a "RESULTS.txt" file in the same directory from where the script is run, namely your desktop; please start a new thread, copy/paste the contents of the RESULTS.txt file to your post, highlight the copied text, and click the pound/hash sign "#" graphic button in the Ubuntu forum message box so that the text will get "code" tags put around it. Then PM me with a link to the new thread that you started. We can work from there if you want.

Dantarion
April 27th, 2009, 08:28 PM
This thread confuses me.
I did something along the lines of


sudo mkdir /mnt/ubuntu
sudo mount /dev/sda2 /mnt/ubuntu
sudo grub-install /dev/sda --root-directory=/mnt/ubuntu


And it worked.

jemmar
April 27th, 2009, 09:56 PM
Jemmar, in order to get a clearer picture of your setup and booting problems, how about downloading the Boot Info Script to your Live CD desktop:

https://sourceforge.net/projects/bootinfoscript/

Then open a terminal (Applications > Accessories > Terminal) and do:

sudo bash ~/Desktop/boot_info_script*.shThat will create a "RESULTS.txt" file in the same directory from where the script is run, namely your desktop; please start a new thread, copy/paste the contents of the RESULTS.txt file to your post, highlight the copied text, and click the pound/hash sign "#" graphic button in the Ubuntu forum message box so that the text will get "code" tags put around it. Then PM me with a link to the new thread that you started. We can work from there if you want.
hi caljohnsmith,

its sorted out now, i reinstalled it and chose to do the partitioning manually (following the instructions on the ubuntu website). I deleted the partitions that had already been made for ubuntu and made new ones, and it works now, hooray!

thanks for the offer of help tho :)

RAMWolff
April 27th, 2009, 11:37 PM
Thanks so much, this is just what I needed. I set up Ubuntu the other day and GRUB was installed as the boot manager and was broken or something so I had to use the Ubuntu install disk every time to get to "boot from hard disk" option to get to either Ubuntu or VISTA, a real PITA, let me tell ya. So far I'm loving Ubuntu. I thought I'd like Kubuntu better but I didn't but really like the KOffice but don't know how to install that (old newbie here, been years since I've used Linux ...... )

Anyway, thanks for the tutorial, much appreciated!! :)

Richard ;-)~

RAMWolff
April 28th, 2009, 06:40 AM
OK, after reading down through the last few pages, I'm not much a geek when it comes to this sort of thing . I'm a bit put off having to resort to command lines. Is there a way to go directly through Ubuntu and uninstall GRUB and then install a different boot loader?? That may be better for us non geeky folks.

Thanks!

Richard ;-)~

talsemgeest
April 28th, 2009, 07:12 AM
OK, after reading down through the last few pages, I'm not much a geek when it comes to this sort of thing . I'm a bit put off having to resort to command lines. Is there a way to go directly through Ubuntu and uninstall GRUB and then install a different boot loader?? That may be better for us non geeky folks.

Thanks!

Richard ;-)~
No, I'm afraid there is no GUI program to reinstall the bootloader. However, don't be put off by the command line, as long as you do exactly what the tutorial says, you have nothing to be afraid of. :)

RAMWolff
April 30th, 2009, 03:41 PM
OK, nothing has worked.

I've tried it all. Nothing is working in getting GRUB fixed. I even tried to go into Safe Mode and then saw there was an option right there to fix GRUB. That didn't even work. I don't know what to do at this point. This damned thing is messed up and I don't like the idea of having to baby sit the computer at boot time with the install disk in there to make sure the right menus are selected to get booted into Vista or Ubuntu.

Quite frustrating at this point!! Someone's got to have something in the pike line that's going to address this sort of thing when it happens. Command line, knowing the exact position of what hard drive it's on and all that are just not anything an end user should have to be concerned about!! :evil:

I guess it's time to get the Vista install disk out and run a repair on the boot and be done with it. I probably won't be able to boot into Ubuntu though anymore.... Sigh...

GRUB is considered powerful? Yea, powerfully annoying!! :lolflag:

Thanks for trying to help!

ionospheric
May 1st, 2009, 04:38 AM
I usually use the supergrub disk whenever I have problems with the boot sector.. not as insightful as doing it by hand, but it has saved me every time I made the computer unbootable or needed to make a Linux partition bootable.


http://www.supergrubdisk.org/index.php

RAMWolff
May 1st, 2009, 05:57 AM
Hope this works. Thanks much. I tried to use the Vista installation disk to just overwrite GRUB and figure out a different way to boot into Ubuntu when I needed to since it's more of a playground right now and not my main OS. The damned install disk hung after watching the progress bar load the needed files and never progressed further than the Microsoft logo and the running green dots going back and forth. I went to work and left it to it's own devices hoping that it was just needing more time than I had. I came home 10 hours later to find it still at the logo with the green dots going back and forth. :( Insane mess!! Sigh...................

gangesh7
May 3rd, 2009, 04:05 AM
I HAVE ALREADY TRIED THAT BUT IT DIDN'T WORK.

I GOT THE MESSAGE
root (hd5,0)
BUT (hd5) IS NTFS PARTITION AND IT WAS NOT SUCCEEDED.

TELL ME WHAT TO NEXT.

meierfra.
May 3rd, 2009, 04:14 AM
gangesh7: Please do not post in more than one thread on the same subject.


TELL ME WHAT TO NEXT.
Did you see my response in your other thread?

Racecar56
May 3rd, 2009, 04:15 AM
I HAVE ALREADY TRIED THAT BUT IT DIDN'T WORK.

I GOT THE MESSAGE
root (hd5,0)
BUT (hd5) IS NTFS PARTITION AND IT WAS NOT SUCCEEDED.

TELL ME WHAT TO NEXT.
check your caps lock

this thread really helps : >

caljohnsmith
May 3rd, 2009, 02:37 PM
I HAVE ALREADY TRIED THAT BUT IT DIDN'T WORK.

I GOT THE MESSAGE
root (hd5,0)
BUT (hd5) IS NTFS PARTITION AND IT WAS NOT SUCCEEDED.

TELL ME WHAT TO NEXT.
Gangesh7, as meierfra all ready kindly pointed out, please observe the forum rules and do not post the same problem to multiple threads; that way those who help you will not be duplicating each others' efforts. About your problem with Grub, Meierfra has answered your other thread:

http://ubuntuforums.org/showthread.php?t=1144646

Please only post to that thread regarding your Grub problem.

Thank you,
John

tanveerahmed2k8
May 9th, 2009, 09:28 AM
does this work for windows 7??

Teber
May 9th, 2009, 08:44 PM
a word of thanks and appreciation to the original poster.

tonight i had to reinstall ******* xp on my computer, after the original fouled up. which would be a double foul up.

it worked just fine. i'm a happy boy now!

:guitar:

talsemgeest
May 10th, 2009, 03:00 AM
does this work for windows 7??
Yes, it works perfectly, I have had to do it twice already.

RAMWolff
May 10th, 2009, 11:53 PM
A geek friend of a friend told me next time I want to play with Linux to load Linux first and then Windows that way GRUB wont' mess up or error out on me. He's heard of my issue many times before.

Well, that's just fine but if you already have Windows running as your default OS then there's not a blasted thing you can do about it. I'm not killing my default OS to get GRUB to load properly! That's just hooey!!

This person has been running Linux since it's inception and has run many flavors including Ubuntu and runs it as his default OS.

He writes programs and code for Linux in his spare time so I think I finally have the answer I needed to hear from a geek who was able to understand what happened in my case. But like I said I'm not going down that road since Vista and eventually Win 7 will be my default.

Oh well.... maybe one of these days the folks that made GRUB will finally work out that bug and all will be well....

Funny thing is was when I used to run BeOS ages ago, the boot manager that took over the default NEVER had an issue with finding and adding all the other OS's that it found. Nice graphical interface and very very fast too!! Wish that boot manager was still around and an option. Seems GRUB is the default and you HAVE to install it, no option to use anything else!! :(

maneto
May 12th, 2009, 10:52 PM
wow
the first method helped me
and I'd tried many ways to recover my GRUB
thanks, man

ps.: I'd installed Jaunty and then reinstalled Window$ and then the other ways to reinstall GRUB didn't work for me

aouie
May 14th, 2009, 05:58 PM
Thanks this helped. As this thread is likely used by many people, I suggest changing the initial post to take into account that some people may have boot in a separate partition. They will have to use 'find /grub/stage1' instead of 'find /boot/grub/stage1'.


I hadn't reinstalled Windows in about 2 years. It was a long process to reinstall Windows XP. It also involved checking some sites to overcome some annoyances. Before the install, I was checking various sites to overcome some directx and video codec related program crashes. Since it was not open source, finding the answers were a little more difficult than while troubleshooting Gnu/Linux. After about a day, I just reinstalled Windows XP and that too took several hours. Now my gaming and video editing OS (Windows XP) is back up, and it was easy to fix the bootloader trashing by Win XP from my primary OS (Ubuntu Gnu/Linux).
Sincerely,
Aouie

smalleye86
May 16th, 2009, 11:57 PM
Mine was a slightly different story. I couldn't get grub to find the stage1 file or even recognize my drive. So I borrowed some knowledge I picked up while using Gentoo:

You have to mount your root partition using the livecd:

$ sudo mkdir /mnt/root
$ sudo mount -t ext3 /dev/sda6 /mnt/rootThen you have to mount the proc subsystem and udev inside /mnt/root also:

$ sudo mount -t proc none /mnt/root/proc
$ sudo mount -o bind /dev /mnt/root/devDoing this allows grub to discover your drives. Next you have to chroot:

$ sudo chroot /mnt/root /bin/bashNow that you're chrooted into your drive as root everything should work.

# grub
grub> find /boot/grub/stage1It found mine on (hd0,5)

grub> root (hd0,5)It successfully scanned the partition and recognized the filesystem-type

grub> setup (hd0)That was it. It installed and on reboot I was thrown back into Ubuntu.

This might help some people who are having issues so I thought I would post it.

PLEASE NOTE: My Ubuntu was installed to /dev/sda6. This may not be the same for everyone. /dev/sdaX means it's SCSI/SATA/USB/FireWire drive. And it's partition 6 because I have a weird partitioning scheme in place.

--Tosk

i followed yours instructions but when i try to enter
$ sudo mkdir /mnt/root
it says like mkdir: cannot create directory `/mnt/root': File exists

could you help me with it?
actually i had xp in my pc, then i installed ubuntu. then i formatted the partition containing ubuntu coz i wanted to put it in a different partition (a bigger one)....
i didnt think that it would pose that much of a problem, but now i have the grub 22 error ...

smalleye86
May 17th, 2009, 09:29 AM
this is the result when i executed sudo bash ~/Desktop/boot_info_script*.sh


=> Grub0.97 is installed in the MBR of /dev/sda and looks on the same drive
in partition #6 for /boot/grub/stage2 and /boot/grub/menu.lst.

sda1: __________________________________________________ _______________________

File system: ntfs
Boot sector type: Windows XP
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files/dirs: /ntldr /ntdetect.com

sda2: __________________________________________________ _______________________

File system: ntfs
Boot sector type: Windows XP
Boot sector info: No errors found in the Boot Parameter Block.
Operating System: Windows XP
Boot files/dirs: /boot.ini /ntldr /NTDETECT.COM

sda3: __________________________________________________ _______________________

File system: ntfs
Boot sector type: Windows XP
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files/dirs:

sda4: __________________________________________________ _______________________

File system: ntfs
Boot sector type: Windows XP
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files/dirs:

=========================== Drive/Partition Info: =============================

Drive: sda ___________________ __________________________________________________ ___

Disk /dev/sda: 160.0 GB, 160041885696 bytes
255 heads, 63 sectors/track, 19457 cylinders, total 312581808 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x5b864934

Partition Boot Start End Size Id System

/dev/sda1 63 13,671,314 13,671,252 12 Compaq diagnostics
/dev/sda2 * 13,671,315 111,330,449 97,659,135 7 HPFS/NTFS
/dev/sda3 111,330,450 204,025,499 92,695,050 7 HPFS/NTFS
/dev/sda4 204,025,500 312,576,704 108,551,205 7 HPFS/NTFS


blkid -c /dev/null: __________________________________________________ __________

/dev/loop0: TYPE="squashfs"
/dev/sda1: UUID="2420C7F520C7CC4C" LABEL="??????" TYPE="ntfs"
/dev/sda2: UUID="4C54A5A254A58EF0" LABEL="Omkar" TYPE="ntfs"
/dev/sda3: UUID="92D05EB2D05E9BF3" LABEL="Neera" TYPE="ntfs"
/dev/sda4: UUID="D2106CF8106CE547" LABEL="Anjan" TYPE="ntfs"

=============================== "mount" output: ===============================

proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
tmpfs on /lib/modules/2.6.28-11-generic/volatile type tmpfs (rw,mode=0755)
tmpfs on /lib/modules/2.6.28-11-generic/volatile type tmpfs (rw,mode=0755)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
varrun on /var/run type tmpfs (rw,nosuid,mode=0755)
varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
rootfs on / type rootfs (rw)
/dev/sr0 on /cdrom type iso9660 (ro,noatime)
/dev/loop0 on /rofs type squashfs (ro,noatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
gvfs-fuse-daemon on /home/ubuntu/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=ubuntu)
/dev/sda4 on /media/Anjan type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)
/dev/sda3 on /media/Neera type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)
/dev/sda2 on /media/Omkar type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)
/dev/sda1 on /media/リカバリ領域 type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)


================================ sda2/boot.ini: ================================

[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(2)\WINDOW S
[operating systems]
multi(0)disk(0)rdisk(0)partition(2)\WINDOWS="Microsoft Windows XP Home Edition" /noexecute=optin /fastdetect

=================== sda2: Location of files loaded by Grub: ===================


6.9GB: initrd.pam


what shall I do next?

unutbu
May 17th, 2009, 01:40 PM
GRUB is looking for certain files (like /boot/grub/menu.lst) on sda6. You are getting GRUB error #22 (No such partition) because sda6 does not exist anymore.

It looks like you have a bootable Windows partition, sda2 however.
Installing the Windows bootloader to the MBR of sda should allow you to boot sda2. Here are instructions on how to do that:
http://ubuntuforums.org/showthread.php?t=740221

kthxbai2u
May 18th, 2009, 05:15 AM
this actually saved my a** many times ...

Thanks for the tutorial, as I would be lost without it! :)

Psychosocial
May 18th, 2009, 09:14 AM
Hey guys, I have a problem. I had installed Ubuntu 9.04 yesterday with GRUB and today I installed 8.10 again but now 8.10 has replaced the 9.04 option during the boot. The only options I can see in the GRUB menu are 8.10, 8.10 Recovery mode and 8.10 memtest and my Windows OS options. Where the 9.04 options ? I want to boot into it again... how can I do that ?

mosaabJ
May 20th, 2009, 12:55 PM
I tried it was done successfully but when I restart the computer I still get the error message and the computer does not boot. I installed Ubuntu on a portable hard disk

kc8hr
May 21st, 2009, 05:04 PM
Hi Guys,

I have an interesting problem:

The first IDE channel on my motherboard died, so I moved my Ubuntu Hardy installation to the second IDE channel. Now all I get is an 'error 15'. I tried using the method described to reinstall grub, but it still won't boot.

What do I do to get the system up and running again? I am damned tired--but very thankful--of booting from my LiveCD.

Thanks,
Tim

unutbu
May 21st, 2009, 05:08 PM
kc8hr, please run boot_info_script (http://ubuntuforums.org/showpost.php?p=6725571&postcount=3) and post the RESULTS.txt file here.

kc8hr
May 21st, 2009, 06:36 PM
kc8hr, please run boot_info_script (http://ubuntuforums.org/showpost.php?p=6725571&postcount=3) and post the RESULTS.txt file here.

OK, here it is:

============================= Boot Info Summary: ==============================

=> Grub0.97 is installed in the MBR of /dev/sda and looks on the same drive
in partition #1 for /boot/grub/stage2 and /boot/grub/menu.lst.

sda1: __________________________________________________ _______________________

File system: ext3
Boot sector type: Grub
Boot sector info: Grub0.97 is installed in the boot sector of sda1 and
looks at sector 736084031 of the same hard drive for
the stage2 file. A stage2 file is at this location on
/dev/sda. Stage2 looks on the same partition for
/boot/grub/menu.lst.
Operating System: Ubuntu 8.04.2
Boot files/dirs: /boot/grub/menu.lst /etc/fstab

sda2: __________________________________________________ _______________________

File system: Extended Partition
Boot sector type: -
Boot sector info:

sda5: __________________________________________________ _______________________

File system: swap
Boot sector type: -
Boot sector info:

=========================== Drive/Partition Info: =============================

Drive: sda ___________________ __________________________________________________ ___

Disk /dev/sda: 400.0 GB, 400088457216 bytes
255 heads, 63 sectors/track, 48641 cylinders, total 781422768 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x13f1cf34

Partition Boot Start End Size Id System

/dev/sda1 * 63 778,397,444 778,397,382 83 Linux
/dev/sda2 778,397,445 781,417,664 3,020,220 5 Extended
/dev/sda5 778,397,508 781,417,664 3,020,157 82 Linux swap / Solaris


blkid -c /dev/null: __________________________________________________ __________

/dev/sda1: UUID="9b7f81f4-686b-42fb-9e20-e2b88f21bd43" TYPE="ext3"
/dev/sda5: TYPE="swap" UUID="ebf47197-4df0-4a56-8491-4b4bd74571ab"
/dev/loop0: TYPE="squashfs"

=============================== "mount" output: ===============================

proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
tmpfs on /lib/modules/2.6.24-16-generic/volatile type tmpfs (rw,mode=0755)
tmpfs on /lib/modules/2.6.24-16-generic/volatile type tmpfs (rw,mode=0755)
varrun on /var/run type tmpfs (rw,noexec,nosuid,nodev,mode=0755)
varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
udev on /dev type tmpfs (rw,mode=0755)
devshm on /dev/shm type tmpfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev)
gvfs-fuse-daemon on /home/ubuntu/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=ubuntu)
/dev/sda1 on /media/disk type ext3 (rw,nosuid,nodev,uhelper=hal)


=========================== sda1/boot/grub/menu.lst: ===========================

default saved
fallback 1
timeout 5
color light-gray/black light-green/black

title Ubuntu 8.04.2, kernel 2.6.24-24-generic
root (hd0,0)
kernel /boot/vmlinuz-2.6.24-24-generic root=UUID=9b7f81f4-686b-42fb-9e20-e2b88f21bd43 ro quiet nosplash
initrd /boot/initrd.img-2.6.24-24-generic
quiet

title Ubuntu 8.04.2, kernel 2.6.24-24-generic (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.24-24-generic root=UUID=9b7f81f4-686b-42fb-9e20-e2b88f21bd43 ro single
initrd /boot/initrd.img-2.6.24-24-generic

title Ubuntu 8.04.2, memtest86+
root (hd0,0)
kernel /boot/memtest86+.bin
quiet

=============================== sda1/etc/fstab: ===============================

# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/sda1
UUID=9b7f81f4-686b-42fb-9e20-e2b88f21bd43 / ext3 relatime,errors=remount-ro 0 1
# /dev/sda5
UUID=ebf47197-4df0-4a56-8491-4b4bd74571ab none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
/dev/scd1 /media/cdrom1 udf,iso9660 user,noauto,exec,utf8 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0

=================== sda1: Location of files loaded by Grub: ===================


376.8GB: boot/grub/menu.lst
376.8GB: boot/grub/stage2
376.8GB: boot/initrd.img-2.6.24-19-386
376.7GB: boot/initrd.img-2.6.24-19-386.bak
376.8GB: boot/initrd.img-2.6.24-19-generic
376.7GB: boot/initrd.img-2.6.24-19-generic.bak
376.7GB: boot/initrd.img-2.6.24-20-generic
376.7GB: boot/initrd.img-2.6.24-20-generic.bak
376.8GB: boot/initrd.img-2.6.24-21-generic
376.8GB: boot/initrd.img-2.6.24-21-generic.bak
376.8GB: boot/initrd.img-2.6.24-22-generic
376.8GB: boot/initrd.img-2.6.24-22-generic.bak
376.7GB: boot/initrd.img-2.6.24-23-generic
376.8GB: boot/initrd.img-2.6.24-23-generic.bak
376.8GB: boot/initrd.img-2.6.24-24-generic
376.8GB: boot/initrd.img-2.6.24-24-generic.bak
376.7GB: boot/vmlinuz-2.6.24-19-386
376.8GB: boot/vmlinuz-2.6.24-19-generic
376.8GB: boot/vmlinuz-2.6.24-20-generic
376.8GB: boot/vmlinuz-2.6.24-21-generic
376.8GB: boot/vmlinuz-2.6.24-22-generic
376.8GB: boot/vmlinuz-2.6.24-23-generic
376.8GB: boot/vmlinuz-2.6.24-24-generic
.2GB: grub/stage2
376.8GB: initrd.img
376.7GB: initrd.img.old
376.8GB: vmlinuz
376.8GB: vmlinuz.old

--
Thanks!
Tim

unutbu
May 21st, 2009, 07:02 PM
kc8hr, I'm not sure I know how to fix your problem.
Here is a suggestion:

Boot from the LiveCD,
Open a terminal and type


sudo mount /dev/sda1 /mnt
gksu gedit /mnt/boot/grub/menu.lst

Add these lines to the end of the file:


title Ubuntu 8.04.2, (hd1,0)
root (hd1,0)
kernel /boot/vmlinuz-2.6.24-24-generic root=UUID=9b7f81f4-686b-42fb-9e20-e2b88f21bd43 ro quiet nosplash
initrd /boot/initrd.img-2.6.24-24-generic
quiet

Save and exit gedit. Reboot. At the GRUB menu, select the line which says "Ubuntu 8.04.2, (hd1,0)".

kc8hr
May 21st, 2009, 08:18 PM
Hi,

Thanks for trying, but it didn't work. Still 'error 15'

Appreciate your efforts anyway,
Tim


kc8hr, I'm not sure I know how to fix your problem.
Here is a suggestion:

Boot from the LiveCD,
Open a terminal and type


sudo mount /dev/sda1 /mnt
gksu gedit /mnt/boot/grub/menu.lst

Add these lines to the end of the file:


title Ubuntu 8.04.2, (hd1,0)
root (hd1,0)
kernel /boot/vmlinuz-2.6.24-24-generic root=UUID=9b7f81f4-686b-42fb-9e20-e2b88f21bd43 ro quiet nosplash
initrd /boot/initrd.img-2.6.24-24-generic
quiet

Save and exit gedit. Reboot. At the GRUB menu, select the line which says "Ubuntu 8.04.2, (hd1,0)".

kc8hr
May 22nd, 2009, 07:02 PM
Thanks for trying, but it didn't work. Still 'error 15'

Appreciate your efforts anyway,
Tim

Well, I got a brainwave and decided to install Ubuntu 9.04 next to 8.04.2, thinking it would repair grub.

No such luck.

Now I get 'error 5' when I reboot. Here are the details from /home/ubuntu/Desktop/boot_info_script032.sh:

============================= Boot Info Summary: ==============================

=> Grub0.97 is installed in the MBR of /dev/sda and looks on the same drive
in partition #6 for /boot/grub/stage2 and /boot/grub/menu.lst.

sda1: __________________________________________________ _______________________

File system: ext3
Boot sector type: Grub
Boot sector info: Grub0.97 is installed in the boot sector of sda1 and
looks at sector 736084031 of the same hard drive for
the stage2 file. A stage2 file is at this location on
/dev/sda. Stage2 looks on the same partition for
/boot/grub/menu.lst.
Operating System: Ubuntu 8.04.2
Boot files/dirs: /boot/grub/menu.lst /etc/fstab

sda2: __________________________________________________ _______________________

File system: Extended Partition
Boot sector type: -
Boot sector info:

sda5: __________________________________________________ _______________________

File system: swap
Boot sector type: -
Boot sector info:

sda6: __________________________________________________ _______________________

File system: ext3
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 9.04
Boot files/dirs: /boot/grub/menu.lst /etc/fstab

sda7: __________________________________________________ _______________________

File system: swap
Boot sector type: -
Boot sector info:

=========================== Drive/Partition Info: =============================

Drive: sda ___________________ __________________________________________________ ___

Disk /dev/sda: 400.0 GB, 400088457216 bytes
255 heads, 63 sectors/track, 48641 cylinders, total 781422768 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x13f1cf34

Partition Boot Start End Size Id System

/dev/sda1 * 63 773,160,254 773,160,192 83 Linux
/dev/sda2 773,160,255 781,417,664 8,257,410 5 Extended
/dev/sda5 778,397,508 781,417,664 3,020,157 82 Linux swap / Solaris
/dev/sda6 773,160,381 778,044,014 4,883,634 83 Linux
/dev/sda7 778,044,078 778,397,444 353,367 82 Linux swap / Solaris


blkid -c /dev/null: __________________________________________________ __________

/dev/loop0: TYPE="squashfs"
/dev/sda1: UUID="9b7f81f4-686b-42fb-9e20-e2b88f21bd43" TYPE="ext3"
/dev/sda5: UUID="ebf47197-4df0-4a56-8491-4b4bd74571ab" TYPE="swap"
/dev/sda6: UUID="8324db06-ef32-456a-a8bb-1f7df4d45e2d" TYPE="ext3"
/dev/sda7: UUID="a6680bb8-3314-49db-8d5e-61ba9e3ca5f1" TYPE="swap"
/dev/ramzswap0: TYPE="swap"

=============================== "mount" output: ===============================

proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
tmpfs on /lib/modules/2.6.28-11-generic/volatile type tmpfs (rw,mode=0755)
tmpfs on /lib/modules/2.6.28-11-generic/volatile type tmpfs (rw,mode=0755)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
varrun on /var/run type tmpfs (rw,nosuid,mode=0755)
varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
rootfs on / type rootfs (rw)
/dev/sr0 on /cdrom type iso9660 (ro,noatime)
/dev/loop0 on /rofs type squashfs (ro,noatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
gvfs-fuse-daemon on /home/ubuntu/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=ubuntu)
/dev/sda6 on /media/disk-1 type ext3 (rw,nosuid,nodev,uhelper=hal)
/dev/sda1 on /media/disk type ext3 (rw,nosuid,nodev,uhelper=hal)


=========================== sda1/boot/grub/menu.lst: ===========================

default saved
fallback 1
timeout 5
color light-gray/black light-green/black

title Ubuntu 8.04.2, kernel 2.6.24-24-generic
root (hd0,0)
kernel /boot/vmlinuz-2.6.24-24-generic root=UUID=9b7f81f4-686b-42fb-9e20-e2b88f21bd43 ro quiet nosplash
initrd /boot/initrd.img-2.6.24-24-generic
quiet

title Ubuntu 8.04.2, kernel 2.6.24-24-generic (recovery mode)
root (hd0,0)
kernel /boot/vmlinuz-2.6.24-24-generic root=UUID=9b7f81f4-686b-42fb-9e20-e2b88f21bd43 ro single
initrd /boot/initrd.img-2.6.24-24-generic

title Ubuntu 8.04.2, memtest86+
root (hd0,0)
kernel /boot/memtest86+.bin
quiet

title Ubuntu 8.04.2, (hd1,0)
root (hd1,0)
kernel /boot/vmlinuz-2.6.24-24-generic root=UUID=9b7f81f4-686b-42fb-9e20-e2b88f21bd43 ro quiet nosplash
initrd /boot/initrd.img-2.6.24-24-generic
quiet


=============================== sda1/etc/fstab: ===============================

# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# /dev/sda1
UUID=9b7f81f4-686b-42fb-9e20-e2b88f21bd43 / ext3 relatime,errors=remount-ro 0 1
# /dev/sda5
UUID=ebf47197-4df0-4a56-8491-4b4bd74571ab none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
/dev/scd1 /media/cdrom1 udf,iso9660 user,noauto,exec,utf8 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0

=================== sda1: Location of files loaded by Grub: ===================


376.9GB: boot/grub/menu.lst
376.9GB: boot/grub/stage2
376.8GB: boot/initrd.img-2.6.24-19-386
376.7GB: boot/initrd.img-2.6.24-19-386.bak
376.8GB: boot/initrd.img-2.6.24-19-generic
376.7GB: boot/initrd.img-2.6.24-19-generic.bak
376.7GB: boot/initrd.img-2.6.24-20-generic
376.7GB: boot/initrd.img-2.6.24-20-generic.bak
376.8GB: boot/initrd.img-2.6.24-21-generic
376.8GB: boot/initrd.img-2.6.24-21-generic.bak
376.8GB: boot/initrd.img-2.6.24-22-generic
376.8GB: boot/initrd.img-2.6.24-22-generic.bak
376.7GB: boot/initrd.img-2.6.24-23-generic
376.8GB: boot/initrd.img-2.6.24-23-generic.bak
376.8GB: boot/initrd.img-2.6.24-24-generic
376.8GB: boot/initrd.img-2.6.24-24-generic.bak
376.7GB: boot/vmlinuz-2.6.24-19-386
376.8GB: boot/vmlinuz-2.6.24-19-generic
376.8GB: boot/vmlinuz-2.6.24-20-generic
376.8GB: boot/vmlinuz-2.6.24-21-generic
376.8GB: boot/vmlinuz-2.6.24-22-generic
376.8GB: boot/vmlinuz-2.6.24-23-generic
376.8GB: boot/vmlinuz-2.6.24-24-generic
376.8GB: initrd.img
376.7GB: initrd.img.old
376.8GB: vmlinuz
376.8GB: vmlinuz.old

=========================== sda6/boot/grub/menu.lst: ===========================

# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not use 'savedefault' or your
# array will desync and will not let you boot your system.
default 0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 10

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu

# Pretty colours
#color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=8324db06-ef32-456a-a8bb-1f7df4d45e2d ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=8324db06-ef32-456a-a8bb-1f7df4d45e2d

## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash

## should update-grub lock old automagic boot options
## e.g. lockold=false
## lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all

## specify if running in Xen domU or have grub detect automatically
## update-grub will ignore non-xen kernels when running in domU and vice versa
## e.g. indomU=detect
## indomU=true
## indomU=false
# indomU=detect

## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

## ## End Default Options ##

title Ubuntu 9.04, kernel 2.6.28-11-generic
uuid 8324db06-ef32-456a-a8bb-1f7df4d45e2d
kernel /boot/vmlinuz-2.6.28-11-generic root=UUID=8324db06-ef32-456a-a8bb-1f7df4d45e2d ro quiet splash
initrd /boot/initrd.img-2.6.28-11-generic
quiet

title Ubuntu 9.04, kernel 2.6.28-11-generic (recovery mode)
uuid 8324db06-ef32-456a-a8bb-1f7df4d45e2d
kernel /boot/vmlinuz-2.6.28-11-generic root=UUID=8324db06-ef32-456a-a8bb-1f7df4d45e2d ro single
initrd /boot/initrd.img-2.6.28-11-generic

title Ubuntu 9.04, memtest86+
uuid 8324db06-ef32-456a-a8bb-1f7df4d45e2d
kernel /boot/memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title Other operating systems:
root


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/sda1.
title Ubuntu 8.04.2, kernel 2.6.24-24-generic (on /dev/sda1)
root (hd0,0)
kernel /boot/vmlinuz-2.6.24-24-generic root=UUID=9b7f81f4-686b-42fb-9e20-e2b88f21bd43 ro quiet nosplash
initrd /boot/initrd.img-2.6.24-24-generic
savedefault
boot


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/sda1.
title Ubuntu 8.04.2, kernel 2.6.24-24-generic (recovery mode) (on /dev/sda1)
root (hd0,0)
kernel /boot/vmlinuz-2.6.24-24-generic root=UUID=9b7f81f4-686b-42fb-9e20-e2b88f21bd43 ro single
initrd /boot/initrd.img-2.6.24-24-generic
savedefault
boot


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/sda1.
title Ubuntu 8.04.2, memtest86+ (on /dev/sda1)
root (hd0,0)
kernel /boot/memtest86+.bin
savedefault
boot


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/sda1.
title Ubuntu 8.04.2, (hd1,0) (on /dev/sda1)
root (hd0,0)
kernel /boot/vmlinuz-2.6.24-24-generic root=UUID=9b7f81f4-686b-42fb-9e20-e2b88f21bd43 ro quiet nosplash
initrd /boot/initrd.img-2.6.24-24-generic
savedefault
boot


=============================== sda6/etc/fstab: ===============================

# /etc/fstab: static file system information.
#
# Use 'vol_id --uuid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# / was on /dev/sda6 during installation
UUID=8324db06-ef32-456a-a8bb-1f7df4d45e2d / ext3 relatime,errors=remount-ro 0 1
# swap was on /dev/sda7 during installation
UUID=a6680bb8-3314-49db-8d5e-61ba9e3ca5f1 none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0

=================== sda6: Location of files loaded by Grub: ===================


396.3GB: boot/grub/menu.lst
396.4GB: boot/grub/stage2
396.4GB: boot/initrd.img-2.6.28-11-generic
396.4GB: boot/vmlinuz-2.6.28-11-generic
396.4GB: initrd.img
396.4GB: vmlinuz
----------------------------

Anybody have any suggestions, other than starting over from scratch??? To recap, my primary IDE channel crapped out, so I am running the disk from the second IDE channel.

Anything I can do now?

Anfanglir
May 22nd, 2009, 08:02 PM
Thanks catlett,
those instructions got my jaunty partition up and running again (boot menu disapeared after reverting from Windows7 RC2 to Vista on windows partition).

/ Anfanglir

kc8hr
May 30th, 2009, 01:16 AM
Hi Guys,

I have an interesting problem:

The first IDE channel on my motherboard died, so I moved my Ubuntu Hardy installation to the second IDE channel. Now all I get is an 'error 15'. I tried using the method described to reinstall grub, but it still won't boot.

What do I do to get the system up and running again? I am damned tired--but very thankful--of booting from my LiveCD.

Thanks,
Tim

Problem solved--cleared the BIOS, primary IDE channel came back.

Oh well.....
](*,)

talsemgeest
June 12th, 2009, 09:46 PM
find /boot/grub/stag1

This command is resulting can not find the file. what'd i do for this?
It should be
find /boot/grub/stage1

Note the "e" missing from your post.

WJRobbins
June 19th, 2009, 06:46 PM
Just wanted to say "Thanks!" for this post. I'd well farked up my Netbook and cruised the forums for hours before finding this one that actually had the correct GRUB sntax!

Thanks for the relief from my self-imposed stress! :)

tommytomato
June 20th, 2009, 10:25 AM
I had the grub problem for a few days now with no fix yet

I have two hard drives, both around the same size

I know my OS is there because I've used today after loading a XP disk in, so I downloaded the super grub program and that got my grub working to boot back into Ubuntu, now I have the same problem grub wont allow me to boot into windows, it just hangs there with a message saying


Starting up...

Here is my sudo fdisk -l


Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x0008195a

Device Boot Start End Blocks Id System
/dev/sda1 * 1 29698 238549153+ 83 Linux
/dev/sda2 29699 30401 5646847+ 5 Extended
/dev/sda5 29699 30401 5646816 82 Linux swap / Solaris

Disk /dev/sdb: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x2052474d

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 30400 244187968+ 7 HPFS/NTFS


Now I ran this to recheck things
grub-install --recheck /dev/sda

And I get


# grub-install --recheck /dev/sda
Probing devices to guess BIOS drives. This may take a long time.
Searching for GRUB installation directory ... found: /boot/grub
Installing GRUB to /dev/sda as (hd0)...
Installation finished. No error reported.
This is the contents of the device map /boot/grub/device.map.
Check if this is correct or not. If any of the lines is incorrect,
fix it and re-run the script `grub-install'.

(fd0) /dev/fd0
(hd0) /dev/sda
(hd1) /dev/sdb

I'm at a lost any one care to help me out please

TT

C0NSTANTIN
June 20th, 2009, 11:50 AM
sudo mount -t ext4 dev/sda6 /mnt/root
mount: special device dev/sda6 does not exist

my problem:
http://ubuntuforums.org/showthread.php?t=1192050

dnairb
June 20th, 2009, 11:52 AM
That should read:


sudo mount -t ext3 /dev/sda6 /mnt/root

Note the leading "/" in "/dev/sda6"

C0NSTANTIN
June 20th, 2009, 12:14 PM
That should read:


sudo mount -t ext3 /dev/sda6 /mnt/rootNote the leading "/" in "/dev/sda6"

this is a direct copy/paste from my terminal


ubuntu@ubuntu:~$ sudo mount -t ext4 /dev/sda6 /mnt/root
mount: special device /dev/sda6 does not exist
ubuntu@ubuntu:~$

unutbu
June 20th, 2009, 01:17 PM
tommytomato, please run
boot_info_script (http://ubuntuforums.org/showpost.php?p=6725571&postcount=3)
and post the RESULTS.txt file here.

valikor
June 20th, 2009, 01:38 PM
grub> find /boot/grub/stage1

Error 15: File not found




What should I do? :/

Messyhair42
June 21st, 2009, 05:32 AM
grub> find /boot/grub/stage1

Error 15: File not found




What should I do? :/


I'm getting the same error. i'm using a Heron CD to install GRUB in an Intrepid installation. LiveCD's dont recognize my HD and apparantly it doesn't have a boot sector.

this is only to get a working computer while i send a HD into be replaced. it is possible to install grub to a thumb drive and boot with that?

C0NSTANTIN
June 21st, 2009, 05:03 PM
I'm getting the same error. i'm using a Heron CD to install GRUB in an Intrepid installation. LiveCD's dont recognize my HD and apparantly it doesn't have a boot sector.

this is only to get a working computer while i send a HD into be replaced. it is possible to install grub to a thumb drive and boot with that?


same error here as well ...

the kernel does not seem to recognize my sata2 .. :(

jayg1169
June 24th, 2009, 02:08 PM
Worked like a charm! thanks :guitar:

mrmas
July 3rd, 2009, 04:58 AM
Hi,

As per usual etiquette, I will state that I am complete Ubuntu/linux noob. I have an old machine with an existing XP installation, which I would like to keep. So I try and dual boot the two OS, the BIOS is setup in RAID 1 configuration which has made things a little tricky.

No problems found the following following guide FakeRaidHowto (https://help.ubuntu.com/community/FakeRaidHowto#Alternate CD Installation), issues arises though when I try and edit the grub configuration.


[ 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> find /boot/dev/stage1

Error 15: File not found

grub> find /boot/grub/stage1
(hd0,2)
(hd1,2)

grub> find /boot/grub/stage2
(hd0,2)
(hd1,2)

grub> root (hd0,2) (hd1,2)

grub> setup (hd0,2) (hd1,2)
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 (hd0,2)"... failed (this is not fatal)
Running "embed /boot/grub/e2fs_stage1_5 (hd1,2)"... failed (this is not fatal)
Running "install /boot/grub/stage1 d (hd0,2) /boot/grub/stage2 p /boot/grub/menu.
lst "... failed

Error 22: No such partition

grub>



Even if I just use the one partition e.g. setup (hd0,2) I get the same error message. That said using setup(hd0) works but when I reboot I get the menu but Windows does not boot, get binary digits on my screen. And Ubuntu givers me an Error 17 message when selected from the GRUB menu.

Any assistance would be greatly appreciated.

unutbu
July 3rd, 2009, 12:58 PM
mrmas, I don't know much about RAID, so I could easily be wrong, but according to
https://help.ubuntu.com/community/FakeRaidHowto#Alternate%20CD%20Installation
it appears you should be running


device (hd0) /dev/mapper/via_hfciifae

where /dev/mapper/via_hfciifae is the mount point of your RAID array.

Then


root (hd0,Y)

(Change Y as appropriate).


setup (hd0)

To find Y, Read the section entitled "Set Up the Bootloader for RAID" and in particular the paragraph that begins wih "This is one of the most common sources of error" in
https://help.ubuntu.com/community/FakeRaidHowto#Alternate CD Installation.

mrmas
July 4th, 2009, 02:24 AM
Thanks very much, it's working I am so chuffed. :popcorn:

Another question, if I may, currently the GRUB menu is not being displayed by default i.e. I have to press escape to display it. How do I get it to display by default?

unutbu
July 4th, 2009, 02:35 AM
I'm happy to hear you got GRUB working.
To make the GRUB menu appear automatically, edit /etc/menu.lst:


gksu gedit /etc/menu.lst

and change


hiddenmenu

to


#hiddenmenu

mrmas
July 4th, 2009, 02:53 AM
That worked too, thanks for all your help.

imtimez
July 5th, 2009, 04:15 PM
I just installed ubuntu on a laptop and using it for the first time but when I try to boot into winxp I get


Error 12: Invalid device requested

Disk /dev/sda: 40.0 GB, 40007761920 bytes
240 heads, 63 sectors/track, 5168 cylinders
Units = cylinders of 15120 * 512 = 7741440 bytes
Device Boot Start End Blocks Id System
/dev/sda1 2 5140 38850840 f W95 Ext'd (LBA)
/dev/sda2 1 1 7528+ 82 Linux swap / Solaris
/dev/sda4 5141 5168 211680 82 Linux swap / Solaris
/dev/sda5 * 2 2363 17856688+ 7 HPFS/NTFS
/dev/sda6 2364 5018 20071768+ 83 Linux
/dev/sda7 5019 5140 922288+ 82 Linux swap / Solaris

I modified menu.lst and it looks like this:
root (hd0,5)
savedefault
makeactive
chainloader +1

Please help. I don't know what else to do.

TIA

unutbu
July 5th, 2009, 07:00 PM
imtimez, GRUB counts partitions starting at 0, not 1. Therefore,
(hd0,5) is GRUB-talk for /dev/sda6.
Your Windows partition looks to be /dev/sda5 (i.e. (hd0,4).)

So while booted into Ubuntu, open a terminal (Applications>Accessories>Terminal) and type


gksu gedit /boot/grub/menu.lst

This will open a text editor with root privileges. In the boot stanza for Windows, change


root (hd0,5)
savedefault
makeactive
chainloader +1

to


root (hd0,4)
savedefault
makeactive
chainloader +1

Then save and exit gedit. Reboot and see if you can boot Windows.

If it does not work, please run boot_info_script (http://ubuntuforums.org/showpost.php?p=6725571&postcount=3) and post the RESULTS.txt file here so we can have a clearer view of you boot setup.

imtimez
July 5th, 2009, 10:31 PM
imtimez, GRUB counts partitions starting at 0, not 1. Therefore,
(hd0,5) is GRUB-talk for /dev/sda6.
Your Windows partition looks to be /dev/sda5 (i.e. (hd0,4).)

So while booted into Ubuntu, open a terminal (Applications>Accessories>Terminal) and type


gksu gedit /boot/grub/menu.lstThis will open a text editor with root privileges. In the boot stanza for Windows, change


root (hd0,5)
savedefault
makeactive
chainloader +1to


root (hd0,4)
savedefault
makeactive
chainloader +1Then save and exit gedit. Reboot and see if you can boot Windows.

If it does not work, please run boot_info_script (http://ubuntuforums.org/showpost.php?p=6725571&postcount=3) and post the RESULTS.txt file here so we can have a clearer view of you boot setup.

Thanks for taking the time to reply. I tried the suggestion you provided but that didn't work. Below is the results.txt


============================= Boot Info Summary: ==============================

=> Grub0.97 is installed in the MBR of /dev/sda and looks on the same drive
in partition #6 for /boot/grub/stage2 and /boot/grub/menu.lst.

sda1: __________________________________________________ _______________________

File system: Extended Partition
Boot sector type: -
Boot sector info:

sda5: __________________________________________________ _______________________

File system: ntfs
Boot sector type: Windows XP
Boot sector info: According to the info in the boot sector, sda5 starts
at sector 63.
Operating System: Windows XP
Boot files/dirs:

sda6: __________________________________________________ _______________________

File system: ext3
Boot sector type: -
Boot sector info:
Operating System: Ubuntu 9.04
Boot files/dirs: /boot/grub/menu.lst /etc/fstab

sda7: __________________________________________________ _______________________

File system: swap
Boot sector type: -
Boot sector info:

sda2: __________________________________________________ _______________________

File system: swap
Boot sector type: -
Boot sector info:

sda4: __________________________________________________ _______________________

File system: swap
Boot sector type: Unknown
Boot sector info:

=========================== Drive/Partition Info: =============================

Drive: sda ___________________ __________________________________________________ ___

Disk /dev/sda: 40.0 GB, 40007761920 bytes
240 heads, 63 sectors/track, 5168 cylinders, total 78140160 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x24af24ae

Partition Boot Start End Size Id System

/dev/sda1 15,120 77,716,799 77,701,680 f W95 Ext d (LBA)
/dev/sda5 * 15,183 35,728,559 35,713,377 7 HPFS/NTFS
/dev/sda6 35,728,623 75,872,159 40,143,537 83 Linux
/dev/sda7 75,872,223 77,716,799 1,844,577 82 Linux swap / Solaris
/dev/sda2 63 15,119 15,057 82 Linux swap / Solaris
/dev/sda4 77,716,800 78,140,159 423,360 82 Linux swap / Solaris


blkid -c /dev/null: __________________________________________________ __________

/dev/loop0: TYPE="squashfs"
/dev/sda2: UUID="75dd87f4-15c5-4f05-9754-dab5293ec5e8" TYPE="swap"
/dev/sda4: TYPE="swap"
/dev/sda5: UUID="101827F31827D68E" TYPE="ntfs"
/dev/sda6: UUID="b0f09546-55d6-414a-a536-f932777f6415" SEC_TYPE="ext2" TYPE="ext3"
/dev/sda7: UUID="5a439a2f-f9c4-4f03-966f-2aab06570b23" TYPE="swap"
/dev/ramzswap0: TYPE="swap"

=============================== "mount" output: ===============================

proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
tmpfs on /lib/modules/2.6.28-11-generic/volatile type tmpfs (rw,mode=0755)
tmpfs on /lib/modules/2.6.28-11-generic/volatile type tmpfs (rw,mode=0755)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
varrun on /var/run type tmpfs (rw,nosuid,mode=0755)
varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
rootfs on / type rootfs (rw)
/dev/sr0 on /cdrom type iso9660 (ro,noatime)
/dev/loop0 on /rofs type squashfs (ro,noatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
gvfs-fuse-daemon on /home/ubuntu/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=ubuntu)


=========================== sda6/boot/grub/menu.lst: ===========================

# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not use 'savedefault' or your
# array will desync and will not let you boot your system.
default 0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 10

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu

# Pretty colours
#color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=b0f09546-55d6-414a-a536-f932777f6415 ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=b0f09546-55d6-414a-a536-f932777f6415

## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash

## should update-grub lock old automagic boot options
## e.g. lockold=false
## lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all

## specify if running in Xen domU or have grub detect automatically
## update-grub will ignore non-xen kernels when running in domU and vice versa
## e.g. indomU=detect
## indomU=true
## indomU=false
# indomU=detect

## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

## ## End Default Options ##

title Ubuntu 9.04, kernel 2.6.28-13-generic
uuid b0f09546-55d6-414a-a536-f932777f6415
kernel /boot/vmlinuz-2.6.28-13-generic root=UUID=b0f09546-55d6-414a-a536-f932777f6415 ro quiet splash
initrd /boot/initrd.img-2.6.28-13-generic
quiet

title Ubuntu 9.04, kernel 2.6.28-13-generic (recovery mode)
uuid b0f09546-55d6-414a-a536-f932777f6415
kernel /boot/vmlinuz-2.6.28-13-generic root=UUID=b0f09546-55d6-414a-a536-f932777f6415 ro single
initrd /boot/initrd.img-2.6.28-13-generic

title Ubuntu 9.04, kernel 2.6.28-11-generic
uuid b0f09546-55d6-414a-a536-f932777f6415
kernel /boot/vmlinuz-2.6.28-11-generic root=UUID=b0f09546-55d6-414a-a536-f932777f6415 ro quiet splash
initrd /boot/initrd.img-2.6.28-11-generic
quiet

title Ubuntu 9.04, kernel 2.6.28-11-generic (recovery mode)
uuid b0f09546-55d6-414a-a536-f932777f6415
kernel /boot/vmlinuz-2.6.28-11-generic root=UUID=b0f09546-55d6-414a-a536-f932777f6415 ro single
initrd /boot/initrd.img-2.6.28-11-generic

title Ubuntu 9.04, memtest86+
uuid b0f09546-55d6-414a-a536-f932777f6415
kernel /boot/memtest86+.bin
quiet

title Microsoft Windows XP
root (hd0,4)
savedefault
makeactive
chainloader +1

### END DEBIAN AUTOMAGIC KERNELS LIST

=============================== sda6/etc/fstab: ===============================

# /etc/fstab: static file system information.
#
# Use 'vol_id --uuid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
# / was on /dev/sda6 during installation
UUID=b0f09546-55d6-414a-a536-f932777f6415 / ext3 relatime,errors=remount-ro 0 1
# swap was on /dev/sda7 during installation
UUID=5a439a2f-f9c4-4f03-966f-2aab06570b23 none swap sw 0 0
/dev/scd0 /media/cdrom0 udf,iso9660 user,noauto,exec,utf8 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto,exec,utf8 0 0

=================== sda6: Location of files loaded by Grub: ===================


28.8GB: boot/grub/menu.lst
28.8GB: boot/grub/stage2
28.8GB: boot/initrd.img-2.6.28-11-generic
28.8GB: boot/initrd.img-2.6.28-13-generic
28.7GB: boot/vmlinuz-2.6.28-11-generic
28.8GB: boot/vmlinuz-2.6.28-13-generic
28.8GB: initrd.img
28.8GB: initrd.img.old
28.8GB: vmlinuz
28.7GB: vmlinuz.old
=========================== Unknown MBRs/Boot Sectors/etc =======================

Unknown BootLoader on sda4

00000000 33 c0 8e d0 bc 00 7c fb 50 07 50 1f fc be 1b 7c |3.....|.P.P....||
00000010 bf 1b 06 50 57 b9 e5 01 f3 a4 cb bd be 07 b1 04 |...PW...........|
00000020 38 6e 00 7c 09 75 13 83 c5 10 e2 f4 cd 18 8b f5 |8n.|.u..........|
00000030 83 c6 10 49 74 19 38 2c 74 f6 a0 b5 07 b4 07 8b |...It.8,t.......|
00000040 f0 ac 3c 00 74 fc bb 07 00 b4 0e cd 10 eb f2 88 |..<.t...........|
00000050 4e 10 e8 46 00 73 2a fe 46 10 80 7e 04 0b 74 0b |N..F.s*.F..~..t.|
00000060 80 7e 04 0c 74 05 a0 b6 07 75 d2 80 46 02 06 83 |.~..t....u..F...|
00000070 46 08 06 83 56 0a 00 e8 21 00 73 05 a0 b6 07 eb |F...V...!.s.....|
00000080 bc 81 3e fe 7d 55 aa 74 0b 80 7e 10 00 74 c8 a0 |..>.}U.t..~..t..|
00000090 b7 07 eb a9 8b fc 1e 57 8b f5 cb bf 05 00 8a 56 |.......W.......V|
000000a0 00 b4 08 cd 13 72 23 8a c1 24 3f 98 8a de 8a fc |.....r#..$?.....|
000000b0 43 f7 e3 8b d1 86 d6 b1 06 d2 ee 42 f7 e2 39 56 |C..........B..9V|
000000c0 0a 77 23 72 05 39 46 08 73 1c b8 01 02 bb 00 7c |.w#r.9F.s......||
000000d0 8b 4e 02 8b 56 00 cd 13 73 51 4f 74 4e 32 e4 8a |.N..V...sQOtN2..|
000000e0 56 00 cd 13 eb e4 8a 56 00 60 bb aa 55 b4 41 cd |V......V.`..U.A.|
000000f0 13 72 36 81 fb 55 aa 75 30 f6 c1 01 74 2b 61 60 |.r6..U.u0...t+a`|
00000100 6a 00 6a 00 ff 76 0a ff 76 08 6a 00 68 00 7c 6a |j.j..v..v.j.h.|j|
00000110 01 6a 10 b4 42 8b f4 cd 13 61 61 73 0e 4f 74 0b |.j..B....aas.Ot.|
00000120 32 e4 8a 56 00 cd 13 eb d6 61 f9 c3 49 6e 76 61 |2..V.....a..Inva|
00000130 6c 69 64 20 70 61 72 74 69 74 69 6f 6e 20 74 61 |lid partition ta|
00000140 62 6c 65 00 45 72 72 6f 72 20 6c 6f 61 64 69 6e |ble.Error loadin|
00000150 67 20 6f 70 65 72 61 74 69 6e 67 20 73 79 73 74 |g operating syst|
00000160 65 6d 00 4d 69 73 73 69 6e 67 20 6f 70 65 72 61 |em.Missing opera|
00000170 74 69 6e 67 20 73 79 73 74 65 6d 00 00 00 00 00 |ting system.....|
00000180 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000001b0 00 00 00 00 00 2c 44 63 00 00 00 00 00 00 00 00 |.....,Dc........|
000001c0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 |................|
*
000001f0 00 00 00 00 00 00 00 00 00 00 00 00 00 00 55 aa |..............U.|
00000200

unutbu
July 6th, 2009, 01:03 PM
imtimez, I think your boot problem is almost identical to
http://ubuntuforums.org/showthread.php?t=1123109

In particular, look at this post:
http://ubuntuforums.org/showpost.php?p=7056119&postcount=10

Try that and let us know how it goes.

imtimez
July 7th, 2009, 12:01 AM
imtimez, I think your boot problem is almost identical to
http://ubuntuforums.org/showthread.php?t=1123109

In particular, look at this post:
http://ubuntuforums.org/showpost.php?p=7056119&postcount=10

Try that and let us know how it goes.

Thanks for trying but I am still getting the problem.

The first link you provided shows Vista and I'm assuming the command will not be valid for Windows XP.

For the second link, I couldn't find RebuildBS. The only option I have is:
[Dump]
[List] [Quit]

I didn't expect to run into this problem when I thought about trying out Ubuntu and am now afraid I will run into other problems.

javinoe
July 7th, 2009, 01:12 AM
work perfect for me

TurcoJC
July 16th, 2009, 04:15 PM
Thanks!! very useful!!

chanklor
July 17th, 2009, 10:41 PM
hello!
i removed the ubuntu partition directly from windows vista.
but, when tried to boot into windows again, nothing happened, there was just a black screen which said:

GRUB 1.5

Error 17

so i couldn't boot to windows vista.

and thats how i came across this post, so i could reinstall GRUB.

but, when i follow the steps, when i'm in

grub> find boot/grub/stage1

instead of showing the hard disk and partitions it prints the following message

Error 15: File not found.

What does it mean? what is wrong?

i'm writing this using an Ubuntu LiveCD and this is a Compaq Presario V3000 Laptop.

Any help would be highly apprectiated!

Thanks.

unutbu
July 18th, 2009, 12:21 AM
chanklor, GRUB reads files in your ubuntu partition (such as /boot/grub/menu.lst and stage2) during the boot process. Since you've removed the ubuntu partition, GRUB is no longer viable.

To regain the ability to boot Vista, you'll need to restore the default Vista MBR (master boot record). Here are instructions on how to do that:

http://ubuntuforums.org/showthread.php?t=740221

izint
July 19th, 2009, 03:00 AM
just trying to make sure if im looking at the right thread
so my comp came with Vista, then I installed ubuntu into a partition
then i reformatted Vista, now there is no menu and i cannot get back into my ubuntu partition, but vista works fine

windows is in sda1
ubuntu is in sda2

this thread about getting back grub is to fix this problem right?
if so, the find /boot/grub/stage1 does not work , error cannot find
I also tried the mounting part but I also get some errors cannot mount,
sudo mount -t proc none /mnt/root/proc
i tried just skipping the find, doing root (hda0,0) , root (hda0,1) and tried setup(hd0) but it says
Error 17: cannot mount selected partition

i read about the first 20 pages but nothing seems to help

i also looked into the partition hard drive, /boot/grub/ but i see default, menu.lst and device.map iono whats wrong but hope soemoen can help me, so i can get back into my ubuntu partition

unutbu
July 19th, 2009, 03:05 AM
izint, please run boot_info_script (http://ubuntuforums.org/showpost.php?p=6725571&postcount=3) and post the RESULTS.txt file here.

izint
July 19th, 2009, 03:09 AM
Heres the results, btw i am running the ubuntu livecd from a usbflash drive which i dont know if it affects anything than using a actual cd (since my dvd drive is broken (laptop) and doesnt read/burn cds for some reason)

============================= Boot Info Summary: ==============================

=> Windows is installed in the MBR of /dev/sda
=> Syslinux is installed in the MBR of /dev/sdb

sda1: __________________________________________________ _______________________

File system: ntfs
Boot sector type: Windows Vista
Boot sector info: No errors found in the Boot Parameter Block.
Operating System: Windows Vista
Boot files/dirs: /bootmgr /Boot/BCD /Windows/System32/winload.exe

sda2: __________________________________________________ _______________________

File system: ntfs
Boot sector type: Windows Vista
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files/dirs: /ubuntu/disks/boot/grub/menu.lst
/ubuntu/winboot/menu.lst /ubuntu/winboot/wubildr.mbr
/ubuntu/disks/root.disk

sdb1: __________________________________________________ _______________________

File system: vfat
Boot sector type: Fat32
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files/dirs:

=========================== Drive/Partition Info: =============================

Drive: sda ___________________ __________________________________________________ ___

Disk /dev/sda: 120.0 GB, 120034123776 bytes
255 heads, 63 sectors/track, 14593 cylinders, total 234441648 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x6e236e23

Partition Boot Start End Size Id System

/dev/sda1 * 63 216,909,629 216,909,567 7 HPFS/NTFS
/dev/sda2 216,909,824 234,438,655 17,528,832 7 HPFS/NTFS


Drive: sdb ___________________ __________________________________________________ ___

Disk /dev/sdb: 1021 MB, 1021125120 bytes
32 heads, 63 sectors/track, 989 cylinders, total 1994385 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0xa87e3b4b

Partition Boot Start End Size Id System

/dev/sdb1 * 247 1,993,823 1,993,577 6 FAT16


blkid -c /dev/null: __________________________________________________ __________

/dev/loop0: TYPE="squashfs"
/dev/sda1: UUID="0EFE1F53FE1F3287" LABEL="Local Disk" TYPE="ntfs"
/dev/sda2: UUID="AE80633680630465" TYPE="ntfs"
/dev/sdb1: SEC_TYPE="msdos" UUID="B288-271C" TYPE="vfat"

=============================== "mount" output: ===============================

proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
tmpfs on /lib/modules/2.6.28-11-generic/volatile type tmpfs (rw,mode=0755)
tmpfs on /lib/modules/2.6.28-11-generic/volatile type tmpfs (rw,mode=0755)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
varrun on /var/run type tmpfs (rw,nosuid,mode=0755)
varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
rootfs on / type rootfs (rw)
/dev/sdb1 on /cdrom type vfat (rw,fmask=0022,dmask=0022,codepage=cp437,iocharset =iso8859-1)
/dev/loop0 on /rofs type squashfs (ro,noatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
gvfs-fuse-daemon on /home/ubuntu/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=ubuntu)
/dev/sda2 on /media/disk type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)
/dev/sda1 on /media/Local Disk type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)
/dev/sda2 on /mnt/root type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)


==================== sda2/ubuntu/disks/boot/grub/menu.lst: ====================

# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not use 'savedefault' or your
# array will desync and will not let you boot your system.
default 0

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 3

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
hiddenmenu

# Pretty colours
#color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=AE80633680630465 loop=/ubuntu/disks/root.disk ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=()/ubuntu/disks

## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash

## should update-grub lock old automagic boot options
## e.g. lockold=false
## lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all

## specify if running in Xen domU or have grub detect automatically
## update-grub will ignore non-xen kernels when running in domU and vice versa
## e.g. indomU=detect
## indomU=true
## indomU=false
# indomU=detect

## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

## ## End Default Options ##

title Ubuntu 9.04, kernel 2.6.28-11-generic
root ()/ubuntu/disks
kernel /boot/vmlinuz-2.6.28-11-generic root=UUID=AE80633680630465 loop=/ubuntu/disks/root.disk ro quiet splash
initrd /boot/initrd.img-2.6.28-11-generic

title Ubuntu 9.04, kernel 2.6.28-11-generic (recovery mode)
root ()/ubuntu/disks
kernel /boot/vmlinuz-2.6.28-11-generic root=UUID=AE80633680630465 loop=/ubuntu/disks/root.disk ro single
initrd /boot/initrd.img-2.6.28-11-generic

title Ubuntu 9.04, memtest86+
root ()/ubuntu/disks
kernel /boot/memtest86+.bin

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title Other operating systems:
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda1
title Windows Vista (loader)
rootnoverify (hd0,0)
savedefault
chainloader +1


======================== sda2/ubuntu/winboot/menu.lst: ========================

debug off
hiddenmenu
default 0
timeout 0
fallback 1

title find /ubuntu/disks/boot/grub/menu.lst
find --set-root --ignore-floppies /ubuntu/disks/boot/grub/menu.lst
configfile /ubuntu/disks/boot/grub/menu.lst

title find /ubuntu/install/boot/grub/menu.lst
fallback 2
find --set-root --ignore-floppies /ubuntu/install/boot/grub/menu.lst
configfile /ubuntu/install/boot/grub/menu.lst

title find /menu.lst
fallback 3
find --set-root --ignore-floppies /menu.lst
configfile /menu.lst

title find /boot/grub/menu.lst
fallback 4
find --set-root --ignore-floppies /boot/grub/menu.lst
configfile /boot/grub/menu.lst

title find /grub/menu.lst
fallback 5
find --set-root --ignore-floppies /grub/menu.lst
configfile /grub/menu.lst

title commandline
commandline

title reboot
reboot

title halt
halt

================================== sda2Wubi: ==================================

Operating System: "Ubuntu 9.04"

# /etc/fstab: static file system information.
#
# Use 'vol_id --uuid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
/host/ubuntu/disks/root.disk / ext3 loop,errors=remount-ro 0 1
/host/ubuntu/disks/boot /boot none bind 0 0
/host/ubuntu/disks/swap.disk none swap loop,sw 0 0

=================== sda2: Location of files loaded by Grub: ===================


116.8GB: ubuntu/disks/boot/grub/menu.lst
115.5GB: ubuntu/disks/boot/initrd.img-2.6.28-11-generic
116.7GB: ubuntu/disks/boot/vmlinuz-2.6.28-11-generic

unutbu
July 19th, 2009, 03:42 AM
Oi, I've tried to do some research on how GRUB is used to boot Wubi, izint,
but I didn't find anything useful. I don't know enough about Wubi to help you.
The reason why the commands in this thread do not work for you is because they assume
you have Ubuntu installed in its own partition, not inside a file in an NTFS partition.

I'm not even sure that GRUB is the right tool for booting Wubi.

Hopefully another forums reader with more knowledge can step in.

izint
July 19th, 2009, 03:53 AM
Oi, I've tried to do some research on how GRUB is used to boot Wubi, izint,
but I didn't find anything useful. I don't know enough about Wubi to help you.
The reason why the commands in this thread do not work for you is because they assume
you have Ubuntu installed in its own partition, not inside a file in an NTFS partition.

I'm not even sure that GRUB is the right tool for booting Wubi.

Hopefully another forums reader with more knowledge can step in.

oOo, i c, hope someone knows how to fix this, I dunno much about computers, but I should start learning more -_- since I'm a computer science/engineering major

Abdus
July 21st, 2009, 12:23 AM
Any help on how to make GRUB refresh the list of partitions/systems? I posted this question here, no answer:
http://ubuntuforums.org/showthread.php?p=7647675#post7647675

unutbu
July 21st, 2009, 03:20 AM
Abdus, each time you install an Ubuntu distribution and allow it to install grub, it scans your system for operating systems and writes a GRUB menu.lst which lists a boot option for each OS found.

The same would be true of most major Linux distros (Fedora, SUSE, etc).

So if you allow the last Linux distro to install GRUB to the MBR, you should be all set.
GRUB would read the /boot/grub/menu.lst in that last Linux distro's partition and you should see a boot option for each OS on your system.

If you want to regenerate the /boot/grub/menu.lst, then the command you looking for is


sudo update-grub

If you can not boot Ubuntu directly but can boot from a LiveCD, then you can generate the menu.lst by doing the following:

Boot from the Ubuntu LiveCD
Open a terminal (Applications>Accessories>Terminal). Type


sudo mount /dev/sda5 /mnt

Change sda5 to the correct name for your Linux root partition. If you have multiple Linux OSes installed, you must name the Linux root partition that is controlling the boot process. Usually that would be the last OS you installed.

Then type:


cd /mnt
sudo mount --bind {/,}proc
sudo mount --bind {/,}sys
sudo mount --bind {/,}dev
sudo chroot /mnt
grep -v rootfs /proc/mounts > /etc/mtab
update-grub

Abdus
July 21st, 2009, 11:15 AM
Abdus, each time you install an Ubuntu distribution and allow it to install grub, it scans your system for operating systems and writes a GRUB menu.lst which lists a boot option for each OS found.

The same would be true of most major Linux distros (Fedora, SUSE, etc).

So if you allow the last Linux distro to install GRUB to the MBR, you should be all set.
GRUB would read the /boot/grub/menu.lst in that last Linux distro's partition and you should see a boot option for each OS on your system.

I understand that, thank you. However it would feel much more safe to have the MBR managed only by one OS, i.e. my Ubuntu Jaunty, which is my main system, and the only one for everyday use. The other systems (windowses, linuxes) are just auxiliary, for testing purposes, and I don't want to let them manage my MBR for more than a few minutes reuired to restore it.


If you want to regenerate the /boot/grub/menu.lst, then the command you looking for is


sudo update-grub

This command did not reread the partitions/systems anew, it just restored the menu as it was before.


If you can not boot Ubuntu directly but can boot from a LiveCD, then you can generate the menu.lst by doing the following: [...]

After installing auxiliary OS's I restore my GRUB using the Ubuntu alternative installation CD, using the menu there ("install GRUB" or similar). This procedure works, however it just restores previous config instead of rereading patitions/systems anew. Would doing what you suggested by the GRUB console reread those?

Thanks for help!

unutbu
July 21st, 2009, 02:31 PM
Ah, I see. I think the Ubuntu installer has some kind of script to detect partitions containing operating systems and then generate the appropriate boot stanzas in menu.lst. I don't know enough about the Ubuntu installer to tell you how to rip out that script so that you may run it independently.

There is no GUI for doing this either, as far as I know.

However, it is not really very hard to edit the menu.lst manually.
While booted into your main Linux OS (Jaunty), mount the last installed Linux distro at, say, /mnt:


sudo mount /dev/sda? /mnt

(again change sda? to the appropriate name).

Then open an editor with root privileges:


gksu gedit /mnt/boot/grub/menu.lst

and open your "controlling" menu.lst. (Click the "Open" button and open /boot/grub/menu.lst.)

Near the bottom of /mnt/boot/grub/menu.lst will be boot stanzas for each of your other operating systems. You can simply copy those stanzas and paste them into Jaunty's menu.lst.

Abdus
July 21st, 2009, 04:27 PM
That is an excellent tip, unutbu, thank you for it, I'll try it with no doubt! Are you sure that partitions UUIDs are same in both the linuxes on my machine though?

PS. I still find it unbelieevable that so well established and already old app as GRUB has no "rread" option. Amazing, isn't it? :)

Frynz Frostblade
July 22nd, 2009, 01:10 PM
this is it. thank you. u rock!!!

chanklor
July 24th, 2009, 02:07 AM
chanklor, GRUB reads files in your ubuntu partition (such as /boot/grub/menu.lst and stage2) during the boot process. Since you've removed the ubuntu partition, GRUB is no longer viable.

To regain the ability to boot Vista, you'll need to restore the default Vista MBR (master boot record). Here are instructions on how to do that:

http://ubuntuforums.org/showthread.php?t=740221

thanks a lot! exactly what i needed
thansk thanks thanks!

izint
July 24th, 2009, 05:29 AM
:/ anyone know how to fix my problem? frmo the previous page

kuppalli
July 24th, 2009, 10:03 PM
This worked with me.
Thanks a lot. :D


Please try the chroot grub-install and post what happens. Like I said I saw the how to when I didn't understand commands and never saw it again. Then I saw the grub manual describing the find, root, setup commands and I went with that.I think find, root, setup doesn't return the bios error because they are given from the grub shell.
Just for FYI, this is the error I get with grub-install from the live session.

ubuntu@ubuntu:~$ sudo grub-install /dev/hda
Probing devices to guess BIOS drives. This may take a long time.
Could not find device for /boot: Not found or not a block device.This is the output of find, root, setup


grub> find /boot/grub/stage1
(hd0,1)
(hd0,10)

grub> root (hd0,10)
Filesystem type is ext2fs, partition type 0x83

grub> setup (hd0)
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 (hd0)"... failed (this is not fatal)
Running "embed /boot/grub/e2fs_stage1_5 (hd0,10)"... failed (this is not fatal
)
Running "install /boot/grub/stage1 d (hd0) /boot/grub/stage2 p /boot/grub/menu
.lst "... succeeded
Done.

Vesperatus
July 27th, 2009, 07:58 PM
July 27,

A vista update seems to have eaten part of my grub. Anyway, with this post and the help of others, I got it working again.

If the original submitter still reads, adding how to find the (hdx,y) would help. The "find /boot/grub/stage1" is not working on my installation. I had to do : find "/grub/stage1" . Searching for /boot/grub/stage1 resulted in an Error 15 : File not found.

I suppose any combination of
/boot/stage1
/boot/grub/stage1
/grub/stage1
/stage1

might return something.

lmonast
July 31st, 2009, 03:06 PM
Dear ubuntuusers,
Please, I really need your help. I did exactly what the first post says:


sudo grub
find /boot/grub/stage1

I got : hd0,4. Then I entered

root (hd0,4)
setup (hd0)
quit

Everything went smooth and grub was there and working perfectly. HOWEVER, I had two installations of jaunty in my HD (please do not ask me why). Now Jaunty boots to the 2.2 gig installation and the 130 gig partition (with all my personal files!) has disappeared.
fdisk says this:



Disk /dev/sda: 320.0 GB, 320072933376 bytes
255 heads, 63 sectors/track, 38913 cylinders, total 625142448 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x365aa7a5

Device Boot Start End Blocks Id System
/dev/sda1 2048 33556479 16777216 27 Unknown
/dev/sda2 * 33556480 329177087 147810304 7 HPFS/NTFS
/dev/sda3 329177142 345293620 8058239+ 7 HPFS/NTFS
/dev/sda4 345301110 625137344 139918117+ 5 Extended
/dev/sda5 619916283 624783914 2433816 83 Linux
/dev/sda6 624783978 625137344 176683+ 82 Linux swap / Solaris


Gparted says that the 130 gig partition is "unallocated".
Is there a way to retrieve the files in the 130 g partition? Or did I mess everything up? I am a newbie, so please be gentle.
Many thanks.

unutbu
July 31st, 2009, 04:01 PM
lmonast, yes, it does look like you have a 130 GB partition missing.
Sometimes you can fix partition table problems with a program called testdisk.
It can search your hard drive for old partitions that have somehow gone awol.
To run it:

Boot Ubuntu
Open a terminal (Applications>Accessories>Terminal)
Type:


cd ~/Desktop
wget http://www.cgsecurity.org/testdisk-6.11.3.linux26.tar.bz2
tar xvjf testdisk*.tar.bz2
sudo testdisk-6.11.3/linux/testdisk_static

Select "No Log", "Proceed", "Intel", "Analyse", "Quick Search", "Deeper Search"
The Deeper Search may take some time.
Use the up/down arrows to move among your partitions.
Press 'p' to try to list files inside the partitions.
See if testdisk can find the missing 130 GB partition.
If it can, use the left/right arrow to change the partition type from "D" (for Delete) to "L" (for Logical partition).
Then write the new partition table to disk, and quit.

lmonast
July 31st, 2009, 06:36 PM
Dear unutbu,
Thank you very much!!! It works like a charm!
Yours sincerely,
Leo


lmonast, yes, it does look like you have a 130 GB partition missing.
Sometimes you can fix partition table problems with a program called testdisk.
It can search your hard drive for old partitions that have somehow gone awol.
To run it:

Boot Ubuntu
Open a terminal (Applications>Accessories>Terminal)
Type:


cd ~/Desktop
wget http://www.cgsecurity.org/testdisk-6.11.3.linux26.tar.bz2
tar xvjf testdisk*.tar.bz2
sudo testdisk-6.11.3/linux/testdisk_static

Select "No Log", "Proceed", "Intel", "Analyse", "Quick Search", "Deeper Search"
The Deeper Search may take some time.
Use the up/down arrows to move among your partitions.
Press 'p' to try to list files inside the partitions.
See if testdisk can find the missing 130 GB partition.
If it can, use the left/right arrow to change the partition type from "D" (for Delete) to "L" (for Logical partition).
Then write the new partition table to disk, and quit.

bubuzzz
August 3rd, 2009, 10:44 AM
hi, i have a funny problem here.

Last Saturday, i decided format my laptop and installed vista (very stupid decision) and ubuntu on it. And just after one day, vista crashed and automatically restarted everytime i log in. So i had to delete vista and installed xp back on that partition again. Of course, grub was deleted after that. So i followed the guide and every thing worked fine ( no error on the command line). However, the text on the starup screen of grub is still "Microsoft Vista (loader)" (which actually is XP). How can i change it back to "Microsoft XP" ???

Thank you

talsemgeest
August 3rd, 2009, 11:53 AM
hi, i have a funny problem here.

Last Saturday, i decided format my laptop and installed vista (very stupid decision) and ubuntu on it. And just after one day, vista crashed and automatically restarted everytime i log in. So i had to delete vista and installed xp back on that partition again. Of course, grub was deleted after that. So i followed the guide and every thing worked fine ( no error on the command line). However, the text on the starup screen of grub is still "Microsoft Vista (loader)" (which actually is XP). How can i change it back to "Microsoft XP" ???

Thank you
All you have to do is edit your menu.lst, something like:
gksudo gedit /boot/grub/menu.lstScroll down the the part where it says "Microsoft Vista (loader)", and change the text to say "Microsoft XP", or whatever else you want it to say. Save the file, then quit.

thisismespam
August 12th, 2009, 10:41 PM
Hello,

I have succesfully manage to destroy ubuntu,...
i have 1 HD
i have windows 7 and ubuntu installed

well the f*** grub booted ubuntu, but i didnt want to wait 10min until my old laptop is inside ubuntu, and then i pressed power,...and got error 17 on the next reboot

i have tried this:

sudo grub <<well this is working, after 5 min or so i was inside grub!

find /boot/grub/stage1
Error 15 file not found <<<guess this is not so good

find /boot/grub/stage2
Error 15 file not found

now Ithough lets test 3,4,5,...well nothing found

okey now lets try:

root (hd0,0)
setup (hd0)
Error 17


please i dont want to reinstall ubuntu,....it took ages to get all the hardware and pherihials running,....

well what should i do now,...use a hammer on my laptop maybe,buy a new one with windows 7,...

i know i had problem with boot loaders back in 1998 and so,....but 2009,....this is really annoying
-----------------------------------------------------------------------------------------------------------------------------------------
mbrfix?,...everyone leave the titanic?
-------------------------------------------------------
HERE IS THE SOLUTION THANK YOU SCOTTY:
http://ubuntuforums.org/showthread.php?t=5134&page=2

to fix error 17 in grub at boot time don't forget to try:

a. boot from any live CD (ubuntu install disk works for me)
b. open accessories->Terminal
c. in terminal type "sudo e2fsck -b 32768 /dev/hdaX

replace the hdaX in line above with the disk that you have your root mounted from
for example

sudo e2fsck -b 32768 /dev/hda2

in my case I have windows installed in /dev/hda1 and my root partition for ubuntu in at /dev/hda2
also if -b 32768 fails you can try other numbers including -b 8193 or -b 98304 or -b 163840....

wow this was easy

jedispork
August 19th, 2009, 09:19 PM
I have vista loaded first onto my ide drive which is hd1 on my system. I then install ubuntu to my secondary sata hard drive. I make a new partition on it and install ubuntu at hd0,4. Vista loaded and no sign of grub. So I use super grub disc so I can boot my new ubuntu install. I follow these steps

sudo grub
find /boot/grub/stage1
root (hd?,?)
setup (hd?)
quit

I've tried to setup on both hd0 and hd1. Grub loads but I get bootmgr missing when I try to load vista. The only way I could fix is to use bootrec on my vista install disc. After some reading I discover another program called easybcd. I configured it so ubuntu shows up in the windows boot manager which in turns loads grub so I can load ubuntu.

This seems to be working for now but what was I doing wrong? This has been a major deterrent for me to get started in linux. What can I do to get grub working the proper way? I don't understand why I'm having this issue and others aren't? Does it have anything to do with me using the eide drive as my primary windows install? My reason for that is because the sata drive is only 5400 rpm and originally intended as a backup.

thanks for any suggestions you can give

dwdarkstar
August 21st, 2009, 06:40 AM
picked up a refurbished 64bit ASUS laptop with an unofficial version of Vista, apparently was a floor model at Best Buy. installed 64bit 9.04 leaving Vista intact for DVDs. been a primary Ubuntu user for years, loaded all my stuff into the new system, got it set up nice, been running great for two weeks. tonight decided to watch Blow and booted into Vista which was listed as 'Vista Loader' twice in the Grub menu. should have known better... after a few seconds got a white screen with huge ERROR in red letters. now restart gives Grub Error 22. booted live CD and tried to fix via the usual threads, not much luck, and i haven't seen Ubuntu or Linux listed with any partition... i can wipe/reinstall clean but figured it was worth asking if i can salvage my system first.

ubuntu@ubuntu:~$ sudo grub
Probing devices to guess BIOS drives. This may take a long time.

[ 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> find /boot/grub/stage1
find /boot/grub/stage1

Error 15: File not found
grub> find /boot/dev/stage1
find /boot/dev/stage1

Error 15: File not found
grub> exit
exit

ubuntu@ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x97646c29

Device Boot Start End Blocks Id System
/dev/sda1 1 1402 11261533+ 1c Hidden W95 FAT32 (LBA)
/dev/sda2 * 1403 9010 61105148 7 HPFS/NTFS
/dev/sda3 9011 23509 116463217+ f W95 Ext'd (LBA)
/dev/sda5 16603 23509 55473148 7 HPFS/NTFS
ubuntu@ubuntu:~$


============================= Boot Info Summary: ==============================

=> Grub0.97 is installed in the MBR of /dev/sda and looks on the same drive
in partition #6 for /boot/grub/stage2 and /boot/grub/menu.lst.

sda1: __________________________________________________ _______________________

File system: vfat
Boot sector type: Vista: Fat 32
Boot sector info: No errors found in the Boot Parameter Block.
Operating System:
Boot files/dirs:

sda2: __________________________________________________ _______________________

File system: ntfs
Boot sector type: Windows Vista
Boot sector info: No errors found in the Boot Parameter Block.
Operating System: Windows Vista
Boot files/dirs: /bootmgr /Boot/BCD /Windows/System32/winload.exe

sda3: __________________________________________________ _______________________

File system: Extended Partition
Boot sector type: -
Boot sector info:

sda5: __________________________________________________ _______________________

File system: ntfs
Boot sector type: Windows Vista
Boot sector info: According to the info in the boot sector, sda5 starts
at sector 2048.
Operating System: Windows Vista
Boot files/dirs: /bootmgr /Boot/BCD /Windows/System32/winload.exe

=========================== Drive/Partition Info: =============================

Drive: sda ___________________ __________________________________________________ ___

Disk /dev/sda: 250.0 GB, 250059350016 bytes
255 heads, 63 sectors/track, 30401 cylinders, total 488397168 sectors
Units = sectors of 1 * 512 = 512 bytes
Disk identifier: 0x97646c29

Partition Boot Start End Size Id System

/dev/sda1 63 22,523,129 22,523,067 1c Hidden W95 FAT32 (LBA)
/dev/sda2 * 22,523,904 144,734,199 122,210,296 7 HPFS/NTFS
/dev/sda3 144,745,650 377,672,084 232,926,435 f W95 Ext d (LBA)
/dev/sda5 266,723,328 377,669,623 110,946,296 7 HPFS/NTFS


blkid -c /dev/null: __________________________________________________ __________

/dev/loop0: TYPE="squashfs"
/dev/sda1: LABEL="RECOVERY" UUID="D476-EF15" TYPE="vfat"
/dev/sda2: UUID="EC643B00643ACCD8" LABEL="Vista64" TYPE="ntfs"
/dev/sda5: UUID="16943E64943E4711" LABEL="DATA" TYPE="ntfs"

=============================== "mount" output: ===============================

proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
tmpfs on /lib/modules/2.6.28-11-generic/volatile type tmpfs (rw,mode=0755)
tmpfs on /lib/modules/2.6.28-11-generic/volatile type tmpfs (rw,mode=0755)
tmpfs on /lib/init/rw type tmpfs (rw,nosuid,mode=0755)
varrun on /var/run type tmpfs (rw,nosuid,mode=0755)
varlock on /var/lock type tmpfs (rw,noexec,nosuid,nodev,mode=1777)
udev on /dev type tmpfs (rw,mode=0755)
tmpfs on /dev/shm type tmpfs (rw,nosuid,nodev)
devpts on /dev/pts type devpts (rw,noexec,nosuid,gid=5,mode=620)
rootfs on / type rootfs (rw)
/dev/sr0 on /cdrom type iso9660 (ro,noatime)
/dev/loop0 on /rofs type squashfs (ro,noatime)
fusectl on /sys/fs/fuse/connections type fusectl (rw)
tmpfs on /tmp type tmpfs (rw,nosuid,nodev)
binfmt_misc on /proc/sys/fs/binfmt_misc type binfmt_misc (rw,noexec,nosuid,nodev)
gvfs-fuse-daemon on /home/ubuntu/.gvfs type fuse.gvfs-fuse-daemon (rw,nosuid,nodev,user=ubuntu)
/dev/sda5 on /media/root type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)
/dev/sda2 on /media/root type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)
/dev/sda1 on /mnt type vfat (rw)
/dev/sda2 on /mnt type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)
/dev/sda5 on /mnt type fuseblk (rw,nosuid,nodev,allow_other,blksize=4096)


=================== sda2: Location of files loaded by Grub: ===================


23.5GB: boot/grub/stage2

=================== sda5: Location of files loaded by Grub: ===================


148.5GB: boot/grub/stage2

thanxs

BadEyedia
August 22nd, 2009, 06:01 PM
One thing to note is that if your Ubuntu install is in a different partion, then you will need to mount the drive before the command will work.

harry2006
August 22nd, 2009, 06:26 PM
very nice and useful...

EABT
August 23rd, 2009, 04:36 PM
Thank you man i was having kinda of a hard time because of this problem:lolflag:

smacfarl
August 24th, 2009, 03:42 PM
So here is my little twist on the problem.

I partitioned the primary hard drive so that the first partition would be for windows and the second for linux. I installed Ubuntu 9.04 first, on the second partition from the LIVE CD. I installed "/" on the second partition, I assume this would include "/boot" and everything else, and created a third swap partition. After the install, the computer would not boot, "NTloader missing". Ubuntu clearly did not create the grub menu. I then installed windows onto the first partition. Windows boots.

I go in with a Live CD and sudo grub, etc. However on reboot, still no grub menu. I think this is because there was no grub menu after the initial Ubuntu Install. the find command when run in the grub console returns and hdx,x value, so I think this means it was installed in some fashion onto the Ubuntu partition.

What do I do to get a grub menu up so I can dual boot?

unutbu
August 24th, 2009, 04:54 PM
smacfarl, please run boot_info_script (http://ubuntuforums.org/showpost.php?p=6725571&postcount=3) and post the RESULTS.txt file so we can better understand your boot setup.

smacfarl
August 24th, 2009, 08:04 PM
Here is the attached results.txt

unutbu
August 24th, 2009, 08:52 PM
smacfarl, am I correct in understanding that currently you can boot Ubuntu, but that you do not get a GRUB menu, and no option to boot Windows?

If so, boot Ubuntu, open a terminal (Applications>Accessories>Terminal), and type


gksu gedit /boot/grub/menu.lst

Go down to line 23 and change


hiddenmenu

to


# hiddenmenu

This will make the GRUB menu visible at boot time.

Then go to the bottom of the file and add these lines:


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

This will add an option in your GRUB menu to boot Windows.

Save and exit the text editor. Reboot. See if you can boot Windows and Ubuntu now.

smacfarl
August 25th, 2009, 12:50 AM
Thanks, but that did not work. I think something has to be added to the primary partition by grub to make this all go.

When I created the windows partition and the linux partition before I put on windows, and then proceeded to install Ubuntu to first. Ubuntu was installed to the second partition, and so when it installed it did not create a startup grub menu as there was no other OS on the system. At that point, while Ubuntu was installed the computer would generate the "ntloader missing" message after boot. I then proceeded to put windows on the first partition, so the computer now of course boots to windows. My question is how do I get the part grub needs to boot to the linux partition on to the windows partition so the grub menu will come up?

unutbu
August 25th, 2009, 02:27 AM
You have successfully installed GRUB on to the MBR of sda. If the machine is not booting into Ubuntu, then it sounds like the BIOS is trying to boot sdb instead of sda.

Try going to the BIOS menu and changing the boot priority order so that sda boots before sdb.

Once you get Ubuntu to boot, try the directions in my previous post to get a GRUB menu, and the option to boot Windows.

smacfarl
August 25th, 2009, 04:09 AM
"You have successfully installed GRUB on to the MBR of sda"

I think that's the problem. I don't think this happened.

I have a primary partition. It has windows on it. It has no grub.

I have a secondary partition that has Ubuntu, and grub installed as would be normal for a linux partition. When you dual boot, you need some kind of grub files sitting on the primary partition somewhere so that it interrupts the boot process and gives you the menu.

How would i go about verifying the there is no grub stuff on the primary partition? And how do I get some on there? I thought the results.txt might indicate this situation.

as for sdb booting, no possible way.

kengele
September 11th, 2009, 05:55 PM
Guys, if your command of Linux is limited like me, and the instructions in this thread didn't work for you....

I came here on my first search after having the same problem:
I had Installed Windows XP on my laptop, then resized Windows (sda1) and partitioned the disk and installed Ubuntu 9.04 with a GRUB bootloader on its own partition (sda2). I have separate root and home partitions. It worked really well.

A week or two later I had major problems with my Windows so I re-installed Windows on the sda1 Windows partition.

The GRUB bootloader (sda2) didn't load. It would only load Windows. I couldn't load GRUB, so I started Ubuntu with a live CD, and I tried all your helpful advice (helpful in trying to understand how all this works), but whatever I did in the terminal, still only Windows loaded. :(

I began someone else's advice of going through the re-installing Ubuntu procedure with the live CD and un-ticking any format partition boxes in the partitioning part.... so making boot load on sda2, but soon realised my version of the live CD would probably re-partition the whole disk (as none of my original partitions showed up in the partitioner)...

My next search took me here https://help.ubuntu.com/community/RecoveringUbuntuAfterInstallingWindows
This has very clear instructions and worked like a dream. :D

I highly recommend it to anyone having difficulties with a similar problem!

shankhs
September 14th, 2009, 04:12 PM
I have ext4 should i use:

sudo mount -t ext3 /dev/sda6 /mnt/root

or

sudo mount -t ext3 /dev/sda6 /mnt/root

beacon
September 15th, 2009, 12:20 PM
I hope someone can help. I have read through this thread and many many others, but I am getting nowhere. I have two hard drives, one with Ubuntu and the other with PClos. Both are shown in the initial boot, but only Ubuntu can be accessed. There would seem to be something wrong with the grub settings, and I have followed all the instructions I can find with no joy. I think the grub settings also account for my difficulty in booting from a flash stick, but that is for another thread.

When I ask for stage 1, I get two listings: hd1,0 and hd0,4, I don't want the settings tied to a partition, do I, so I typed in hd0 for setup. There appears to be no change.

What am I missing or doing wrong?

With thanks,

serein
September 20th, 2009, 03:10 AM
I hope someone can help. I have read through this thread and many many others, but I am getting nowhere. I have two hard drives, one with Ubuntu and the other with PClos. Both are shown in the initial boot, but only Ubuntu can be accessed. There would seem to be something wrong with the grub settings, and I have followed all the instructions I can find with no joy. I think the grub settings also account for my difficulty in booting from a flash stick, but that is for another thread.

When I ask for stage 1, I get two listings: hd1,0 and hd0,4, I don't want the settings tied to a partition, do I, so I typed in hd0 for setup. There appears to be no change.

What am I missing or doing wrong?

With thanks,

and what's on your other harddrive? which one is no. 0 and which one is no. 1? have you edited /boot/grub/menu.lst
i'm guessing you dual boot with windows, then uncomment the windows section, it it isn't already uncommented...

and where did you write root? (root hd?,?)

beacon
September 21st, 2009, 11:42 AM
Thanks Serein. As I said in my first post, I have two linux distros (PClos and Ubuntu), as I never touch Windows. That is why some of the replies seem not to be applicable, as they are about dual-booting with Windows.

Since my initial query, I have made all kinds of attempts, usually messing up the system as a result, and have paid quite a good fee for help that didn't really solve the problem.

I have now two related questions. The first is what is meant by booting from the live CD. That is a command that is often suggested, but does that mean using the first option of 'trying without affecting the computer', or 'installing' (when it is alreay installed). I know this may seem a stupid query, but it does puzzle me.

Second, I have made some progress and have got Ubuntu on a flash drive, but when I boot from it, after asking for my languge, I am given the same options of 'trying without changing the system', 'installing', etc. The system doesn't really boot.

Thanks in advance for any help.

Teber
September 21st, 2009, 01:35 PM
i have no experience with ubuntu installed on usb stick whatsoever.

however, i can be of some help to you. the option 'trying without affecting the computer' is what is meant by booting the live cd. please note that from live cd you may still affect the computer! so do be careful! there is a general warning about executing terminal commands on this forum.

hope this helps a bit.

ranch hand
September 22nd, 2009, 12:09 AM
You really need to set your boot/root partition. You have grub on both your OS'. Pick one.


grub> root (hd0,4)
OR
grub. root (hd1,0)

This is the first command to follow "find". It is absolutely needed to give grub somewhere to read the menu and be controlled from.

Set up of your mbr {(hd0)} comes next, then "quit".

Make sure that which ever "menu.lst" you are using has the entry for each OS from its generated menu.lst (or make sure that the one in the menu.lst you are using is identical with the entry for the other OS' ientry for itself).

maruel
October 6th, 2009, 01:47 AM
Excellent! I'd got Error 22 and now I finally got everything nice and running!!

Thanks a lot! :KS

nievesalvarez
October 6th, 2009, 10:41 AM
Hello,

I read the comment.I am really searching for that code,and i am so pleased by having the perfect code here at the community.Thank you so much for sharing this comment with code.

beacon
October 6th, 2009, 02:39 PM
Dank u Teber. Sorry to take so long to write that. I have appreciated the suggestions by others and tried them all, but I'm still struggling.

Khushboo_khan
October 8th, 2009, 06:40 AM
I am new to Ubuntu, please help me how can i intall it?

talsemgeest
October 8th, 2009, 08:20 AM
I am new to Ubuntu, please help me how can i intall it?
https://help.ubuntu.com/community/Installation

Take a look there, that should answer your question.

Teber
October 8th, 2009, 10:13 AM
Dank u Teber. Sorry to take so long to write that. I have appreciated the suggestions by others and tried them all, but I'm still struggling.

my pleasure. hope you will resolve the issue soon.

kevinguillorytraining
October 10th, 2009, 05:45 AM
find /boot/grub/stag1
this command is resulting can not find the file
how can I resolve this issue?

ranch hand
October 10th, 2009, 05:52 AM
find /boot/grub/stag1
this command is resulting can not find the file
how can I resolve this issue?
You have a typo there.

It should be;

find /boot/grub/stage1

instead of stag1.

Stag1 is hard to find.

navneeth
October 16th, 2009, 07:29 PM
This is just a little Thank You note for catlett. The method, the original 5-step one, worked for me flawlessly.

Relying on another method that used the dd command, I thought I had messed up the ability to see my Ubuntu installation ever again until this method came to the rescue.

Specs:

Ubuntu 9.04 and Windows XP that really doesn't work (no surprises there, huh?)

I use two hard-drives. Master contains the XP and slave contains Linux.

Hardware: well, I prefer not to embarrass myself here. ;) ~5-year old stuff. Nothing special.

thelugnut
October 22nd, 2009, 09:20 AM
I have Windows Xp on one partition, Ubuntu 9.04 on another partition and an empty partition for testing other distributions and versions, betas and the like. I keep my data on another partition formatted to fat-32. Needless to say, things can really get fouled up playing around this way.

Before when things went toes up, I usually just grunted real loud and reinstalled Ubuntu. That took a lot of time due to the updates necessary after re-installing.

I had downloaded and installed Ubuntu 9.10 beta. Then when I was finished playing with it, I formatted the partition. Up, up, and away went GRUB. No panic this time. I followed the original sequence in this post and it worked without a hitch.

Many thanks to the originator as well as the many comments and suggestions that followed.:guitar:

K. Sayeed
October 23rd, 2009, 04:17 AM
I have installed 64 bit Ubuntu 9.04 on an internal drive on my computer.

My computer has three drives., two of which are internal SATA drives and one is an external SATA drive. One internal drive contains Linux 7.10, 64 bit.. I have the GRUB loader installed on this drive. The external SATA drive is used purely for data storage. I have been using this configuration for quite some time

The Ubuntu 9.04, 64 bit OS was installed today using the Ext4 file system on the second internal SATA drive. After installing and restarting the computer system, Ubuntu 9.04 did not show up on the GRUB menu even though I selected installation of GRUB during the OS install.

I immediately followed the procedure described by Catlett, very carefully, to re-install GRUB. This did not work because Ubuntu 9.04 was still not displayed in the GRUB menu on startup.

Any help in the solution of this problem will be much appreciated.

K. Sayeed

wvpv
October 25th, 2009, 08:25 AM
Thanks, this still works in jaunty too.

talsemgeest
October 25th, 2009, 10:13 AM
Unfortunately, because of Grub 2, this wont work in Ubuntu 9.10. If you need to reinstall the Ubuntu 9.10 bootloader, take a look here: http://ubuntuforums.org/showthread.php?p=6391959

Dan Again
October 27th, 2009, 09:51 PM
I seem to be able to run through this series of steps successfully, but then when I reboot my system the GRUB has not changed. Can someone help me?

Dan Again
October 28th, 2009, 05:33 PM
I am still having problems with this, which I have also outlined in this (http://ubuntuforums.org/showthread.php?t=1301718&page=2) thread. Is there anyone who can help?

sirugh
October 28th, 2009, 07:11 PM
I'm having a big issue with the grub bootloader. I'll go through the steps that I did to install the hard drive.

First I installed ubuntu from a minimal CD, to dev/sda1
After I installed, I was only able to boot into the os using the liveCD option boot from first hard disk and install gparted.

^^edit: I think the issue might have been somewhere in the install, because even though grub was installed and I could see the boot/grub files on sda1, I couldn't get it to boot right after the fresh install^^

Then I booted into a liveCD and shrank the partition to basically only fit the ubuntu install.

After I restarted, took out the liveCD, I still get the error

No boot device available
strike f1 to reboot, f2 to enter the setup utility

I've tried the steps in the op here, but I keep getting the same error. I've run out of ideas.

So to reiterate, my ubuntu partition(the only one on the hard drive) is set to /dev/sda1, is ext3, has a size of 2.71 GiB, used 2.68 Gib, and unused 34.41 MiB, with boot flag.

Any help would be appreciated!

Mr. Stabby
November 10th, 2009, 02:00 AM
I've screwed up my grub by deleting the Linux partition from the Windows partition manager. I tried to reinstall Linux, hoping that the grub would be fixed, but the reinstall failed about halfway through. From then on, it showed error 15 instead of error 22. I then booted from my Ubuntu live CD (it took several tries, for some reason) and tried the code posted on here. I started the the shell, and grub like the OP said, but when I searched for /boot/grub/stage1 it returned "error 15: file not found."

It seems that this problem was addressed by the second poster. I followed all of his instructions, but I have encountered a problem. When I try to chroot, there's an error saying "cannot run command '/bin/bash': No such file or directory." I typed in "find /bin/bash" and it just returned "/bin/bash." I even tried "mkdir /bin/bash" but it said "cannot create directory '/bin/bash': file exists." I tried to chroot again, but it still doesn't see /bin/bash for some reason.

I don't know what's going on. I don't really know anything about doing anything technical with the shell. Please help!

alexsmith
November 20th, 2009, 11:48 AM
Hi all!

I just ran into the same problem: XP overwritten my boot sector with s***...

Well, the steps I followed in order to recover it were:



mount /dev/sdb2 /mnt/root/
mount -t proc none /mnt/root/proc
mount -o bind /dev /mnt/root/dev
chroot /mnt/root/
grub-install /dev/sda


Note: sdb2 is the partition where I have linux root. You should substitute by your linux root partition.

Now I'm going to test it... ;)

alexsmith
November 20th, 2009, 12:04 PM
Hi all!

I just ran into the same problem: XP overwritten my boot sector with s***...

Well, the steps I followed in order to recover it were:



mount /dev/sdb2 /mnt/root/
mount -t proc none /mnt/root/proc
mount -o bind /dev /mnt/root/dev
chroot /mnt/root/
grub-install /dev/sda


Note: sdb2 is the partition where I have linux root. You should substitute by your linux root partition.

Now I'm going to test it... ;)

After reboot, it didn't work... It started under a grub shell.

Then I rebooted again from the USB drive, made all the stuff again, slightly differently:



mount /dev/sdb2 /mnt/root/
mount -t proc none /mnt/root/proc
mount -o bind /dev /mnt/root/dev
chroot /mnt/root/ /bin/bash # <-- this line changed!

grub> find /boot/grub/stage1
(hd1,1)

grub> root (hd1,1)

grub> setup (hd0)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/reiserfs_stage1_5" exists... yes
Running "embed /boot/grub/reiserfs_stage1_5 (hd0)"... 20 sectors are embedded
.
succeeded
Running "install /boot/grub/stage1 d (hd0) (hd0)1+20 p (hd1,1)/boot/grub/stage
2 /boot/grub/menu.lst"... succeeded
Done.


Well, let's try rebooting again...

alexsmith
November 20th, 2009, 12:57 PM
After reboot, it didn't work... It started under a grub shell.

Then I rebooted again from the USB drive, made all the stuff again, slightly differently:



mount /dev/sdb2 /mnt/root/
mount -t proc none /mnt/root/proc
mount -o bind /dev /mnt/root/dev
chroot /mnt/root/ /bin/bash # <-- this line changed!

grub> find /boot/grub/stage1
(hd1,1)

grub> root (hd1,1)

grub> setup (hd0)
Checking if "/boot/grub/stage1" exists... yes
Checking if "/boot/grub/stage2" exists... yes
Checking if "/boot/grub/reiserfs_stage1_5" exists... yes
Running "embed /boot/grub/reiserfs_stage1_5 (hd0)"... 20 sectors are embedded
.
succeeded
Running "install /boot/grub/stage1 d (hd0) (hd0)1+20 p (hd1,1)/boot/grub/stage
2 /boot/grub/menu.lst"... succeeded
Done.


Well, let's try rebooting again...

Didn't work as well... I fell again into grub prompt. :'(

Buuuuuuuuuut.........

I noticed that file /boot/grub/menu.lst was missing. Then, after rebooting again, I tried this:



mount /dev/sdb2 /mnt/root/
mount -t proc none /mnt/root/proc
mount -o bind /dev /mnt/root/dev
chroot /mnt/root/ /bin/bash
update-grub


And my system was back working!!!

Just a little hassle I still need to fix up (do I?): update-grub didn't detect the XP partitions. Will fix that later, since now I'm so happy to have my Linux box back.

sandyscott
November 20th, 2009, 11:42 PM
I'm trying to install GRUB on usb drive, and getting exactly the same problem as Mr. Stabby - ie. this step won't work:


ubuntu@ubuntu:~$ sudo chroot /mnt/root /bin/bash
chroot: cannot run command `/bin/bash': No such file or directory


Any ideas why?

Any help much appreciated,

Sandy

sleepingpeace
November 23rd, 2009, 03:41 AM
I just burned the kubuntu 9.10 disc and unfortunately "sudo grub" returns "sudo: grub: command not found"... Kubuntu uses grub too, so why the hell do I need an apt-get install grub to get it going, which can't be done on this live cd anyway....?

_mikec_
November 26th, 2009, 03:41 AM
thank you to everyone who posted on this thread!! i was able to fix my MBR :p..
by mistake i hit the ' Y ' key when my bios told me, !!! Attention boot sector is to be modified !!!! when inserting a windows cd ... i was quick on that one and i didn't pay attention ...

Buttons840
November 26th, 2009, 05:20 PM
I just burned the kubuntu 9.10 disc and unfortunately "sudo grub" returns "sudo: grub: command not found"... Kubuntu uses grub too, so why the hell do I need an apt-get install grub to get it going, which can't be done on this live cd anyway....?

I'm having the same problem.

sieve
December 3rd, 2009, 02:40 AM
Thanks! This worked perfectly.

BRONZEBEARD
December 4th, 2009, 08:07 AM
OK, I am about to give up. Here is my situation. I installed Ubuntu 9.1 as a dual boot on my laptop with XP. Worked great as a dual boot, I am new to Ubuntu/Linux. It went so effortlessly that I decided to install it as a stand alone OS on another hard drive. So I installed Ubuntu 9.10 to another 2.5" hard drive connected to my pc by a usb cable. Install went smooth but after it completed tried to boot from the new drive still connected through usb and it just sits there with the promt flashing. So I removed my dual boot HD and installed my new one in my laptop. Same result will not boot. So I booted with a live cd and am trying to fix the mrb on the hard drive. I installed grub then ran it. The find/boot/grub/stage1 returns error 15 file not found. So I know I only have one hard drive in my pc and told the install to format and use the whole drive so I assumed my hd is hd0,1. So I ran this:
sudo grub
returned
grub>

then
root (hd0,1)
returned
grub>

then
setup (hd0,0)
and got erro 17: cannot mount selected partition

So I tried this procedure Mbr
Fixing the Master Boot Record:
First we need to enable the Universal repository containing the mbr package


Open a terminal and type sudo nano /etc/apt/sources.list
Find and uncomment the following lines by removing the ## in front of them:

## deb http://us.archive.ubuntu.com/ubuntu/ edgy universe
## deb-src http://us.archive.ubuntu.com/ubuntu/ edgy universe


Hit ctrl+x then type y to accept and save the changes (press enter)
Type sudo apt-get update

Next we will install the mbr package and use it to create the new mbr on the USB flash drive


Type sudo apt-get install mbr
Type fdisk -l to find out which device is your drive. Mine was sda1
Type install-mbr /dev/sda1 it returned the same cant mount selected partition.


I know I had to supply a password when setting up the OS but I am booting from live cd and I never get asked to enter a password to access my hard drive with the installed OS.
Any help would be appreciated greatly.

atoztoa
December 4th, 2009, 08:55 AM
Anyone have any idea about
grub error 18

I have never been able to boot from Grub in my machine... maybe some issue with hardware... anyone else came across that issue???

I am using LILO for everything...

_ATOzTOA
www.atoztoa.com

shujaa
December 6th, 2009, 12:35 PM
When I first saw ubuntu I thought "GREAT" A WAY TO GET AWAY FROM MICROSOFT'S WINDOWS AND ITS CONSTANT CRASHING and other problems (spyware and viruses etc.) Now I'm not so sure. Why do we have to go though all this? Why don't the designers of ubuntu and the rest just fix the problem(s) so we can just boot and go on with what we do with our computers? I thought I had this sh:grub thing licked until I did a recent update. BAM, sh:grub again. I have family and friends that I have recommended this operating system to but fortunately for me, and them, they haven't tried it yet. I'm sending them an email telling them to wait a while until more of the bugs are worked out. Simplicity is what they and I need.

sarum
December 17th, 2009, 07:49 AM
I have read all through this thread and can not find the answer to my problem - nice to know I'm not alone.
I've dual booted Ubuntu and XP for ages without trouble, though I seldom use XP. Couple of nights ago I tried out an APCmagazine CD(Feb: '08). I was looking to try Mint; which didn't work. I had a look at G A G,on the same CD. I promise you I didn't download a thing.
But next morning I was, and still am, unable to open Ubuntu(current LTS). So I'm stuck with XP, and a big partition I can't use.
My question is; can GAG solve our problems. Being a long term newby I'd not like to try without some expert advice.
Anyone still following this thread. If no replies, then I'll start a new one.............sarum

hadriel140
December 29th, 2009, 07:02 PM
so i had a windows 7/ubuntu 9.10 (64-bit) dual boot for a while, then windows messed up so i had to reinstall. now i have two harddrives in my laptop, one containing windows 7 and the recovery partition on one hd then on the other one most of it is additional storage for my stuff and then i partitioned 78(maybe 80 i think) gigabytes out for a fresh install of ubuntu, and i formated the partition as ext4 and installed the grub bootloader onto my windows partition. once i reinstalled windows though, as expected it wiped out grub with its own, now i cant get back to my ubuntu, the menu.lst is missing and ive tried all the guides on this site so heres one that i got the farthest with.
ext3 was not the right filesystem and it wasnt on sda6(didnt exist so i fixxed in next ones down


ubuntu@ubuntu:~$ sudo mkdir /mnt/root
ubuntu@ubuntu:~$ sudo mount -t ext3 /dev/sda6 /mnt/root
mount: special device /dev/sda6 does not exist
ubuntu@ubuntu:~$ sudo mount -t ext3 /dev/sdb2 /mnt/root
mount: wrong fs type, bad option, bad superblock on /dev/sdb2,
missing codepage or helper program, or other error
In some cases useful info is found in syslog - try
dmesg | tail or so

ubuntu@ubuntu:~$ sudo mount -t ext4 /dev/sdb5 /mnt/root
ubuntu@ubuntu:~$ sudo mount -t proc none /mnt/root/proc
ubuntu@ubuntu:~$ sudo mount -o bind /dev /mnt/root/dev
ubuntu@ubuntu:~$ sudo chroot /mnt/root /bin/bash
root@ubuntu:/# sudo grub
sudo: unable to resolve host ubuntu
sudo: grub: command not found
root@ubuntu:/# grub
The program 'grub' is currently not installed. You can install it by typing:
apt-get install grub
grub: command not found
root@ubuntu:/# apt-get isntall grub
E: Invalid operation isntall
root@ubuntu:/# sudo apt-get install grub
sudo: unable to resolve host ubuntu
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
wine-gecko
Use 'apt-get autoremove' to remove them.
Suggested packages:
grub-doc mdadm
The following packages will be REMOVED:
grub-pc
The following NEW packages will be installed:
grub
0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
Need to get 903kB of archives.
After this operation, 188kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Err http://mirror.cc.columbia.edu karmic/main grub 0.97-29ubuntu59
Could not resolve 'mirror.cc.columbia.edu'
Failed to fetch http://mirror.cc.columbia.edu/pub/linux/ubuntu/archive/pool/main/g/grub/grub_0.97-29ubuntu59_amd64.deb Could not resolve 'mirror.cc.columbia.edu'
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
root@ubuntu:/# apt-get install grub
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
wine-gecko
Use 'apt-get autoremove' to remove them.
Suggested packages:
grub-doc mdadm
The following packages will be REMOVED:
grub-pc
The following NEW packages will be installed:
grub
0 upgraded, 1 newly installed, 1 to remove and 0 not upgraded.
Need to get 903kB of archives.
After this operation, 188kB of additional disk space will be used.
Do you want to continue [Y/n]? y
Err http://mirror.cc.columbia.edu karmic/main grub 0.97-29ubuntu59
Could not resolve 'mirror.cc.columbia.edu'
Failed to fetch http://mirror.cc.columbia.edu/pub/linux/ubuntu/archive/pool/main/g/grub/grub_0.97-29ubuntu59_amd64.deb Could not resolve 'mirror.cc.columbia.edu'
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?


this is what i get when i type sudo grub

root@ubuntu:/# sudo grub
sudo: unable to resolve host ubuntu
sudo: grub: command not found

and trying it out of root

ubuntu@ubuntu:~$ sudo grub
sudo: grub: command not found
ubuntu@ubuntu:~$

skrimpy
February 8th, 2010, 01:50 AM
If you are getting "command not found" when you try "sudo grub" the first post in this thread fixed my grub/MBR.

Section 13 here:

http://ubuntuforums.org/showthread.php?t=1195275

Yvenna
February 22nd, 2010, 05:05 PM
message removed

ssl432
March 16th, 2010, 01:07 PM
I have a pc where what Ubuntu would call hd0 is totally dedicated to windows xp and hd1 is partitioned 50% ubuntu and 50% backup for the frequent reformats of the windows system. i don't remember exactly which version of Ubuntu is loaded but i know it's about 3 years old. I found that because i installed Ubuntu on hd1 the pc normally just boots to windows and i had to use the boot menu to tell it to go to ubuntu (no worries since I'm the only one doing that and i don't mind the step). However, recently after one of my windows reformats i discovered that on trying to boot to hd2 i got a message that there was no operating system there to boot to. Grub seems to have vanished. using a 9.04 disk i can see my documents in the ubuntu partition but it only allows me to access about 1/4 of them and tells me i don't have permission to access the rest. any suggestions as to how best to restore grub to hd1 without disturbing hd0? i thought i could just upgrade to 9.04 and fix the problem that way but when i started that the installer just wanted to format the whole partition and i don't want to lose the documents i have there. Reading some of this page's posts it seems like it might work but i want to be sure. also I am a thorough noob to linux and am quite afraid im gonna mess everything up with a wrong command.

also will a grub loaded from a 9.04 disk be compatible with my older version of Ubuntu? i wish i remembered which version i have.

10Ten
March 25th, 2010, 12:32 AM
ugh. my linux hung and i had to manually shutdown. after rebooting i have a loop that goes like this:


BIOS
GRUB loading, please wait...
spontaneous reboot (no input from me)
BIOS, etc...

my LiveCD does not respond to the Rescue option. i have also tried to re-setup GRUB via a root terminal as described on the first post of page 1 of this thread. ... and i even tried to rescue using my Win 7 rescue disk, all to no avail.

any ideas? will i have to reinstall this damn liveCD AGAIN???

Maythen
March 26th, 2010, 07:31 PM
message deleted

linfidel
April 3rd, 2010, 08:51 PM
ugh...

any ideas? will i have to reinstall this damn liveCD AGAIN???No, you never need to reinstall the live CD. But, you should understand what's going on, and maybe that will be harder, although it's really not very complicated, at least it wasn't until the latest version, if you did a clean install and ended up with "GRUB 2". Installing GRUB (1) is easy, but if you have GRUB 2, I don't know how. In fact, I simply installed the original GRUB manually.

For GRUB 1, you need two things - you need the grub files in /boot/grub, along with menu.lst, and you need the boot loader in the MBR that knows where to look for the OS and the grub files.

If you have an existing /boot/grub/ then using the live CD to fix things is easy - all you have to do is tell GRUB where they are, and reinstall it into the MBR. This takes two commands from the grub prompt.

You need to know what partition your root linux is on. If you only have one, it would be /dev/sda1 (first drive, first partition). But in GRUB's terminology, this is HD0,0 (no spaces).

For me, my root drive is an extended partition, which always starts with 5, so it's /dev/sda6, the first logical partition in the extended partition.

Here's what I do to install GRUB from the live CD (pre-9.1 version):
Enter "sudo grub" in the terminal. Always use sudo (or an su prompt) or grub will run, but not work worth a damn!



grub> find /boot/grub/menu.lst
(hd0,5)

grub> root (hd0,5)

grub> setup (hd0)
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 (hd0)"... 16 sectors are embedded.
succeeded
Running "install /boot/grub/stage1 (hd0) (hd0)1+16 p (hd0,5)/boot/grub/stage2 /boot/grub/menu.lst"... succeeded
Done.

grub> quit


Explanation. First, I did a find to confirm the location of my grub files, using menu.lst (because I can remember that one easily).

The GRUB prompt is "grub>", by the way.

Then, I told GRUB about that location, with the "root" command, installed the boot loader into the MBR with the setup command, saw that everything was OK, and entered "quit" to exit.

That's what does it for me.

brtaylor92
May 7th, 2010, 05:18 AM
To throw in my experience with fixing grub2 after an incident with Windows overwrote the MBR:

Follow the chroot instructions at the beginning of this thread - mount your install partitions, and so forth.

from the chrooted environment:


sudo apt-get install grub
sudo apt-get install grub2
sudo upgrade-from-grub-legacy

At this point, whether you have a legacy grub install or not (I didn't), grub seems to simply bring up the upgrade screen - which will prompt you for which drive to install grub2 on if it doesn't find a legacy install. It then automatically regenerates your /boot/grub/grub.cfg file (which contains menu entries similar to those in menu.lst for the original grub). It didn't detect my Windows install, but that can't be considered a reliable indicator as my Windows install currently doesn't boot. Adding Windows to grub.cfg is fairly simple - simply add the lines (for example)


### BEGIN /etc/grub.d/30_os-prober ###
menuentry "Microsoft Windows XP Home Edition (on /dev/sda1)" {
set root=(hd0,1)
chainloader +1
}
### END /etc/grub.d/30_os-prober ###

For a Windows XP install on /dev/sda1, for example.
Finally, a sudo grub-install, and a reboot.

More complicated than the old way, and there are probably some unnecessary/erroneous steps involved since I did this off the top of my head, but it works (at least for me).

lnappa
May 7th, 2010, 10:57 AM
https://wiki.ubuntu.com/Grub2#Recover Grub 2 via LiveCD

swamy2712
May 25th, 2010, 11:10 AM
grub> find /boot/grub/grub.cfg
(hd0,7)

grub> root (hd0,7)

grub> setup (hd0)
Checking if "/boot/grub/stage1" exists... no
Checking if "/grub/stage1" exists... no

Error 15: File not found

please help me how to fix this problem

von Stalhein
May 25th, 2010, 01:41 PM
grub> find /boot/grub/grub.cfg
(hd0,7)

grub> root (hd0,7)

grub> setup (hd0)
Checking if "/boot/grub/stage1" exists... no
Checking if "/grub/stage1" exists... no

Error 15: File not found

please help me how to fix this problem

Some more details please:

Which version of Ubuntu?
Is it GRUB 1.97? (looks like it - which one do you want to install?)
Do you only have one hdd?
Are you dual booting?

Stick with it, you're only just beginning to have fun :)

OzRattler
June 7th, 2010, 01:03 AM
Thanks for the edits at the top of this long thread! Much appreciated. Silly me, forgot that the disk might not have been mounted.

Gods of Linux indeed...............

Have fun!

EDIT:::
I had to edit the syntax at the loader because for some reason it had chosen (hd0,2) instead of (hd0,5) - coincidental that I had the same setup as the OP's edit. Got into 10.04 and from there changed <menu.lst>. That killed XP. So, back into <menu.lst> and see what was wrong. It was still looking for the old drive! Removed the "map" lines and back in action. R.
:::END

Timmer1240
June 7th, 2010, 05:50 AM
Im gonna print this for future reference thanks!

kannadiga
June 9th, 2010, 01:02 PM
This procedure worked for me hope this works to you..

find the "sda (number)" where you have installed ubuntu (previously installed).

To find it goto System -> Admin -> gparted (only using live-cd)
here you find the sda (number) for linux ex: sda7 or sda4 .....

Assuming you were previousely installed ubuntu in sda5

in command prompt type ( Application ->accessories->terminal)

sudo mkdir /media/sda5
sudo mount /dev/sda5 /media/sda5

sudo grub-install --root-directory=/media/sda5 /dev/sda


it shows installation finished. No error reported.

reboot the system.

swiftwood
June 16th, 2010, 12:33 AM
Well my Grub is definitely busted

I tried all the tips here, no go

Given the amount of errors I was getting while backing up my files,
I think my harddrive is on the fritz.

linfidel
June 17th, 2010, 12:27 AM
Well my Grub is definitely busted

I tried all the tips here, no go

Given the amount of errors I was getting while backing up my files,
I think my harddrive is on the fritz.
Was there some reason you posted this? I didn't see a request for help, nor did I see any kind of added information, unless I'm unaware that everyone else has been waiting to hear the status of your hard drive.

SamanthaSmith
June 18th, 2010, 04:29 AM
I tried following the steps but I am getting and error message. I hope to get this done really soon so that I can proceed my other projects.

linfidel
June 19th, 2010, 01:15 AM
How to Post a Question

Supply as much information as possible, including OS version, program version, if applicable, etc;
If there was an error message, include the exact text (cut and paste if possible);
If it "doesn't work" or "crashes", give details on what happened vs what you expected to happen;
Ask the question, and make it as specific as possible;


How Not to Post a Question

Assume we know everything you've done in the past;
Be as vague as possible; use terms like "tried all the steps" or "didn't work";
Don't ask any questions, we can read your mind;
Be brief - don't clutter your post with information about versions, etc

tapas_mishra
June 19th, 2010, 05:33 AM
grub> find /boot/grub/grub.cfg
(hd0,7)

Do not use as above instead


grub> find /boot/grub/stage1

linfidel
June 20th, 2010, 02:31 AM
Do not use as above instead


grub> find /boot/grub/stage1

But it found grub.cfg - it was stage1 that it didn't find; this most likely means he has the newer "grub2", not the original grub. The newer one does not use stage 1 or stage2, but it does have grub.cfg.

I don't know what the original poster was trying to do, so I can't offer any suggestions as to what should be done, except to point him to https://help.ubuntu.com/community/Grub2#Grub%20shows%20rescue%20prompt%20(and%20does %20not%20continue%20to%20boot)

ianavery
June 22nd, 2010, 08:56 PM
file is there. i saw it after mounting the partition having linux installed on it.
i tried to give /B/boot/grub/stag1 command while /B is the mount folder but it did the same error.
i am sick of this reinstallation process.

One thing, I had an iPod plugged in when I started my laptop and this caused error 22. Unplugged it and it
worked fine.

Irthur Belle
August 13th, 2010, 04:37 AM
first boot harddrive
second bootloader choose

ubuntu 9.04 -19
ubuntu 9.04 -19 generic
ubuntu 9.04 -11
ubuntu 9.04 -11 generic
that go at to /dev/sda7 mount point / on /home/user/Desktop
xubuntu go at to /dev/sda5 on /home/user/Desktop

smurfyy
August 14th, 2010, 05:22 PM
Heyy!
I'm new here!
Ive just noticed this problem and ive been trying to fix it for the past few hours!

First, i was trying to install drivers for my wireless card on my desktop pc, and it wasnt working, so i hooked it up via ethernet and i got connected.

I then upgraged from 9.10 to 10.04LST, went through everything and rebooted.

So post comes up and then it goes through boot process.

Then i get;
error: no such device: 2811e56f-c54a-4f61-8dd4-87b92691f594.
grub rescue>

This is a dual boot setup of Windows Vista and Ubuntu.
I cant boot to vista, ive tried vista startup repair but nothing!
I installed inside Windows using Wubi.

If my system specs are needed ill post.

Please help me!
Thanks in advanced!
Daniel =)

EDIT; FIXED!
Used this; http://ubuntuforums.org/showthread.php?t=1014708&highlight=howto+bootloader

ranch hand
August 29th, 2010, 11:57 PM
I just linked this thread to another guy with a grub-legacy problem. Haven't used these commands for a long while.

This Thread was linked for me back when I was just starting out and was a life saver then too.

posfan12
September 4th, 2010, 04:13 AM
I get "sudo: grub: command not found".

Duck2006
September 4th, 2010, 06:14 PM
I get "sudo: grub: command not found".

What ver of grub are you using.
Run

grub-install -v

and post the out put.

kaisa249
September 18th, 2010, 03:41 PM
when my pc boots it comes to the screen where i usually hit the boot options but the options don't come up. i can't boot into windows. i can't get the live cd to boot. if possible how do i force boot of the cd drive?

swaprava
October 14th, 2010, 08:17 PM
when my pc boots it comes to the screen where i usually hit the boot options but the options don't come up. i can't boot into windows. i can't get the live cd to boot. if possible how do i force boot of the cd drive?

I guess there is a multitude of problems when you try to dual boot ubuntu with windows 7. Let me summarize what I faced recently, and should certainly share so that more people can benefit.



I installed ubuntu over windows 7, hence grub2 took charge. As soon as one boots into windows again, the MBR erases the grub entries, so a problem occurs which is addressed in this (http://ubuntuforums.org/showthread.php?t=1417666) post.
However, when your PC can't detect any image on disk, you can't but boot with live CD. So did I. The best solution is to reinstall the grub. Rather change grub2 to the classic grub. Follow this (http://sourceforge.net/apps/mediawiki/bootinfoscript/index.php?title=Boot_Problems:Windows_Writes_To_MB R) link.
Now the problem appears as posted above. It boots directly to Ubuntu and you can't even see Windows. So, one needs to add lines for windows in the /boot/grub/menu.lst . Follow this (http://www.howtogeek.com/howto/ubuntu/reinstall-ubuntu-grub-bootloader-after-windows-wipes-it-out/).

I found that the Windows 7 created 3 partitions in a Dell desktop: Dell Diagnostic, RECOVERY, and Windows 7. Out of which I found the Recovery partition to be put in the
root='(hdX,Y)', where X and Y would be the hard disk number and partition number of the Recovery partition respectively.

I guess if you edit the grub.cfg / menu.lst in this way, everything should be fine and you will see windows to get booted again. Good luck.

I never expected that an OS would rewrite the MBR again after a successful installation of some other OS, leaving things in a mess. This is a shame for Windows. I wonder why nobody sued them yet.

hirol
November 3rd, 2010, 06:25 PM
I copied whole partition and MBR to my new 500GB HDD, but I'm getting Grub error 17.

Old HDD is 100GB you can see it in fdisk -l

On old hdd I had linux but it's no longer there.

What I'm loking to do is to be able to boot windows from 500GB HDD

No matter what I did I was still getting error 17.

What to do?

I tried lots of things but I admit this is above my skills.

ubuntu@ubuntu:~$ sudo fdisk -l

Disk /dev/sda: 500.1 GB, 500107862016 bytes
255 heads, 63 sectors/track, 60801 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x00075f0b

Device Boot Start End Blocks Id System
/dev/sda1 * 1 12898 103603153+ 7 HPFS/NTFS
/dev/sda2 12899 12911 104422+ 83 Linux

Disk /dev/sdc: 100.0 GB, 100030242816 bytes
255 heads, 63 sectors/track, 12161 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0xc38aaea8

Device Boot Start End Blocks Id System
/dev/sdc1 3856 3868 104422+ 83 Linux
/dev/sdc2 * 1 3855 30965256 7 HPFS/NTFS
/dev/sdc3 3869 12161 66613522+ f W95 Ext'd (LBA)
/dev/sdc5 3869 12161 66613491 7 HPFS/NTFS

Partition table entries are not in disk order




device.map

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


# menu.lst - See: grub(8), info grub, update-grub(8)
# grub-install(8), grub-floppy(8),
# grub-md5-crypt, /usr/share/doc/grub
# and /usr/share/doc/grub-doc/.

## default num
# Set the default entry to the entry number NUM. Numbering starts from 0, and
# the entry number 0 is the default if the command is not used.
#
# You can specify 'saved' instead of a number. In this case, the default entry
# is the entry saved with the command 'savedefault'.
# WARNING: If you are using dmraid do not use 'savedefault' or your
# array will desync and will not let you boot your system.
default 6

## timeout sec
# Set a timeout, in SEC seconds, before automatically booting the default entry
# (normally the first entry defined).
timeout 1

## hiddenmenu
# Hides the menu by default (press ESC to see the menu)
#hiddenmenu

# Pretty colours
#color cyan/blue white/blue

## password ['--md5'] passwd
# If used in the first section of a menu file, disable all interactive editing
# control (menu entry editor and command-line) and entries protected by the
# command 'lock'
# e.g. password topsecret
# password --md5 $1$gLhU0/$aW78kHK1QfV3P2b2znUoe/
# password topsecret

#
# examples
#
# title Windows 95/98/NT/2000
# root (hd0,0)
# makeactive
# chainloader +1
#
# title Linux
# root (hd0,1)
# kernel /vmlinuz root=/dev/hda2 ro
#

#
# Put static boot stanzas before and/or after AUTOMAGIC KERNEL LIST

### BEGIN AUTOMAGIC KERNELS LIST
## lines between the AUTOMAGIC KERNELS LIST markers will be modified
## by the debian update-grub script except for the default options below

## DO NOT UNCOMMENT THEM, Just edit them to your needs

## ## Start Default Options ##
## default kernel options
## default kernel options for automagic boot options
## If you want special options for specific kernels use kopt_x_y_z
## where x.y.z is kernel version. Minor versions can be omitted.
## e.g. kopt=root=/dev/hda1 ro
## kopt_2_6_8=root=/dev/hdc1 ro
## kopt_2_6_8_2_686=root=/dev/hdc2 ro
# kopt=root=UUID=90149fa4-9ab7-49e1-b7ba-7813fad90165 ro

## Setup crashdump menu entries
## e.g. crashdump=1
# crashdump=0

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd0,0)

## should update-grub create alternative automagic boot options
## e.g. alternative=true
## alternative=false
# alternative=true

## should update-grub lock alternative automagic boot options
## e.g. lockalternative=true
## lockalternative=false
# lockalternative=false

## additional options to use with the default boot option, but not with the
## alternatives
## e.g. defoptions=vga=791 resume=/dev/hda5
# defoptions=quiet splash

## should update-grub lock old automagic boot options
## e.g. lockold=false
## lockold=true
# lockold=false

## Xen hypervisor options to use with the default Xen boot option
# xenhopt=

## Xen Linux kernel options to use with the default Xen boot option
# xenkopt=console=tty0

## altoption boot targets option
## multiple altoptions lines are allowed
## e.g. altoptions=(extra menu suffix) extra boot options
## altoptions=(recovery) single
# altoptions=(recovery mode) single

## controls how many kernels should be put into the menu.lst
## only counts the first occurence of a kernel, not the
## alternative kernel options
## e.g. howmany=all
## howmany=7
# howmany=all

## should update-grub create memtest86 boot option
## e.g. memtest86=true
## memtest86=false
# memtest86=true

## should update-grub adjust the value of the default booted system
## can be true or false
# updatedefaultentry=false

## should update-grub add savedefault to the default options
## can be true or false
# savedefault=false

## ## End Default Options ##

title Ubuntu 8.04.1, kernel 2.6.24-22-generic
root (hd0,0)
kernel /vmlinuz-2.6.24-22-generic root=UUID=90149fa4-9ab7-49e1-b7ba-7813fad90165 ro quiet splash
initrd /initrd.img-2.6.24-22-generic
quiet

title Ubuntu 8.04.1, kernel 2.6.24-22-generic (recovery mode)
root (hd0,0)
kernel /vmlinuz-2.6.24-22-generic root=UUID=90149fa4-9ab7-49e1-b7ba-7813fad90165 ro single
initrd /initrd.img-2.6.24-22-generic

title Ubuntu 8.04.1, kernel 2.6.24-19-generic
root (hd0,0)
kernel /vmlinuz-2.6.24-19-generic root=UUID=90149fa4-9ab7-49e1-b7ba-7813fad90165 ro quiet splash
initrd /initrd.img-2.6.24-19-generic
quiet

title Ubuntu 8.04.1, kernel 2.6.24-19-generic (recovery mode)
root (hd0,0)
kernel /vmlinuz-2.6.24-19-generic root=UUID=90149fa4-9ab7-49e1-b7ba-7813fad90165 ro single
initrd /initrd.img-2.6.24-19-generic

title Ubuntu 8.04.1, memtest86+
root (hd0,0)
kernel /memtest86+.bin
quiet

### END DEBIAN AUTOMAGIC KERNELS LIST

# This is a divider, added to separate the menu items below from the Debian
# ones.
title Other operating systems:
root


# This entry automatically added by the Debian installer for a non-linux OS
# on /dev/sda2
title Windows XP Media Center Edition
root (hd0,1)
savedefault
makeactive
chainloader +1

hirol
November 3rd, 2010, 09:49 PM
I got this solved. I used Super Grub and then just fixed boot.ini in windows.

Thanks anyway

Drone4four
May 25th, 2011, 04:37 AM
I can't find the go-to thread for how to fix GRUB2. Where is it?

Drone4four
May 25th, 2011, 04:52 AM
...

Found it: http://ubuntuforums.org/showthread.php?t=1581099

johnmarley
June 7th, 2011, 04:10 PM
omg..that was really help...very well explained... thanks a lot. :)

umpirsky
June 12th, 2011, 06:49 PM
I'm stuck at the beginning:



grub> find /boot/grub/stage1

Error 15: File not found
But

Then I tried:



find /boot/grub/grub.cfg
(hd1,6)

grub> root (hd1,6)

grub> setup (hd1)
Checking if "/boot/grub/stage1" exists... no
Checking if "/grub/stage1" exists... no

Error 15: File not found


Any idea?

linfidel
June 13th, 2011, 07:02 PM
One thing you should be aware of is that the recent releases of Ubuntu use a newer version of GRUB, collectively known as GRUB 2. There are minor differences, but there are major differences between version 1 and version 2, one of which is that there is no longer any stage1 or stage2, and the files in /boot/grub are not the way to make changes.

You can read more about this here: https://help.ubuntu.com/community/Grub2

JASONFUSARO
June 20th, 2011, 10:07 PM
Just wanted to post with more concrete proof. I knew it was right from the documentation and I got feedback from one success story plus I ran it but it was just replacing the same list so it was hard to tell.
BUT NOW, I have absolute proof. I just installed Fedora Core 5 yesterday. I allowed Fedora to install grub. Fedora's grub didn't recognise Ubuntu's installation.
I thought to myself, Perfect! Lets put the guide to work. This is just the scenario I was hoping to help people with. You had grub but lost it to another install (or another issue that caused grub to return an error or what not. The main thing is that grub is already installed somewhere. The issue is you can't access it)
This is actually how anyone could handle this. I copied down Fedora's grub entry , then I rebooted and put the Ubuntu Live installation cd. When I got to the desktop I opened the terminal and did the 4 commands. One from the regular ubuntu terminal and 3 at the grub shell.

sudo grubthen at grub>

find /boot/grub/stage1It returned 2 listings, hd0,2 and hd0,6. I forgot Ubuntu's root partition believe it or not but I knew I just put Fedora on /dev/hda3 (that is hd0,2 to grub)
Now that I know Ubuntu's grub is on hd0,6 I let the grub shell know what grub files I wanted to use
Still at grub>


root (hd0,6)Now the command to install grub on the mbr with hd0,6's grub files

setup (hd0)Grub then prints a little read out in the terminal about how it found the kernel and everything else until it says "succeeded". Now all I have to do is get out of the shell
grub>
quitThen I shutdown Ubuntu and restarted the computer.
Gone was Fedora's grub and in it's place was my Ubuntu grub menu. Success.
(As for accessing Fedora, I just inserted the Fedora entries I copied from Fedora's grub before I booted the live cd. Now I have Ubuntu's grub back and it is booting to fedora.)

To sum up, hd0,6's grub installed flawlessly on the mbr. It took all of 2 minutes from putting the cd in to restarting.

Here it is again just to put it to bed.

sudo grub
find /boot/grub/stage1whatever the find command returns use for root

root (hd?,?)
setup (hd0)hd0 is the mbr of the first drive (as far as grub is concerned)

quit


thats all well and good but what happens with us guys who get Error 15: File not found what do I do?????????????

linfidel
June 21st, 2011, 12:41 AM
What is the matter with you people? Is your brain asleep? I tried to point out that there are two major different versions of grub that have been used with Ubuntu, grub 2 being the one used for the past several versions. Yet nobody is stating what version they are trying to install, or are using.

Some of you are obviously trying to use the outdated instructions for the old grub, and it simply will not work. There is no stage 1 or stage 2 in the new version, so of course you will not find it. You can follow the same instructions 1000000 times and it won't work. Someone with an old version or a different distro can tell you exactly what they did, but if you have a later version on Ubuntu, it will not work!!!

I am unsubscribing from this thread now, because it is simply getting to be rediculous, and a big waste of time for everyone.

von Stalhein
June 21st, 2011, 10:02 AM
thats all well and good but what happens with us guys who get Error 15: File not found what do I do?????????????

Basically it means that the wrong drive has been selected, viz: -


File Not Found (Error 15)

This error is the result of a GRUB 2 installation to /boot but a Master Boot Record ( MBR ) that points to a different partition/location that contains Grub Legacy. This can happen if you don't select your drive when running sudo upgrade-from-grub-legacy. Shortly after starting this command the user will be asked to select the device (sda, sdb, etc). Highlight the drive and press the space bar to select it when presented with this screen. Failure to select a drive will result in an Error 15.

Reinstalling Grub2 and allowing the MBR to be changed so that it points to the partition containing Grub2 can easily remedy this problem.

To recover from this error, GRUB 2 must be reinstalled. Go to Reinstalling from the LiveCD for instructions

Above is from https://help.ubuntu.com/community/Grub2#Reinstalling%20GRUB2

Don't forget the "sudo" in the command:

sudo apt-get purge grub grub-pc grub-common


Keep having a crack ;)

I remember having the same issue. I hadn't purged the leagacy GRUB properly. I swore a fair bit before I got it sorted.

When I purged the legacy GRUB and reinstalled from the Live CD and it was all good. I'm running XP & Maverick on 2 different HDDs but I have 3 HDDs in my system.

Over the journey, GRUB in general has caused me to have plenty of education through these forums by other members :biggrin:

1egend
July 6th, 2011, 03:24 AM
I guess there is a multitude of problems when you try to dual boot ubuntu with windows 7. Let me summarize what I faced recently, and should certainly share so that more people can benefit.



I installed ubuntu over windows 7, hence grub2 took charge. As soon as one boots into windows again, the MBR erases the grub entries, so a problem occurs which is addressed in this (http://ubuntuforums.org/showthread.php?t=1417666) post.
However, when your PC can't detect any image on disk, you can't but boot with live CD. So did I. The best solution is to reinstall the grub. Rather change grub2 to the classic grub. Follow this (http://sourceforge.net/apps/mediawiki/bootinfoscript/index.php?title=Boot_Problems:Windows_Writes_To_MB R) link.
Now the problem appears as posted above. It boots directly to Ubuntu and you can't even see Windows. So, one needs to add lines for windows in the /boot/grub/menu.lst . Follow this (http://www.howtogeek.com/howto/ubuntu/reinstall-ubuntu-grub-bootloader-after-windows-wipes-it-out/).

I found that the Windows 7 created 3 partitions in a Dell desktop: Dell Diagnostic, RECOVERY, and Windows 7. Out of which I found the Recovery partition to be put in the
root='(hdX,Y)', where X and Y would be the hard disk number and partition number of the Recovery partition respectively.

I guess if you edit the grub.cfg / menu.lst in this way, everything should be fine and you will see windows to get booted again. Good luck.

I never expected that an OS would rewrite the MBR again after a successful installation of some other OS, leaving things in a mess. This is a shame for Windows. I wonder why nobody sued them yet.

This is amazing, following link solved my problem
http://sourceforge.net/apps/mediawiki/bootinfoscript/index.php?title=Boot_Problems:Windows_Writes_To_MB R

manifeb28
August 15th, 2011, 07:22 AM
Try Boot-Repair recently I recovered my GRUB using Boot-Repair,

Check This tutorial http://www.howopensource.com/2011/08/how-to-recover-re-install-grub-in-ubuntu-11-04-10-10-and-10-04/

BobSlydell
August 25th, 2011, 07:09 AM
What a joke. The community should be ashamed when the only way to effectively get a distro dual booting correctly requires an iso image and a disjointed gui tool. Do any of you remember lilo? Hell, even Grub1? I'm sorry, but the emperor has no clothes. Grub2 is a bloated, convoluted POS. /rant

maverickmk
February 23rd, 2012, 09:53 PM
i have read all the comments above but what can u do when the "live cds" dont even boot?

thunderheights
June 24th, 2012, 06:35 AM
After trying Windows 8 on my hard drive instead of a virtual, it messed up MBR and GRUB when I removed it. The directions on the first page of this thread worked perfectly!
Thank You!

thunderheights
June 24th, 2012, 06:40 AM
What a joke. The community should be ashamed when the only way to effectively get a distro dual booting correctly requires an iso image and a disjointed gui tool. Do any of you remember lilo? Hell, even Grub1? I'm sorry, but the emperor has no clothes. Grub2 is a bloated, convoluted POS. /rant

I never could get Grub2 to work correctly. Uninstalled it and reverted back to Grub. Gets the job done. :)