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

Notices


Reply
  Search this Thread
Old 07-19-2008, 09:11 PM   #1
P@trick99
LQ Newbie
 
Registered: Jun 2008
Location: UK
Distribution: Linux Mint
Posts: 28

Rep: Reputation: 15
Help me please ! Grub error . Read this...........


Hi there

I have 2 hard drives on my Dell vostro, and I have installed Linux Ubuntu 8.04 on my second HD (hd1)
I have selected GRUB loader to be install on the same HD (hd1)(sdb) I don't want to have the grub loader on my (hd0)(sda) where my vista is installed. PLEASE HELP! Grub Error 17: Cannot mount selected partition
HERE ARE SOME RESULTS FROM TERMINAL (Live CD)

cfdisk (util-linux-ng 2.13.1)

Disk Drive: /dev/sda
Size: 160041885696 bytes, 160.0 GB
Heads: 255 Sectors per Track: 63 Cylinders: 19457

Name Flags Part Type FS Type [Label] Size (MB)
------------------------------------------------------------------------------
Pri/Log Free Space 16.46*
sda1 Primary NTFS [] 10742.22*
Pri/Log Free Space 0.01*
sda2 Boot Primary NTFS [] 146500.47*
Pri/Log Free Space 2780.15

__________________________________________________ ____________________

cfdisk (util-linux-ng 2.13.1)

Disk Drive: /dev/sdb
Size: 160041885696 bytes, 160.0 GB
Heads: 255 Sectors per Track: 63 Cylinders: 19457

Name Flags Part Type FS Type [Label] Size (MB)
------------------------------------------------------------------------------
sdb1 Boot Primary Linux ext3 153500.18
sdb5 Logical Linux swap / Solaris 6539.10

__________________________________________________ __________________

ubuntu@ubuntu:~$ sudo fdisk -l

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

Device Boot Start End Blocks Id System
/dev/sda1 3 1308 10490442 7 HPFS/NTFS
/dev/sda2 * 1309 19119 143066855+ 7 HPFS/NTFS
/dev/sda3 19120 19457 2714985 5 Extended

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

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 18662 149902483+ 83 Linux
/dev/sdb2 18663 19457 6385837+ 5 Extended
/dev/sdb5 18663 19457 6385806 82 Linux swap / Solaris
ubuntu@ubuntu:~$

__________________________________________________ ___________________

GRUB :

grub> find /boot/grub/stage1
(hd1,0)

grub> find /boot/grub/stage2
(hd1,0)

grub> find /boot/grub/menu.lst
(hd1,0)

__________________________________________________ ___________________

# menu.lst - See: grub(*) info grub, update-grub(*)
# grub-install(*), grub-floppy(*),
# 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=c7ee2157-02f4-44e8-9e5f-433ab1ff2223 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 8.04, kernel 2.6.24-16-generic
root (hd1,0)
kernel /boot/vmlinuz-2.6.24-16-generic root=UUID=c7ee2157-02f4-44e8-9e5f-433ab1ff2223 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,0)
kernel /boot/vmlinuz-2.6.24-16-generic root=UUID=c7ee2157-02f4-44e8-9e5f-433ab1ff2223 ro single
initrd /boot/initrd.img-2.6.24-16-generic

title Ubuntu 8.04, 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/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

__________________________________________________ _____________________
Please can someone help me to fix the error 17
What do I need to change?

THANK YOU


Dell Vostro (Intel Core2 Duo CPU T7500 @ 2.2GHz, 3GB Ram, Nvidia GeForce 8600GT Vista H.
 
Old 07-19-2008, 09:26 PM   #2
stress_junkie
Senior Member
 
Registered: Dec 2005
Location: Massachusetts, USA
Distribution: Ubuntu 10.04 and CentOS 5.5
Posts: 3,873

Rep: Reputation: 332Reputation: 332Reputation: 332Reputation: 332
I would change the lines that read
Code:
root=UUID=c7ee2157-02f4-44e8-9e5f-433ab1ff2223 ro single
to
Code:
root=(hd1,0) ro single
Actually my menu.lst doesn't have a root statement. It has a kernel=(hd0,1)... statement so I'm not sure about the exact details my suggestion but I think I'm on the right track.

Last edited by stress_junkie; 07-19-2008 at 09:49 PM.
 
Old 07-19-2008, 11:15 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 14,845

Rep: Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823
If you are getting grub I think we can presume your Vista MBR got overlaid. No big deal. Let's see what's in the MBRs - try this from the liveCD as root
Code:
 for i in {a,b} ; do echo "/dev/sd"$i ; dd if=/dev/sd$i count=1 2>/dev/null | strings | grep -Ei "(ntfs|grub)" ; done
 
Old 07-19-2008, 11:22 PM   #4
yancek
LQ Guru
 
Registered: Apr 2008
Distribution: PCLinux, Slackware
Posts: 6,872

Rep: Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249Reputation: 1249
Your fdisk output shows sda1 as a small partition, probably the Dell Rescue and sda2 as the windows partition. You need to change your menu.lst entry from root (hd0,0)root (hd0,0)to rootnoverify (hd0,1). You use 'rootnoverify' to tell Grub to turn control over to another bootloader. Also, if you are booting from Grub on sdb, the second drive, you will need to change your BIOS so that it boots first from the second drive and change the entry for vista so windows thinks it is on the first drive.

title Windows vista
rootnoverify (hd1,0)
map (hd0) (hd1)
map (hd1) (hd0)
chainloader +1

I'm assuming you are unable to boot vista? Can you boot Ubuntu?
 
Old 07-20-2008, 03:06 AM   #5
budword
Member
 
Registered: Apr 2003
Location: Wisconsin
Distribution: Switched to regualr Ubuntu, because I don't like KDE4, at all. Looks like vista on crack.....
Posts: 675

Rep: Reputation: 31
Howdy, here's a tool everyone should have around, just in case.

http://www.supergrubdisk.org/

It offers a funky text menu, but it will fix most problems, including rewriting menu.list so you will be able to boot every OS oon your pc.

Good luck....

David
 
Old 07-20-2008, 06:17 AM   #6
P@trick99
LQ Newbie
 
Registered: Jun 2008
Location: UK
Distribution: Linux Mint
Posts: 28

Original Poster
Rep: Reputation: 15
Hi there, thanks for your replies.

I can boot Vista with no problem, if I want boot Linux - F12 Boot menu
Boot from second HD I get the Ubuntu screen (boot option)
Nothing works -Error 17: Cannot mount selected partition
I am going to try your suggestions, will let you know if it works

If you know better solutions please let me know

Thanks
Patrick
 
Old 07-20-2008, 06:24 AM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 14,845

Rep: Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823Reputation: 1823
Well, if you'd given us all that info initially, it would have been easy to give a fix.
 
Old 07-20-2008, 08:06 AM   #8
P@trick99
LQ Newbie
 
Registered: Jun 2008
Location: UK
Distribution: Linux Mint
Posts: 28

Original Poster
Rep: Reputation: 15
Hi there

I have changed the menu.lst

From:

## ## End Default Options ##

title Ubuntu 8.04, kernel 2.6.24-16-generic
root (hd1,0)
kernel /boot/vmlinuz-2.6.24-16-generic root=UUID=c7ee2157-02f4-44e8-9e5f-433ab1ff2223 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,0)
kernel /boot/vmlinuz-2.6.24-16-generic root=UUID=c7ee2157-02f4-44e8-9e5f-433ab1ff2223 ro single
initrd /boot/initrd.img-2.6.24-16-generic

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

[B]To[/B

## ## End Default Options ##

title Ubuntu 8.04, kernel 2.6.24-16-generic
root (hd1,0)
kernel /boot/vmlinuz-2.6.24-16-generic root=(hd1,0) 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,0)
kernel /boot/vmlinuz-2.6.24-16-generic root=(hd1,0) ro single
initrd /boot/initrd.img-2.6.24-16-generic

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

It didn't work I have the same Error 17: Cannot mount selected partition
 
Old 07-20-2008, 08:28 AM   #9
aus9
LQ Guru
 
Registered: Oct 2003
Posts: 5,124

Rep: Reputation: Disabled
lets relook at your windows menu items first
quote
# 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

Your installer has had a fit....and got confused so get rid of the first one....based on the bootable flag * against sda2.

to confirm I am right....try to boot both at some point....one should fail and that is the one you delete or comment out using # symbols if you prefer.

2) Now assuming sda2 entry was the correct one....its still wrong.

please remove the line
savedefault

what that does is say to grub....I booted into windows so that is my new default....wrong....you will eventually leave windows so you need to test both types out equally...heh heh.

Instead....above the very first real (uncommented) title add new lines please

timeout 5
default 0

grub counts from 0 so as you have not shown your full menu in last post...if you want windows and you have

title
blah

title
blah

title vista

> default will be 3 ok? and if no changes made will be booted in 5 seconds.

3) rootnoverify has nothing to do with chainloader.

