LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   GRUB: Error 28: Selected item cannot fit into memory (https://www.linuxquestions.org/questions/linux-general-1/grub-error-28-selected-item-cannot-fit-into-memory-560656/)

Tylo 06-10-2007 12:54 PM

GRUB: Error 28: Selected item cannot fit into memory
 
These are the commands I type into the grub shell:
Code:

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

grub> kernel (hd0,1)/vmlinuz
  [Linux-bzImage, setup=0x1e00, size=0x131e9d]

grub> initrd /boot/initrd.img-2.6.18-4-686

Error 28: Selected item cannot fit into memory

These are the sizes of the files:
Code:

-rw-r--r-- 1 root root 3.6M Jun 10 05:34 initrd.img-2.6.18-4-686
-rw-r--r-- 1 root root 1.3M May 10 00:14 vmlinuz-2.6.18-4-686


I don't have a lot of RAM, but it is 64 MB. It should be enough to fit the initrd, as you can see.

I can run LiveCDs, so there is nothing wrong with my hardware.

I've also successfully booted the machine using LILO (before my kernel upgrade). I've been having some issues with not being able to find the root file system with LILO, so I thought I'd give GRUB a shot. That's the story so far.

Any help would be appreciated,
Tylo

saikee 06-10-2007 01:09 PM

Grub is much bigger than Lilo. It has to occupy the memory if it is interpreting your command in real time.

Also it seems you are picking vmlinuz in the / directory and the initrd from the /boot directory. The kernel could expand in size too.

Lastly I think you also need to specify the "root=/dev/hdax" in the kernel statement to tell the kernel where to find the other system files.

Tylo 06-10-2007 03:45 PM

Re:
 
Quote:

Originally Posted by saikee
Grub is much bigger than Lilo. It has to occupy the memory if it is interpreting your command in real time.

Also it seems you are picking vmlinuz in the / directory and the initrd from the /boot directory. The kernel could expand in size too.

Lastly I think you also need to specify the "root=/dev/hdax" in the kernel statement to tell the kernel where to find the other system files.


I am fairly certain it the memory issue has something to do with my low RAM combined with my use of a Damn Small Linux live CD I am using to try and fix my problem.

However, I did find out that if I reboot the computer and let GRUB run off of the MBR, then I get no memory issues. The bad news is, I still have a problem.
The Problem
Here is my new /boot/grub/menu.list
Code:

# By default, boot the first entry
default 0

# Boot automatically after 9 secs.
timeout 9

# for booting Bonzai
title  Bonzai
root (hd0,1)
kernel /vmlinuz root=/dev/hda2
initrd /initrd.img

# Change the colors.
title Change the colors
color light-green/brown blink-red/blue

The problem I have here puzzles me. In LILO, setting initrd=/initrd.img seemed to do fine. I didn't get any Kernel panic - not syncing: No init found, Try passing init= option to kernel errors. I am, however, getting this Kernel panic error when attempting to use GRUB. Both vmlinuz and initrd.img are symbolic links to the actual files residing in /boot (vmlinuz-2.6.18-4-686 & initrd.img-2.6.18-4-686 respectively).

I've tried passing the kernel both init=/initrd.img & init=/boot/initrd.img-2.6.18-4-686. Both end up with a cannot execute initrd.img error (or cannot execute initrd.img-2.6.18-4-686 depending on what i set init equal to).

Any thoughts as to what I can try next?

saikee 06-10-2007 10:44 PM

If Lilo works why go with Grub?

I am not sure if the initrd can be passed via the kernel statement in Grub as I haven't seen one done it that way. May be it was possible when initrd was a lot smaller.

What is the version of your Grub?

DSL still using an older Grub to reduce the distro's footprint and that is not as robust as the later version, say 0.97. At one time I tried to boot every system with the oldest Grub I could find which was 0.94 from DSL. I gave up because it was nowhere as successful as 0.97.

You can try using a bootable Grub floppy loaded with a more recent Grub, since you know how to boot a Linux manually already. I did find different version of Grub behave slightly different.

Tylo 06-11-2007 06:42 AM

Quote:

Originally Posted by saikee
If Lilo works why go with Grub?

Sorry, I should clarify. Lilo does not work entirely. For some reason, it gets hung up on my root=/dev/hda2 step and panics (saying that it cannot find the root filesystem).


Quote:

Originally Posted by saikee
I am not sure if the initrd can be passed via the kernel statement in Grub as I haven't seen one done it that way. May be it was possible when initrd was a lot smaller.

Probably not then, but it's what the kernel panic suggested I try to do. It never did end up working when I tried it.

Quote:

Originally Posted by saikee
What is the version of your Grub?

I am using GRUB 0.97. The only reason I am using DSL is so I can mount and access my harddrive. I used chroot on my mounted directory and then used apt-get (I am using a Debian based system) in order to get the latest version of Grub.

saikee 06-11-2007 07:07 AM

Seem to me you are streching the 64Mb ram to the limit Linux not expecting.

Grub is definitely having a trouble to execute the initrd statement after the kernel statement has been successfully accepted.

Lilo did not boot either claiming a difficulty to loading the system files.

In the age when even 2Gb ram costs no more than a 400Gb hard disk or an average mobo there seems little point to exhaust the capability of Linux coping with such a small amount of ram. If you manage to get a system on it the distro has to be very small and very old, nothing like a modern Linux.

Tylo 06-11-2007 06:46 PM

Re:
 
Quote:

Originally Posted by saikee
Seem to me you are streching the 64Mb ram to the limit Linux not expecting.

Grub is definitely having a trouble to execute the initrd statement after the kernel statement has been successfully accepted.

Lilo did not boot either claiming a difficulty to loading the system files.

In the age when even 2Gb ram costs no more than a 400Gb hard disk or an average mobo there seems little point to exhaust the capability of Linux coping with such a small amount of ram. If you manage to get a system on it the distro has to be very small and very old, nothing like a modern Linux.

Well, Bonzai is a very small distro. It boasts fitting onto a 180mb disk. I suppose it could be possible that the folks who made Bonzai made a stripped down version of the kernel too boot (pun aggressively intended :-P).

Part of me finds it very surprising that GRUB and files of these sizes:

Code:

-rw-r--r-- 1 root root 3.6M Jun 10 05:34 initrd.img-2.6.18-4-686
-rw-r--r-- 1 root root 1.3M May 10 00:14 vmlinuz-2.6.18-4-686

cannot fit into my 64mb of RAM. Any second opinions out there?

BillyGalbreath 06-11-2007 07:46 PM

1) boot your system with a livecd.

2) chroot into you system stored on the hard drive(s).

3) run "update-grub".

4) reboot.

If you _still_ have problems, my only other guesses are a) not enough ram or b) your hard drive is partitioned wrong (possibly by an old-school partitioner) causing the MBR to be smaller than it really should for modern systems to boot properly.

Tylo 06-11-2007 08:05 PM

Quote:

Originally Posted by BillyGalbreath
If you _still_ have problems, my only other guesses are a) not enough ram

Is there anyone to find out exactly how much RAM I need? Or should I just call up Linus himself? :jawa:

TigerOC 06-12-2007 02:14 AM

WRT both Lilo and grub above (note you can only use one or the other and must remove whichever application you don't want) I think you should specify the location and name of the the respective vmlinuz and initrd.img instead of using the symlink. This becomes very relevant later when upgrading the kernel because you want access to the old kernel in case it goes pear shaped.
WRT to grub modify the menu.lst to:

title Bonzai-<kernel-version>
root (hd0,1)
kernel /boot/vmlinuz-<kernel-version> root=/dev/hda2 ro
initrd /boot/initrd.img-<kernel-version>

Note the ro on the end of the kernel line.

Memory is not relevant as this does not relate to extended memory (64MB) but relates to your system memory. This is the one area of computing that has never developed and is the same as it was when the first pc's came out in the late 80's. I have a laptop with 32MB and it boots these kernels fine.

Tylo 06-12-2007 06:13 AM

Quote:

Originally Posted by TigerOC

title Bonzai-<kernel-version>
root (hd0,1)
kernel /boot/vmlinuz-<kernel-version> root=/dev/hda2 ro
initrd /boot/initrd.img-<kernel-version>

There is no change. GRUB still informs me that it failed to execute /init

Quote:

Originally Posted by TigerOC
Note the ro on the end of the kernel line.

I assume here the ro is doing the same thing the read-only line is doing in LILO? If anyone can send me a link giving me all the possible options I could put on the kernel line here, that'd be much appreciated.

TigerOC 06-12-2007 08:13 AM

Quote:

Originally Posted by Tylo
There is no change. GRUB still informs me that it failed to execute /init

You have modified menu.lst to exactly what I recommended above. i.e. reference /boot/vmlinuz and /boot/initrd.img? If its it's telling you it failed to execute /init then you have something wrong in menu.lst because most distros also have a directory /initrd and if it's looking there it will fail.



Quote:

I assume here the ro is doing the same thing the read-only line is doing in LILO? If anyone can send me a link giving me all the possible options I could put on the kernel line here, that'd be much appreciated.
Correct, as it must be read only. The initrd.img creates a virtual system to boot the system and since it is virtual it is not possible to write to it. For reference read the directives in menu.lst and also read the documentation for grub which should be in /usr/share/doc

BillyGalbreath 06-12-2007 08:52 AM

If you follow my steps I mentioned before it will cause Grub to automagically reconfigure your menu.lst file according to your system and the installed kernels. I am 99.9% certain this will solve your problem! Just give it a shot, and make sure you chroot into your sytem from the livecd before running update-grub.

Tylo 06-12-2007 06:11 PM

Quote:

Originally Posted by BillyGalbreath
1) boot your system with a livecd.

2) chroot into you system stored on the hard drive(s).

3) run "update-grub".

4) reboot.

If you _still_ have problems, my only other guesses are a) not enough ram or b) your hard drive is partitioned wrong (possibly by an old-school partitioner) causing the MBR to be smaller than it really should for modern systems to boot properly.


First I'd like to appologize for more or less blowing off this post earlier. I read update-grub as some command that I had already tried before (they are starting to blur together :scratch: )

I used your method, but do _still_ have problems.

Quote:

Originally Posted by TigerOC
You have modified menu.lst to exactly what I recommended above. i.e. reference /boot/vmlinuz and /boot/initrd.img? If its it's telling you it failed to execute /init then you have something wrong in menu.lst because most distros also have a directory /initrd and if it's looking there it will fail.

To satify your request, I give you my update-grub generated menu.lst
Code:

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

## 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-686
root            (hd0,1)
kernel          /boot/vmlinuz-2.6.18-4-686 root=/dev/hda2 ro
initrd          /boot/initrd.img-2.6.18-4-686
savedefault

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

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

title          Debian GNU/Linux, kernel 2.4.20-bf2.4
root            (hd0,1)
kernel          /boot/vmlinuz-2.4.20-bf2.4 root=/dev/hda2 ro
savedefault

title          Debian GNU/Linux, kernel 2.4.20-bf2.4 (single-user mode)
root            (hd0,1)
kernel          /boot/vmlinuz-2.4.20-bf2.4 root=/dev/hda2 ro single
savedefault

### END DEBIAN AUTOMAGIC KERNELS LIST

The good news here is that I was able to boot back in with my old kernel (2.4.20-bf2.4).

Bad news is, I am still getting cannot execute /init and Kernel panic - not syncing: No init found, Try passing init= option to kernel errors whenever I try to boot either of the other two kernels.

Note: I believe the 2.6.18-4-486 was an accidental install on my part and should probably be disreguarded.

TigerOC 06-13-2007 02:04 AM

Is the initrd.img-2.6.18-4-486 actually located in the boot directory? You say that you installed the 2.6 kernel by accident. Check to see whether you have module-init-tools installed. If you haven't then install it see;

Upgrade to 2.6 kernel

This may explain why you are getting init errors.


All times are GMT -5. The time now is 01:10 AM.