GRUB and MBR questions from a real newbie

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post please read this

GRUB and MBR questions from a real newbie

Postby Rimmsy on Sun Mar 02, 2008 7:03 pm

Hi everyone

Like most who post here, I am a windows user who is making the plunge to Linux for a variety of reasons. I have played around with LiveCD versions of Ubuntu, Kubuntu, PcLinuxOS, and now Linux Mint. Of all of them, Mint suited me best.

A bit of background before I ask for help :) My PC has 4 drives, 3 of them are formatted NTFS and contain all my personal stuff. My primary drive (or C:\) is actually the 3rd drive (GParted refers to it as sdc). Based on things I have read on these forums I have partitioned it in the following way for a dual boot between Vista and Mint (please forgive me if I get my terminology mixed up or just plain wrong!):-

sdc1 = Vista NTFS partition 120Gb)
sdc2 = /boot ext2 250Mb
sdc3 = / ext3 12Gb
sdc5 = /home ext3 60Gb
sdc6 = swap 2500Mb

At the end of the installation process where it summarises what will be affected on the system, under the advanced button is a choice to install GRUB and place it by default on to hd0.

My question is, where do I install GRUB??

Unfortunately my first installation installed to hd0, but as it wasn't a bootable drive, there was no boot screen and Vista loaded normally. Subsequent attempts have resulted in obviously choosing the wrong drive or partition as it has led to a fatal error installing GRUB.

I have searched through the forums to try to find an answer but no luck. Maybe this question is obvious but I am feeling a bit thick at the moment!

Any help would be really appreciated!! In terms I can understand :oops:

Cheers
Rimmsy
Rimmsy
Level 1
Level 1
 
Posts: 12
Joined: Sun Mar 02, 2008 6:34 pm

Linux Mint is funded by ads and donations.
 

Re: GRUB and MBR questions from a real newbie

Postby Husse on Sun Mar 02, 2008 7:34 pm

Unless I misunderstand this you put grub in (hd2) - grub counts from zero so thats the MBR of the Vista disk - and Vista can be booted, the installer takes care of that
That should work....
Image
Don't fix it if it ain't broken, don't break it if you can't fix it
Husse
Level 21
Level 21
 
Posts: 19710
Joined: Sun Feb 11, 2007 7:22 am
Location: Near Borås Sweden

Re: GRUB and MBR questions from a real newbie

Postby Rimmsy on Sun Mar 02, 2008 7:44 pm

Husse wrote:Unless I misunderstand this you put grub in (hd2) - grub counts from zero so thats the MBR of the Vista disk - and Vista can be booted, the installer takes care of that
That should work....


I will give that a try. I think my problem was that I was calling it (sdc) rather than (hd2). That came to me at one point but I never tried it...good to hear that is what I should do.

Thanks Husse (and a quick response too!)

Cheers
Rimmsy
Rimmsy
Level 1
Level 1
 
Posts: 12
Joined: Sun Mar 02, 2008 6:34 pm

Re: GRUB and MBR questions from a real newbie

Postby Fred on Sun Mar 02, 2008 7:59 pm

You know, I have often wondered if whoever wrote grub knew what kind of ongoing problems would result from numbering from zero. Or maybe they did and it was just a cruel practical joke. :-)

Oh well, isn't life grand. :-)

Fred
Insanity: Doing the same thing over and over and each time expecting a different result.

Democracy is 2 wolves and a lamb voting on the menu. Liberty is an armed lamb protesting the electoral outcome. A Republic negates the need for an armed protest.
User avatar
Fred
Level 10
Level 10
 
Posts: 3356
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA

Re: GRUB and MBR questions from a real newbie

Postby Fred on Sun Mar 02, 2008 11:07 pm

Rimmsy,

I see you are using a separate /boot partition, which is fine. I do it all the time. If you install and everything seems to be working ok but you aren't getting the pretty Mint boot screen, don't panic. There is a simple fix if this happens.

Enjoy,

Fred
Insanity: Doing the same thing over and over and each time expecting a different result.

Democracy is 2 wolves and a lamb voting on the menu. Liberty is an armed lamb protesting the electoral outcome. A Republic negates the need for an armed protest.
User avatar
Fred
Level 10
Level 10
 
Posts: 3356
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA

Re: GRUB and MBR questions from a real newbie

Postby Rimmsy on Mon Mar 03, 2008 12:04 am

Fred wrote:Rimmsy,

