Score:0

Grub error not an assignment

ca flag

I have an Ubuntu 20.04 on a desktop with 1 hard disk. For the last 2 or 3 months, the boot has slowed down and during bootup, there is an "error: not an assignment" message that flashes and disappears. I checked the questions in this forum from the past, and have checked the syntax of the /etc/grub.d/default file.. it is a very standard file and i don't see any syntax changes.. I have also downloaded grub-customiser and verified the grub config and there are no errors - but the boot is slow, and "error: not an assignment" still persists.

I do not have any custom config under 00_header, or 10_linux or 40_custom.

Is there anything else i need to check?

Update for @ChanganAuto: No errors when running 'sudo update-grub'

@pasmanpasmański, thank you and noted. Updated /etc/default/grub, and ran 'sudo update-grub' and rebooted.. no change, i still get the error:not an assignment message.

~$ grep TIMEOUT /etc/default/grub
GRUB_TIMEOUT_STYLE=menu
GRUB_TIMEOUT=0

Update: Dec 10

$ grep MODULES /etc/default/grub
#GRUB_PRELOAD_MODULES="part_gpt"

Commented out the preload modules, ran sudo update-grub and still no luck.. the error: not an assignment message persists

Update: resolved

After reading through a few more posts, I finally decided to run boot-repair - and it seems to have fixed my problem - the error message has disappeared - though it is a bit sad not knowing exactly what caused it or how it was fixed - boot repair info is below in case it is useful https://paste.ubuntu.com/p/XHZMck23s6

ChanganAuto avatar
us flag
UEFI or BIOS/Legacy?
ca flag
`~$ sudo efibootmgr [sudo] password for xxxxx: BootCurrent: 0001 Timeout: 2 seconds BootOrder: 0001,0002 Boot0001* ubuntu Boot0002 Windows Boot Manager ` >> UEFI and the settings are as above, although I am not sure how the Windows entry came about
ChanganAuto avatar
us flag
The Windows entry is there because there's a Windows bootloader installed in the EFI partition, alongside Ubuntu's. If you no longer have Windows then you certainly had it before and that entry is a leftover (deleting the Windows system partition - "C:" - doesn't remove its bootloader in UEFI systems). Now, I suggest running `sudo update-grub`. If any error make sure to update the question with the results.
pasman pasmański avatar
mx flag
Does it solve your issue https://forums.freebsd.org/threads/error-not-an-assignment.72404/
ca flag
@pasmanpasmański, thank you. I did see that post before and I had checked the files: /etc/default/grub and /etc/grub.d/40_custom and no syntax issues there. My 40_custom is unchanged from the default. My grub grub default file has standard entries: 'GRUB_DEFAULT=0 GRUB_TIMEOUT_STYLE="hidden" GRUB_TIMEOUT=0 GRUB_DISTRIBUTOR="`lsb_release -i -s 2> /dev/null || echo Debian`" GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" GRUB_CMDLINE_LINUX="" GRUB_PRELOAD_MODULES="part_gpt" `
ca flag
@ChanganAuto, thank you, I should have mentioned that I have executed "sudo update-grub" a few times with no errors, as below: `sudo update-grub [sudo] password for xxxxx: Sourcing file /etc/default/grub' Sourcing file /etc/default/grub.d/init-select.cfg' Generating grub configuration file ... Found linux image: /boot/vmlinuz-5.4.0-91-generic Found initrd image: /boot/initrd.img-5.4.0-91-generic Found linux image: /boot/vmlinuz-5.4.0-90-generic Found initrd image: /boot/initrd.img-5.4.0-90-generic Adding boot menu entry for UEFI Firmware Settings done`
pasman pasmański avatar
mx flag
@theertan Do not include output of the command in comment, [edit](https://askubuntu.com/posts/1379902/edit) your original question and append it here or use [pastebin](pastebin.com). In file /etc/default/grub, change line `GRUB_TIMEOUT_STYLE=menu` and then `sudo update-grub`
ca flag
@pasmanpasmański, thank you, I updated the original question.. no change after setting GRUB_TIMEOUT_STYLE=menu, I still get the error: not an assignment
ca flag
I ran grub_emu and it gave me a similar error: error: not an assignment.. However, in addition to that, there were more errors: Error: sparse file not allowed Error linux not defined Error initrd not defined And after a few seconds, it takes me to the grub boot menu - so this explains the delayed/slow boot.. however it still does not explain which file is causing the "sparse file not allowed" error. from reading through other posts, the only relevant files are: /etc/default/grub /etc/init.d/00_header /etc/init.d/10_linux etc.. but these are standard files ??
pasman pasmański avatar
mx flag
Try to remove line `GRUB_PRELOAD_MODULES="part_gpt"`. Grub loads much more modules by default.
ca flag
I have done this, but there is no change - please see the original question last para, thank you
Score:0
ca flag

After reading through a few more posts, I finally decided to run boot-repair - and it seems to have fixed my problem - the error message has disappeared - though it is a bit sad not knowing exactly what caused it or how it was fixed - boot repair info is below in case it is useful paste.ubuntu.com/p/XHZMck23s6

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.