LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Kernel
User Name
Password
Linux - Kernel This forum is for all discussion relating to the Linux kernel.

Notices

Reply
 
Search this Thread
Old 08-04-2008, 02:19 AM   #1
kevinbenko
Member
 
Registered: Jun 2005
Location: Fargo, North Dakota
Distribution: Debian Testing/Unstable
Posts: 110

Rep: Reputation: 23
GRUB / menu.lst problems with new linux distro on second hard drive


NOTE: my computer is untainted by windows.

preliminaries:
*: My hard drive controller has done weird things to my drive numbering. My primary drive is /dev/hde, my secondary drive is /dev/hdf, but GRUB still calls my primary drive hd0.

=====

I have a working linux distro on /dev/hde.
I added another distro on /dev/hdf, and hosed the MBR on /dev/hde when it came to the GRUB installation phase.
I fixed this via knoppix (yeah, knoppix!!!)

=======

current situation:

GRUB installed on /dev/hde
GRUB can boot into the distribution on /dev/hde
GRUB cannot boot into the dstribution on /dev/hdf

I get error 21, it seems to have a problem with:

root (hd1,1)

=======

relevant information:

partition table from /dev/hdf:

Device Boot Start End Blocks Id System
/dev/hdf1 1 36 289138+ 82 Linux swap / Solaris
/dev/hdf2 * 533 1028 3984120 83 Linux