I see you are using a separate /boot partition, which is fine. I do it all the time. If you install and everything seems to be working ok but you aren't getting the pretty Mint boot screen, don't panic. There is a simple fix if this happens.

Enjoy,

Fred


Thanks Fred!

I will try it out tonight when I am home. I will let you know if I need this simple fix.

Thanks again!
Rimmsy
Rimmsy
Level 1
Level 1
 
Posts: 12
Joined: Sun Mar 02, 2008 6:34 pm

Re: GRUB and MBR questions from a real newbie

Postby muskratmx on Mon Mar 03, 2008 12:12 am

There is no real reason to have a seperate /boot unless you needs dectate it, such as your bois won't reach the back end of the drive, or if you are going to boot multiple Linux distros , or some other exotic reason. A simple dual boot win/linux system doesn't need a /boot partition, your just adding one more number in your allready multiple drive list. Adding to the confusion.
User avatar
muskratmx
Level 4
Level 4
 
Posts: 226
Joined: Sun Dec 09, 2007 1:30 pm
Location: TX/MX Gulf Coast

Re: GRUB and MBR questions from a real newbie

Postby Rimmsy on Mon Mar 03, 2008 12:20 am

Even though I am just starting out, I would like to gradually move into a single Linux system and move away from windows entirely. This could also involve booting a variety of different distros or later versions of mint to ensure compatibility with existing software.

I may not need it now, but if I do it, I want to get it right first off and continue to learn!

Cheers
Rimmsy
Rimmsy
Level 1
Level 1
 
Posts: 12
Joined: Sun Mar 02, 2008 6:34 pm

Re: GRUB and MBR questions from a real newbie

Postby Rimmsy on Mon Mar 03, 2008 5:47 am

Unfortunately things didn't go to plan...

I successfully installed GRUB by telling it to install itself on to (hd2).

On reboot, came up with one error saying it couldn't find the linuxmint splash screen, and proceeded to load a text loader. As you would expect, Both Linux mint and Vista were listed on the loader.

BUT

Selecting Linux mint gives me the following message:-

root (hd2,1)
Error 22: No such partition

If I try to load Vista, I get "NTLDR is missing"

Displaying the command sequence for Linuxmint boot in GRUB gives me:-

root (hd2,1)
kernel vmlinuz-2.6.22-14-generic root=/dev/sdc3 ro quiet splash
initrd /initrd.img-2.6.22.14-generic
boot

I am not sure what other info I can give you. I need help but I am not sure what I did wrong...so far my first linux experience hasn't been good, but I want to get it to work!

Cheers
Rimmsy
Rimmsy
Level 1
Level 1
 
Posts: 12
Joined: Sun Mar 02, 2008 6:34 pm

Re: GRUB and MBR questions from a real newbie

Postby Husse on Mon Mar 03, 2008 6:38 am

If it is sdc3 it should be root (hd2,2)
Image
Don't fix it if it ain't broken, don't break it if you can't fix it
Husse
Level 21
Level 21
 
Posts: 19710
Joined: Sun Feb 11, 2007 7:22 am
Location: Near Borås Sweden

Re: GRUB and MBR questions from a real newbie

Postby Rimmsy on Mon Mar 03, 2008 7:07 am

Hi Husse

Tried that by editing the boot commands to boot mint, but got the same error saying No such partition.

I did this simply by choosing to edit the commands for that choice, then changing (hd2,1) to (hd2,2). Then pressing "b" to boot.

Is this the best way, or is there anything else I can try?

EDITED

When I installed Mint, under the advanced button on the final Installation page, I told it to install the boot loader on (hd2). Now bear in mind my newbie status, as I have a /boot partition, should it have been installed there? e.g. (hd2,2). Or is that just plain silly?

Thanks for your help so far

Cheers
Rimmsy
Rimmsy
Level 1
Level 1
 
Posts: 12
Joined: Sun Mar 02, 2008 6:34 pm

Re: GRUB and MBR questions from a real newbie

Postby Rimmsy on Mon Mar 03, 2008 8:04 am

Update

Reading some other users experiences within the ubuntu forums, I used the liveCD to boot using the first hard disk..and guess what. It worked!

What is interesting is that Nautilus shows that there is a boot directory on my windows partition (sdc1) and am wondering if that is part of my problem.

Unfortunately, it still won't boot without the liveCD in the drive. But at least I know that it can work! :D

Cheers
Rimmsy
Rimmsy
Level 1
Level 1
 