chainloader command says grub is no longer the bootloader and allows your vista bootloader take over...which is ok by us.

root versus rootnoverify means grub is to report what filesystem format is to be reported
if root report structure
if norootverify do not report.

for vista...I have not had a chance to test so its safer to use noverify so your menu will be

title vista is on sda2
rootnoverify (hd0,1)
hide (hd0,0)
chainloader +1

OR

title vista is on sda1
rootnoverify (hd0,0)
chainloader +1

good luck
 
Old 07-20-2008, 10:18 AM   #10
aus9
LQ Guru
 
Registered: Oct 2003
Posts: 5,124

Rep: Reputation: Disabled
oh forgot your grub error 17

its because you have that savedefault option for vista causing you to try and boot vista and then you have attempted to use F12 which is not be setkey....a special grub command available in only a small number of grub menus....in other words if you press F12...grub does not know what to do...so you get an error.

f12 could be availbe if your menu had the correct setkey string available but your problem should IMHO be solved once you stop using savedefault in vista menus

good luck
 
Old 07-20-2008, 08:09 PM   #11
aus9
LQ Guru
 
Registered: Oct 2003
Posts: 5,124

Rep: Reputation: Disabled
Part ONE

I will post a new menu but before I do...I want to tell you there may be something funny about your UUID entry.

UUID is supposed to stop all confusion on whether to boot /dev/hda6 or /dev/sdb6 etc....(they are examples only)

funny thing is....after receiving your email....when I looked at your emailed menu..you left out UUID strings....when I went to copy and paste your old entries in....I found that
root=UUID=c7ee2157-02f4-44e8-9e5f-433ab1ff2223
which looked ok until I spotted a comment line ...one with a # symbol which can be found under...post 1
## ## Start Default Options ##
....culled to get to this line
# kopt=root=UUID=c7ee2157-02f4-44e8-9e5f-433ab1ff2223 ro

Notice how they are the same???

Yet that comment section is supposed to be a example so is highly suspect.

So did you change the UUID entries at some stage without telling us?

until you reply lets move on.

Part TWO

I can not trust your UUID entries therefore lets try a /dev style so here is a menu you should overwrite with root powers to the current one to cut out all of the crap and so we can start afresh ok?

-------copy and paste between lines please-----
default 0
timeout 5

title Ubuntu 8.04, kernel 2.6.24-16-generic
root (hd1,0)
kernel /boot/vmlinuz-2.6.24-16-generic root=/dev/sdb1 ro quiet splash
initrd /boot/initrd.img-2.6.24-16-generic

title Ubuntu 8.04, kernel 2.6.24-16-generic (recovery mode)
root (hd1,0)
kernel /boot/vmlinuz-2.6.24-16-generic root=/dev/sdb1 ro single
initrd /boot/initrd.img-2.6.24-16-generic

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

title Vista sda1
rootnoverify (hd0,0)
chainloader +1

title Vista sda2
rootnoverify (hd0,1)
hide (hd0,0)
chainloader +1
-------------------------end of copy and paste------------

Part THREE

Since you mention you are a newbie...you may not yet know how to use a live cd...but I suggest you will need to download one and keep it for some further training.

to be rude you need a graphical one...that has some tools on it...
sysrescd is the smallest ideal one for you at the moment.
But I do not know how you are off for bandwith limits etc so you need to reply at some stage to say what live cds you have etc

Part FOUR

THIS IS VERY IMPORTANT PLEASE

a) I can not trust your old menu so we need to prove or disprove that each entry works

b) we know that you were able to get into windows so we prove which menu entry is the one to use ok?

But since you can not get into linux you have not been able to make any changes....corrrect?

so we will use COMMANDS FROM THE GRUB MENU

take your time to read what I am asking you...do not make any changes until you understand why pls.

so once you have that understood....only for windows....which entry works?...none both or which one?

Part Five

I gather you can not get into linux?

so you will need to attempt to get in....from the command line unless you have a live cd.

its not hard by the way.

so only when you can prove to your self that you can

so you will need to write down on paper the new menu or print it out.

THE ONLY DIFFERENCES are that the menu entries do not need an extra line with the word boot on it.....and when we issue commands we do not need a title command

but we will show how to get into windows manually.....yes I know already can...but this is to give you confidence.

------------------------------------
When grub menu appears press the escape key to stop the clock and then press C for commands or just press C for commands

then type the following commands in the box and press enter at the end of each line pls