[[ yes, it's a tiny 8GB hard drive... once I get it up and running, it's going in an old computer I'll be using as a general purpose firewall/server ]]

-----------------

the relevant entry from my menu.lst file:

title EXPERIMENTAL
root (hd1,1)
kernel (hd1,1)/boot/vmlinuz-2.6.18-4-486 root=/dev/hdf2 ro single
initrd /boot/initrd.img-2.6.18-4-486

[[ yes, it's an old kernel, I installed it from an old netinstall CD I had laying around ]]
[[ I've tried several variations and have decided to ask for help ]]

NOTE: the distro on /dev/hdf is all in a single partition, no separate boot partition. My distro on /dev/hde has a separate /boot partition.

Perhaps the problem is a misunderstanding on my part of how the menu.lst entry might differ if the /boot directory is a separate partition...

=================

PS: the official documentation for GRUB is somewhat lacking.
I've googled this, but I've come up empty with respect to this particular problem.

================

Thank you in advance for any help or suggestions that anyone may offer.
 
Old 08-04-2008, 02:33 AM   #2
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,268

Rep: Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028
Quote:
Originally Posted by Grub manual
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.
What happens if you interrupt the boot menu, go to command mode and enter
Code:
root (hd<tab>
(where <tab> indicates you hit the tab key); how many options does it offer you - 1 or 2 ???.
 
Old 08-04-2008, 03:37 AM   #3
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
Can you post the full grub.conf/menu.lst and also ls of the boot directory on hdf2
 
Old 08-04-2008, 10:42 PM   #4
kevinbenko
Member
 
Registered: Jun 2005
Location: Fargo, North Dakota
Distribution: Debian Testing/Unstable
Posts: 110

Original Poster
Rep: Reputation: 23
Quote:
Originally Posted by syg00 View Post
What happens if you interrupt the boot menu, go to command mode and enter
Code:
root (hd<tab>
(where <tab> indicates you hit the tab key); how many options does it offer you - 1 or 2 ???.
If I enter 'c' at the grub bootup menu, then it only recognizes (hd0)

If I run grub from withing my existing (good) install, then it recognizes both (hd0) and (hd1)

What do you think, BIOS?, hard drive controller card?, or do I need to check the physical master/slave/auto connector setting on the hard drive itself???
 
Old 08-04-2008, 10:52 PM   #5
kevinbenko
Member
 
Registered: Jun 2005
Location: Fargo, North Dakota
Distribution: Debian Testing/Unstable
Posts: 110

Original Poster
Rep: Reputation: 23
Quote:
Originally Posted by billymayday View Post
Can you post the full grub.conf/menu.lst and also ls of the boot directory on hdf2
=====

Here's the menu.lst file on /dev/hdf:

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

# 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/hdf2 ro

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

## 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=(single-user 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 Debian GNU/Linux, kernel 2.6.18-4-486
root (hd1,1)
kernel /boot/vmlinuz-2.6.18-4-486 root=/dev/hdf2 ro
initrd /boot/initrd.img-2.6.18-4-486
savedefault

title Debian GNU/Linux, kernel 2.6.18-4-486 (single-user mode)
root (hd1,1)
kernel /boot/vmlinuz-2.6.18-4-486 root=/dev/hdf2 ro single
initrd /boot/initrd.img-2.6.18-4-486
savedefault

### 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/hde4.
title Debian GNU/Linux, kernel 2.6.26custom (on /dev/hde4)
root (hd0,0)
kernel /vmlinuz-2.6.26custom root=/dev/hde4 vga=775 ro vga=775
initrd /initrd.img-2.6.26custom
savedefault
boot


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/hde4.
title Debian GNU/Linux, kernel 2.6.26custom (single-user mode) (on /dev/hde4)
root (hd0,0)
kernel /vmlinuz-2.6.26custom root=/dev/hde4 vga=775 ro single
initrd /initrd.img-2.6.26custom
savedefault
boot


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/hde4.
title Debian GNU/Linux, kernel 2.6.25+kev+custom+k8+2008.07.13 (on /dev/hde4)
root (hd0,0)
kernel /vmlinuz-2.6.25+kev+custom+k8+2008.07.13 root=/dev/hde4 vga=775 ro vga=775
initrd /initrd.img-2.6.25+kev+custom+k8+2008.07.13
savedefault
boot


# This entry automatically added by the Debian installer for an existing
# linux installation on /dev/hde4.
title Debian GNU/Linux, kernel 2.6.25+kev+custom+k8+2008.07.13 (single-user mode) (on /dev/hde4)
root (hd0,0)
kernel /vmlinuz-2.6.25+kev+custom+k8+2008.07.13 root=/dev/hde4 vga=775 ro single
initrd /initrd.img-2.6.25+kev+custom+k8+2008.07.13
savedefault
boot

====================================
====================================

And here's a `ls -l` of the /boot directory on /dev/hdf2:

# ls -l
total 6784
-rw-r--r-- 1 root root 716728 Mar 26 2007 System.map-2.6.18-4-486
-rw-r--r-- 1 root root 71818 Mar 26 2007 config-2.6.18-4-486
drwxr-xr-x 2 root root 4096 Aug 4 21:12 grub
-rw-r--r-- 1 root root 4906030 Aug 4 21:08 initrd.img-2.6.18-4-486
-rw-r--r-- 1 root root 1220128 Mar 26 2007 vmlinuz-2.6.18-4-486
#

===============================
 
Old 08-04-2008, 10:56 PM   #6
kevinbenko
Member
 
Registered: Jun 2005
Location: Fargo, North Dakota
Distribution: Debian Testing/Unstable
Posts: 110

Original Poster
Rep: Reputation: 23
I'm going to chroot into the second distro, and have grub install itself to the /dev/hdf2 partition.

Then I'll go do some in-depth reading on bootloaders and other fun stuff...

===========

PS: The smaller hard drive is not hosed, it's working fine. I've been mucking around with it for a while, using some of it as a swap partition and messing around with encrypted filesystems and other stuff.

Last edited by kevinbenko; 08-04-2008 at 11:05 PM. Reason: added postscript
 
Old 08-04-2008, 11:12 PM   #7
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,268

Rep: Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028Reputation: 1028
Quote:
Originally Posted by kevinbenko View Post
If I enter 'c' at the grub bootup menu, then it only recognizes (hd0)

If I run grub from withing my existing (good) install, then it recognizes both (hd0) and (hd1)
The BIOS is not seeing it as a bootable drive. Doesn't mean it won't work in another system.
Quote:
I'm going to chroot into the second distro, and have grub install itself to the /dev/hdf2 partition.
That should allow you to at least check the system out. You may need to re-install to the MBR prior to attempting to install as the boot drive in another system.Perhaps not. I do it out of habit.
 
Old 08-04-2008, 11:19 PM   #8
billymayday
Guru
 
Registered: Mar 2006
Location: Sydney, Australia
Distribution: Fedora, CentOS, OpenSuse, Slack, Gentoo, Debian, Arch, PCBSD
Posts: 6,678

Rep: Reputation: 122Reputation: 122
What I'd try first, is from grub (ie after hitting "c"), is to type

find /boot/vmlinuz-2.6.18-4-486

and see what it throws up.
 
  


Reply

Tags
boot loader, grub, menulst


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
Pen Drive Install. Edit Grub menu.lst n8tgc DamnSmallLinux 3 01-04-2008 12:42 PM
Grub Menu doesn't reflect menu.lst file fatsheep Linux - Software 4 06-11-2007 01:29 PM
GRUB menu.lst/grub.conf file with multiple partitions dasy2k1 Linux - General 1 04-19-2007 08:42 AM
I need help making a GRUB menu.lst for an installed distro that won't boot brjoon1021 Linux - Newbie 1 04-17-2007 07:27 PM
/grub/menu.lst file disappeared but computer still boots (grub) rrrssssss Linux - General 5 04-08-2007 09:02 AM


All times are GMT -5. The time now is 11:13 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration