PDA

View Full Version : GRUB autoloading Linux setup



Yamaneko
07-30-2005, 07:28 PM
I have a dual-boot between XP and Linux. But when I boot-up my computer something about GRUB pops up for a second (GRUB stage 1.5 loading) and it goes directly into my Linux setup. I can't get into XP. This is my partition setup:


Device Boot Start End Blocks Id System
/dev/hda1 * 22 1173 8709088+ 7 HPFS/NTFS
/dev/hda2 1174 5170 30217320 f W95 Ext'd (LBA)
/dev/hda3 1 21 158728+ 83 Linux
/dev/hda5 1174 1986 6146248+ 83 Linux
/dev/hda6 1987 2799 6146248+ 83 Linux
/dev/hda7 2800 5061 17100688+ b W95 FAT32
/dev/hda8 5062 5170 824008+ 82 Linux swap / Solaris


hda1 = Windows
hda3 = /boot
hda5 = /
hda6 = /home
hda7 = shared disk space between linux and XP

This is my menu.lst 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'.
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

#
# 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 optons 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 specifiv 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=root=/dev/hda5 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

## 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

## nonaltoption boot targets option
## This option controls options to pass to only the
## primary kernel menu item.
## You can have ONLY one nonaltoptions line
# nonaltoptions=quiet splash

## 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 Ubuntu, kernel 2.6.10-5-386
root (hd0,2)
kernel /vmlinuz-2.6.10-5-386 root=/dev/hda5 ro quiet splash
initrd /initrd.img-2.6.10-5-386
savedefault
boot

title Ubuntu, kernel 2.6.10-5-386 (recovery mode)
root (hd0,2)
kernel /vmlinuz-2.6.10-5-386 root=/dev/hda5 ro single
initrd /initrd.img-2.6.10-5-386
savedefault
boot

title Ubuntu, kernel memtest86+
root (hd0,2)
kernel /memtest86+.bin
savedefault
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 Microsoft Windows XP Professional
root (hd0,0)
savedefault
makeactive
chainloader +1

Kakashi509
07-30-2005, 07:30 PM
how about you uninstall Linux then?

Yamaneko
07-30-2005, 07:41 PM
That probably wouldn't help anything since then I wouldn't have any OS to boot into. GRUB is written onto the MBR.

Yamaneko
07-30-2005, 07:49 PM
total 168
-rw-r--r-- 1 root root 15 2005-07-29 10:42 device.map
-rw-r--r-- 1 root root 7744 2005-07-29 10:42 e2fs_stage1_5
-rw-r--r-- 1 root root 7504 2005-07-29 10:42 fat_stage1_5
-rw-r--r-- 1 root root 8320 2005-07-29 10:42 jfs_stage1_5
-rw-r--r-- 1 root root 3719 2005-07-29 22:23 menu.lst
-rw-r--r-- 1 root root 3719 2005-07-29 21:45 menu.lst~
-rw-r--r-- 1 root root 6976 2005-07-29 10:42 minix_stage1_5
-rw-r--r-- 1 root root 9216 2005-07-29 10:42 reiserfs_stage1_5
-rw-r--r-- 1 root root 512 2005-07-29 10:42 stage1
-rw-r--r-- 1 root root 108104 2005-07-29 10:42 stage2
-rw-r--r-- 1 root root 9256 2005-07-29 10:42 xfs_stage1_5

Endless
07-30-2005, 08:04 PM
Mine looks like this:



default 0
timeout 30
splashimage=(hd0,6)/grub/splash.xpm.gz

title=Windows XP
root (hd0,1)
chainloader +1

title=Gentoo
root (hd0,6)
kernel /vmlinuz root=/dev/hda8 init=/linuxrc ramdisk=8192 splash=verbose,theme:emergence vga=791 real_root=/dev/hda8 video=1280x800
initrd /fbsplash-emergence-1024x768

Dr Unne
07-30-2005, 08:05 PM
I would backup your grub config file, and try this one in its place:


default 0
timeout 10

title Ubuntu, kernel 2.6.10-5-386
root (hd0,2)
kernel /vmlinuz-2.6.10-5-386 root=/dev/hda5 ro
initrd /initrd.img-2.6.10-5-386

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

Yamaneko
07-30-2005, 08:18 PM
Dr Unne's config didn't change anything. I still get the autoboot to Linux.

Endless
07-30-2005, 08:42 PM
Try removing makeactive? (works on mine)


Also, I saw you posted on the ubuntu forums aswell. xD

Edit: what's in hda2?

Yamaneko
07-30-2005, 08:47 PM
Yeah, Unne saw too. :D

Is makeactive the bootable flag?

Dr Unne
07-30-2005, 08:51 PM
makeactive "Sets the active partition on the root disk to GRUB's root device. This command is limited to primary PC partitions on a hard disk." Whatever the heck that means. Maybe grub looks for a partition with the bootable flag and sets its root to that.

http://maglite.epfl.ch/~fsalvi/docs/grub/grub-manual/Command_002dline-and-menu-entry-commands.html#Command_002dline-and-menu-entry-commands

Yamaneko
07-30-2005, 09:00 PM
hda2 is the extended partition which houses the logical partitions on the drive (30GBs). Can Win95 Ext'd handle LBA?

Endless
07-30-2005, 09:04 PM
I think I see what it is. Try root (hd0,1) for the windows entry.

Yamaneko
07-30-2005, 09:21 PM
Nope, nothing. It's like the file isn't being read.

Endless
07-30-2005, 09:25 PM
You do mount /boot every time you go edit menu.lst, right? Also, just to make sure, do this:
mv menu.lst grub.conf
ln -s grub.conf menu.lst

Dr Unne
07-30-2005, 09:30 PM
You can always try this too: http://ubuntuforums.org/showthread.php?t=52224

Yamaneko
07-30-2005, 09:37 PM
It automounts at startup. fstab:


# /etc/fstab: static file system information.
#
# <file system> <mount point> <type> <options> <dump> <pass>
proc /proc proc defaults 0 0
/dev/hda5 / reiserfs defaults 0 1
/dev/hda3 /boot ext2 defaults 0 2
/dev/hda6 /home reiserfs defaults 0 2
/dev/hda7 /mnt/shareddisk vfat defaults 0 0
/dev/hda8 none swap sw 0 0
/dev/hdc /media/cdrom0 udf,iso9660 ro,user,noauto 0 0
/dev/hdd /media/cdrom1 udf,iso9660 ro,user,noauto 0 0
/dev/fd0 /media/floppy0 auto rw,user,noauto 0 0

Endless
07-30-2005, 09:39 PM
Try making the grub.conf then, on my system, menu.lst is just a symlink to grub.conf.

Dr Unne
07-30-2005, 09:40 PM
On mine as well.

Yamaneko
07-30-2005, 09:47 PM
I placed it in the same directory as menu.lst. It didn't do anything. Maybe the MBR is just screwed up?

Endless
07-30-2005, 09:52 PM
Might be. Try setting hda3 as bootable (instead of hda1, see the fdisk output), and then use grub-install or whatever the command is in Ubuntu.

Edit: if all else fail, try lilo?

Kakashi509
07-30-2005, 10:10 PM
hmm try buying a new computer

Yamaneko
07-30-2005, 10:26 PM
Yay! We know what it is, I think. GRUB is loading, but not displaying itself. If I move the arrow keys around, I can eventually find Windows and when I hit enter, bootup Windows. I was just in Windows. Unne thinks it could be a framebuffer problem because when I get to the GDM and ctrl+alt F1, I can get to the console which shows me all the modules loaded during the bootup.

Dr Unne
07-30-2005, 10:29 PM
I really don't know. If it is a framebuffer issue, you can try a kernel parameter in your grub.conf like vga=785 . http://www.antlinux.com/pmwiki/pmwiki.php?n=HowTos.VgaModes

EDIT: http://portal.suse.com/sdb/en/2002/12/wessels_blackinst.html may also be helpful, even though it's for SUSE.

Endless
07-30-2005, 10:34 PM
I guess you can try messing with the color parameters in the grub config file, or use a theme (http://www.ubuntuguide.org/#displaysplashimagegrub) for it.

Edit: parameters like what Unne suggests only affect the system that you boot, not grub itself, afaik.

Yamaneko
07-30-2005, 11:22 PM
Ok, so what are my options here? I rather not have a splash screen.

Endless
07-30-2005, 11:29 PM
Why not? O_o

Yamaneko
07-31-2005, 12:16 AM
With a splash screen would I be able to ctrl+alt F1 and see the console? Sometimes it's important to see what's loading.

Endless
07-31-2005, 12:24 AM
The link I gave (http://www.ubuntuguide.org/#displaysplashimagegrub) is is for grub theming, not boot-time splashscreens (that's bootsplash or fbsplash that do it, and it's done right after grub loaded whatever kernel and initrd you chose, it's independant of grub). If you check my grub.conf, the line that says "splashimage=(hd0,6)/grub/splash.xpm.gz" is what theme grub uses, and the splashscreen (which you can default to verbose, btw, like I do) is the line part "splash=verbose,theme:emergence" in the kernel line.

Yamaneko
07-31-2005, 12:34 AM
I tried it. All I get now is a blank screen with a blinking underscore in the top-left of the screen. I'm still able to guess the location of the Windows entry. I hit the arrow key four times.

Endless
07-31-2005, 12:46 AM
Make sure the path to the ubuntu.xpm.gz (assuming you got that one) is correct.

From a command line(as root, or using su): grub
Then at the grub prompt: cat (hd0
and press tab to find the partition that matches where /boot is then keep using autocompletion until you have the path checked (for example "(hd0,6)/grub/splash.xpm.gz" for me).

Yamaneko
07-31-2005, 12:59 AM
Ok, this is weird. After I let the underscore blick for 10 seconds (the countdown time), the console shows up loading all the modules, but there are lines going down the screen and the text is all smudged. After maybe, 30 seconds (towards the end up the bootup), the lines disappear and the text is readable. I still can't see the GRUB menu, however.

Yamaneko
07-31-2005, 01:21 AM
Figured it out! No need for /boot since it's already on its own parition. So, I can now see the different boot options and immediately after, the console loading the different modules. Thanks for all the help, Endless and Dr Unne. :)

Endless
07-31-2005, 10:09 AM
Hurrah! xD
So it was the path that was incorrect (used (hd0,something)/boot/grub/stuff instead of (hd0,something)/grub/stuff)?

Dr Unne
07-31-2005, 07:16 PM
Gentoo symlinks /boot/boot to /boot just because that's such a common problem. Grub is not my friend.

At least it works now though.

Yamaneko
07-31-2005, 08:18 PM
Yep. Oh, and Unne I was able to find a backup of xorg.conf in the form of xorg.conf~. :D

Dr Unne
07-31-2005, 11:25 PM
nano is better than I thought then. But you should learn vim anyways.