Code:
rootnoverify (hd0,0)
chainloader +1
boot
if that fails then change the command to
Code:
rootnoverify (hd0,1)
hide (hd0,0)
chainloader +1
boot
Please report if any work and which one.

Now lets attempt linux

Code:
root (hd1,0)
kernel /boot/vmlinuz-2.6.24-16-generic root=/dev/sdb1 ro
initrd /boot/initrd.img-2.6.24-16-generic
boot
write down all responses you see on the screen please
hopefully it boots you into linux

Last edited by aus9; 07-21-2008 at 09:53 AM. Reason: edit forgot to add c for commands
 
Old 07-21-2008, 05:55 AM   #12
budword
Member
 
Registered: Apr 2003
Location: Wisconsin
Distribution: Switched to regualr Ubuntu, because I don't like KDE4, at all. Looks like vista on crack.....
Posts: 675

Rep: Reputation: 31
Or maybe just let the supergrubbootdisk fix it for you. Unless your goal is to learn how to troubleshoot grub problems, and lets face it, learning is a big reason we love Linux. If you just want your system fixed, well, supergrub boot disk is the way to go. I have things to get done, I used to love spending hours and hours figuring out WHY and HOW something got screwed up, and how to fix it. Now I just want everything to work. Linux has got there, mostly. It's much easier to install from bare metal than windows is, you don't have to run all over the net tracking down funky drivers. Anyway, if you are still having trouble, try supergrubbootdisk.

David
 
Old 07-21-2008, 09:53 AM   #13
aus9
LQ Guru
 
Registered: Oct 2003
Posts: 5,124

Rep: Reputation: Disabled
oops forgot to add c for commands in my last post.
 
Old 07-21-2008, 02:15 PM   #14
Larry Webb
LQ Veteran
 
Registered: Jul 2006
Location: Crystal Beach, Texas
Distribution: Suse for mail +
Posts: 5,100
Blog Entries: 7

Rep: Reputation: 229Reputation: 229Reputation: 229
aus9, if you are over 50 years old you are forgiven.
 
Old 07-21-2008, 07:39 PM   #15
P@trick99
LQ Newbie
 
Registered: Jun 2008
Location: UK
Distribution: Linux Mint
Posts: 28

Original Poster
Rep: Reputation: 15
Here is what happened.........

Quote:
Originally Posted by aus9 View Post
Part ONE

I will post a new menu but before I do...I want to tell you there may be something funny about your UUID entry..............

Thank you very much for your help.

I have tried everything you mentioned.

1.So did you change the UUID entries at some stage without telling us?

No I didn't. I only made changes which I have mentioned in my previous post. (Highlighted red )

2. I edit the menu.lst as you told me to.

3 At the grub menu press C
Code:
rootnoverify (hd0,0)
chainloader +1
boot
This didn't work I've got "Error 17 cannot mount selected partition."

4. At the grub menu press C
Code:
rootnoverify (hd0,1)
chainloader +1 
boot
This says "Starting up..." But nothing happened.

When I typed
Code:
root (hd1,0)
kernel /boot/vmlinuz-2.6.24-16-generic root=/dev/sdb1 ro
I've got "Error 17 cannot mount selected partition"

You know, at the start up I hit F12 to get boot menu and select boot from second HD. Does this problem have anything to do with it?

You also know, I have selected GRUB loader to be installed on the second HD (hd1)(sdb) where Linux Ubuntu is. I don't want to have the grub loader on my (hd0)(sda) where my vista is installed. I am little bit scared if I have a problem with grub loader then I will not be able to boot to Vista.

Then I have tried this: (someone mentioned that)

At the grub menu press E
Then celect root (hd1,0)
press E (edit) to root (hd0,0)
and hit B (boot)

THIS WORKED. Linux Ubuntu boot it up successfully
I don't know what that means Any idea ???
Do I have to do this every time I want to boot Linux???

What do I do now??

Thank you aus9 and thank you all. This forum is more helpful than U..... forum

Patrick
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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



Similar Threads
Thread Thread Starter Forum Replies Last Post
GRUB Error 26: Disk Read Error (using grub4dos and ubuntu) Dark_Master Linux - Software 11 02-25-2007 08:42 AM
GRUB Error 26: Disk Read Error (using grub4dos and ubuntu) Dark_Master Linux - Newbie 2 11-07-2006 12:58 PM
grub read error hermouche Linux - Software 1 09-02-2006 07:19 PM
GRUB Read Error GoBoy Linux - Software 4 04-10-2005 04:31 AM


All times are GMT -5. The time now is 03:49 PM.

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