LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   Grub2 (grub-1.96) ERROR: NOT AN ASSIGNMENT (https://www.linuxquestions.org/questions/linux-general-1/grub2-grub-1-96-error-not-an-assignment-751076/)

ssenuta 08-29-2009 09:31 AM

Grub2 (grub-1.96) ERROR: NOT AN ASSIGNMENT
 
Grub2 grub.cfg (menu) will not boot a new menuentry unless that entry starts a new kernel
or new device. I cannot just change a kernel boot parameter option & get grub2 to boot from
its menu when the same kernel or device already has a menu entry.

However, pressing the "e" key for a selected menu item & adding a kernel boot option will
allow grub boot Linux with the new options.

Here is an example of two grub2 (grub.cfg) menu entries (The 1st entry will boot but not the 2nd entry):

menuentry "Linux-Sata 2.6.30" {
set root=(hd0,1)
set prefix=/grub
linux (hd0,1)/bzImage-2.6.30 root=/dev/sdb2 ro resume=/dev/sdb5 vga=771 raid=noautodetect
}

menuentry "Linux-Sata 2.6.30-runlevel-3" {
set root=(hd0,1)
set prefix=/grub
linux (hd0,1)/bzImage-2.6.30 root=/dev/sdb2 ro init 3 resume=/dev/sdb5 vga=771 raid=noautodetect
}

Please note that the only difference aside from the menuentry "names" is the addition of the "init 3"
kernel boot option to the 2nd menuentry item.

Does anyone know why Grub2 won't boot my 2nd menuentry. It just complains with ERROR: NOT AN ASSIGNMENT?
What exactly is an assignment anyway?

PTrenholme 08-29-2009 10:13 AM

Did you try init=3? The "=" is the assignment operator.

ssenuta 08-29-2009 08:59 PM

No, I haven't tried "init=3" but I will. However, "init 3" is the kernel boot parameter I used in Grub-Legacy & it worked.

I also have the following menuentry & it gives the same ERROR: NOT AN ASSIGNMENT. You'll note that the kernel boot parameter "confirm" doesn't use an (=) equal sign.

menuentry "Linux 2.6.30-confirm" {
set root (hd0,1)
set prefix=/grub
linux (hd0,1)/bzImage-2.6.30 root=/dev/sdb2 ro confirm resume=/dev/sdb5 vga=771 raid=noautodetect
}

The "confirm option allows me to step thru the boot process & select
the process I want to start. I have trouble remembering that option so, if I can have a grub.cfg menu with it, it helps.

PTrenholme 08-31-2009 10:30 AM

From the GRUB2 documentation:
Quote:

Extra options or text at the end of the line are ignored unless otherwise specified.
So, since the option isn't being ignored, try:
Code:

menuentry "Linux-Sata 2.6.30" {
set root=(hd0,1)
set prefix=/grub
linux (hd0,1)/bzImage-2.6.30 root=/dev/sdb2 ro resume=/dev/sdb5 vga=771 raid=noautodetect
}

menuentry "Linux-Sata 2.6.30-runlevel-3" {
set root=(hd0,1)
set prefix=/grub
linux (hd0,1)/bzImage-2.6.30 root=/dev/sdb2 ro resume=/dev/sdb5 vga=771 raid=noautodetect init 3
}
menuentry "Linux 2.6.30-confirm" {
set root (hd0,1)
set prefix=/grub
linux (hd0,1)/bzImage-2.6.30 root=/dev/sdb2 ro resume=/dev/sdb5 vga=771 raid=noautodetect confirm
}

The ro may also need to be moved to the end of the line, but it may be a "specified" option. (The documentation is, um, "less than complete," eh.)

ssenuta 08-31-2009 08:15 PM

I tried changing kernel option from "init 3" to "init=3" but it was ignored without error because there is no file called "3". The kernel option "init=[file]" is used to assign the init process to a different file instead of /sbin/init.

I will try changing the order of my kernel options like you suggested & post my results later.

GrapefruiTgirl 08-31-2009 08:29 PM

I suspect the same should apply in your case as it does with LILO; I don't use GRUB, but I have found that when giving an init option on the command line (boot line) I have not needed a space in it. You could try:

init3

and see if it likes that?

Good luck,
Sasha

PTrenholme 09-01-2009 11:53 AM

Quote:

Originally Posted by GrapefruiTgirl (Post 3664706)
I suspect the same should apply in your case as it does with LILO; I don't use GRUB, but I have found that when giving an init option on the command line (boot line) I have not needed a space in it. You could try:

init3

and see if it likes that?

Good luck,
Sasha

That reminds me: Fedora accepts a 3 by itself - no init needed - to boot to level 3.

ssenuta 09-02-2009 08:15 AM

I just tried using "init3" instead of "init 3" & grub2 still complains with ERROR: NOT AN ASSIGNMENT.

I also tried moving the "ro" & "init 3" to the end of my kernel's boot option line but grub2 still complains with ERROR: NOT AN ASSIGNMENT.

Thanks for the suggestions but the following grub2 problem still exists:

Grub2 grub.cfg (menu) will not boot a new menuentry unless that entry starts a new kernel
or new device. I cannot just change a kernel boot parameter option & get grub2 to boot from
its menu when the same kernel or device already has a menu entry.


All times are GMT -5. The time now is 05:17 PM.