Posts: 12
Joined: Sun Mar 02, 2008 6:34 pm

Re: GRUB and MBR questions from a real newbie

Postby Fred on Mon Mar 03, 2008 11:23 am

Rimmsy,

Lets back up a bit and check some things. Run the live cd, open Gparted and post a screen shot of each of your hard drives so we can see what we are really working with.

Also, look on your /boot partition and open a file there called /boot/grub/menu.lst. Copy and paste the contents of that file so we can take a look at it.

Fred
Insanity: Doing the same thing over and over and each time expecting a different result.

Democracy is 2 wolves and a lamb voting on the menu. Liberty is an armed lamb protesting the electoral outcome. A Republic negates the need for an armed protest.
User avatar
Fred
Level 10
Level 10
 
Posts: 3356
Joined: Fri Jan 04, 2008 11:59 am
Location: NC USA

Re: GRUB and MBR questions from a real newbie

Postby atlef on Mon Mar 03, 2008 7:07 pm

Would just point out that windows IS stupid when it comes to mbr/bootloader placement. And we know that most likely your win install has installed this to sda not sdc which also might cause a problem.

atlef.
User avatar
atlef
Level 4
Level 4
 
Posts: 306
Joined: Sun Nov 18, 2007 8:20 am
Location: Stavanger NORWAY

Re: GRUB and MBR questions from a real newbie

Postby muskratmx on Mon Mar 03, 2008 11:07 pm

I hate to say "RTFM", but did you read the grub manual? It's well worth the read and isn't a waste of time. You got to remember grub isn't linux, it's an OS unto it's self it has it's own kernel. Just like you can't do DOS things in Linux, nether can you do Linux things in Grub.

root (hd2,1)
Error 22: No such partition


the grub manual states error 22 as "22 : No such partition =This error is returned if a partition is requested in the device part of a device- or full file name which isn't on the selected disk." the manual is located here. http://www.gnu.org/software/grub/manual/grub.html.

What you have stated with hd2,1 is that your kernel is located on hard disk 3 or E: or hdc, and on the second partition. Is that where your /boot folder is? We're not taking about your /(root) we're talking about where your kernel is. Because until grub passes the system off to the linux kernel, we're running grub, not linux. The root=/dev/hd?? is instruction for linux to know where the system lies because grub has told it different when it pass of the boot strap.
User avatar
muskratmx
Level 4
Level 4
 
Posts: 226
Joined: Sun Dec 09, 2007 1:30 pm
Location: TX/MX Gulf Coast

Re: GRUB and MBR questions from a real newbie

Postby Rimmsy on Mon Mar 03, 2008 11:22 pm

I am currently at work which means I can't post my menu.lst or a screenshot of my hard drives. I will do that when I get home.

Muskratms,
Perhaps I should have read the manual, but I didn't...that will be homework. From memory partitions were setup on sdc (3rd hard drive in system, also my c: drive (bootable) in the following order:-

Vista on first partition
/boot (this means it is hd2,1 (3rd hard drive, 2nd partition?))
/ (hd2,2)?
/home
/swap

I was under the impression that is where GRUB is looking as part of its boot commands refer to (hd2,1). Excuse my ignorance, but the first command is "root (hd2,1)". Is that telling GRUB where my root partition is? But how does it know where my boot partition is?

or am I just confusing myself?

As always, thanks very much for any help that you can give me!

Chhers
Rimmsy
Rimmsy
Level 1
Level 1
 
Posts: 12
Joined: Sun Mar 02, 2008 6:34 pm

Re: GRUB and MBR questions from a real newbie

Postby Rimmsy on Tue Mar 04, 2008 6:12 am

As requested, below is a screenshot of my drive:-

and my 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/sdc3 ro

## default grub root device
## e.g. groot=(hd0,0)
# groot=(hd2,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

## ## End Default Options ##

title Linux Mint, kernel 2.6.22-14-generic
root (hd2,1)
kernel /vmlinuz-2.6.22-14-generic root=/dev/sdc3 ro quiet splash
initrd /initrd.img-2.6.22-14-generic
boot

title Linux Mint, kernel 2.6.22-14-generic (recovery mode)
root (hd2,1)
kernel /vmlinuz-2.6.22-14-generic root=/dev/sdc3 ro single
initrd /initrd.img-2.6.22-14-generic
boot

title Linux Mint, kernel memtest86+
root (hd2,1)
kernel /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/sdc1
title Windows Vista/Longhorn (loader)
root (hd2,0)
savedefault
map (hd0) (hd2)
map (hd2) (hd0)
chainloader +1

Hope this helps!

Cheers
Rimmsy
Attachments
Screenshot--dev-sdc - GParted.png
Screenshot--dev-sdc - GParted.png (52.89 KiB) Viewed 2870 times
Rimmsy
Level 1
Level 1
 
Posts: 12
Joined: Sun Mar 02, 2008 6:34 pm

Re: GRUB and MBR questions from a real newbie

Postby Husse on Tue Mar 04, 2008 7:36 am

I'm running out of time so I don't have the time to read through the topic
But Rimmsy read the grub wiki carefully and you will understand (I hope - this is hard) how to cope with your grub situation
http://www.linuxmint.com/wiki/index.php ... _your_grub
Image
Don't fix it if it ain't broken, don't break it if you can't fix it
Husse
Level 21
Level 21
 
Posts: 19710
Joined: Sun Feb 11, 2007 7:22 am
Location: Near Borås Sweden

Re: GRUB and MBR questions from a real newbie

Postby Rimmsy on Tue Mar 04, 2008 7:44 am

No worries!

Thanks for all your help and time on this

Cheers
Rimmsy
Rimmsy
Level 1
Level 1
 
Posts: 12
Joined: Sun Mar 02, 2008 6:34 pm

Re: GRUB and MBR questions from a real newbie

Postby muskratmx on Tue Mar 04, 2008 11:41 am

I wasn't trying to be rude, I was just strongly encouraging you to invest in yourself, learning the grub os is a great investment. As a side note in the linux console as root type "grub", that will enter you into the grub enviorment, which has all it's own commands just like dos, to exit just type "quit".

title Linux Mint, kernel 2.6.22-14-generic
root (hd2,1)
kernel /vmlinuz-2.6.22-14-generic root=/dev/sdc3 ro quiet splash
initrd /initrd.img-2.6.22-14-generic
boot


The line root, above is for grub to read, it tells grub where the kernel is located, that is not necessarily your /(root) partition, this address is in grub terms because grub is reading it. If you have /boot on a separate partition then the kernel is there, after the kernel loads, grub is no longer running, so the kernel line has another address pointing it to the /(root), this address is in linux terms because linux is reading it, not grub.

but the first command is "root (hd2,1)". Is that telling GRUB where my root partition is?


No, it's telling grub where your kernel is. Normally the kernel is in the same folder as /grub/.

But how does it know where my boot partition is?


Ok when you install grub, there's actually two installations, the first is into your Host OS, in this case Linux, that allows grub to run at other times then boot. Then grub can/is run ether with an install script or manually. At that time it searches/creates for/a /boot/grub/menu.lst, it also maps the system and creates some stages files, such as stage1.5. Then it inserts a complete system onto the MBR, which knows where /boot/grub/menu.list is and those stage files.

If it couldn't find these files you would get other errors, that is not the case.

Grub is also doing another interesting thing in your case, I have one box doing this also.
title Windows Vista/Longhorn (loader)
root (hd2,0)
savedefault
map (hd0) (hd2)
map (hd2) (hd0)
chainloader +1

Grub is remapping your system. Windows will not boot in drive D: position, so grub is swapping the drives making it appear to the bios as drive C: before it passes it off to windows. Notice the two map lines. If windows was in the primary master position it would only have one map line.

I do see your windows partition is 100 and some odd gb big. Your bios has some limitations, if your second partion is beyond the bios limitations, grub won't be able to read it. It's sort of strange the boot strap process, I don't know all the technicole side of it. But to make it short and sweet.

The bios starts the PC, runs some checks, then passes off to the bootloader, this is done in an easy sort of way grub using some of the bois knowledge to start., then the bootloader runs and passes it off to the OS, again sort of easly, the reason for two different address lines in the stanza.

I've had occassion where grub loaded fine then was unable to finish due to driver issues and limitations. Some large drives play tricks on the bios to see that large drive, those tricks getting dropped have way through somehow.
User avatar
muskratmx
Level 4
Level 4
 
Posts: 226
Joined: Sun Dec 09, 2007 1:30 pm
Location: TX/MX Gulf Coast

Linux Mint is funded by ads and donations.
 
Next

Return to Installation & Boot

Who is online

Users browsing this forum: dotnetspec, Google Adsense [Bot] and 9 guests