I can't update my grub

so i’m trying to update my grub after i installed a new theme

when i do

sudo grub-mkconfig -o /boot/grub/grub.cfg

it says

/etc/default/grub: line 11: Section: command not found

i checked grub and these are the first 11 lines

GRUB_DEFAULT=saved
GRUB_TIMEOUT=5
GRUB_TIMEOUT_STYLE=hidden
GRUB_DISTRIBUTOR="Manjaro"
GRUB_CMDLINE_LINUX_DEFAULT="quiet apparmor=1 security=apparmor resume=UUID=11e0da9a-9c9c-4711-8847-bc08ac54f8c9 udev.log_priority=3g splash vt.global_cursor_default=0"
GRUB_CMDLINE_LINUX=""
# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings:  version 520.56.06


Section "ServerLayout"

what do i do

What the? Did you get a xorg config file mixed up with your Grub config file? That shouldn’t be in there.

no, it’s my grub, i opened /etc/default/grub and those are the first 11 lines

i didn’t add that there by the way it was there when i opened it

Maybe you accidentally ran an nvidia tool and told it to write into /etc/default/grub ?

Either way, the references to Xorg / Nvidia should be removed.

Can you paste the entire contents of your default Grub config? It might be even further invalid than the first 11 lines.

1 Like

this is the whole grub config

GRUB_DEFAULT=saved
GRUB_TIMEOUT=5
GRUB_TIMEOUT_STYLE=hidden
GRUB_DISTRIBUTOR="Manjaro"
GRUB_CMDLINE_LINUX_DEFAULT="quiet apparmor=1 security=apparmor resume=UUID=11e0da9a-9c9c-4711-8847-bc08ac54f8c9 udev.log_priority=3g splash vt.global_cursor_default=0"
GRUB_CMDLINE_LINUX=""
# nvidia-settings: X configuration file generated by nvidia-settings
# nvidia-settings:  version 520.56.06


Section "ServerLayout"
    Identifier     "Layout0"
    Screen      0  "Screen0" 0 0
    InputDevice    "Keyboard0" "CoreKeyboard"
    InputDevice    "Mouse0" "CorePointer"
    Option         "Xinerama" "0"
EndSection

Section "Files"
EndSection

Section "Module"
    Load           "dbe"
    Load           "extmod"
    Load           "type1"
    Load           "freetype"
    Load           "glx"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Mouse0"
    Driver         "mouse"
    Option         "Protocol" "auto"
    Option         "Device" "/dev/psaux"
    Option         "Emulate3Buttons" "no"
    Option         "ZAxisMapping" "4 5"
EndSection

Section "InputDevice"

    # generated from default
    Identifier     "Keyboard0"
    Driver         "kbd"
EndSection

Section "Monitor"

    # HorizSync source: edid, VertRefresh source: edid
    Identifier     "Monitor0"
    VendorName     "Unknown"
    ModelName      "HKC-TV"
    HorizSync       30.0 - 80.0
    VertRefresh     50.0 - 76.0
    Option         "DPMS"

# If you want to enable the save default function, uncomment the following
# line, and set GRUB_DEFAULT to saved.
GRUB_SAVEDEFAULT=true

# Uncomment to disable submenus in boot menu
#GRUB_DISABLE_SUBMENU=y

# Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="part_gpt part_msdos"

# Uncomment to enable booting from LUKS encrypted devices
#GRUB_ENABLE_CRYPTODISK=y

# Uncomment to use basic console
#GRUB_TERMINAL_INPUT=console

# Uncomment to disable graphical terminal
#GRUB_TERMINAL_OUTPUT=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command 'videoinfo'
GRUB_GFXMODE=auto

# Uncomment to allow the kernel use the same resolution used by grub
GRUB_GFXPAYLOAD_LINUX=keep

# Uncomment if you want GRUB to pass to the Linux kernel the old parameter
# format "root=/dev/xxx" instead of "root=/dev/disk/by-uuid/xxx"
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
GRUB_DISABLE_RECOVERY=true

# Uncomment this option to enable os-prober execution in the grub-mkconfig command
GRUB_DISABLE_OS_PROBER=false

# Uncomment and set to the desired menu colors.  Used by normal and wallpaper
# modes only.  Entries specified as foreground/background.
GRUB_COLOR_NORMAL="light-gray/black"
GRUB_COLOR_HIGHLIGHT="green/black"

# Uncomment one of them for the gfx desired, a image background or a gfxtheme
#GRUB_BACKGROUND="/usr/share/grub/background.png"

# Uncomment to get a beep at GRUB start
#GRUB_INIT_TUNE="480 440 1"

# Uncomment to ensure that the root filesystem is mounted read-only so that
# systemd-fsck can run the check automatically. We use 'fsck' by default, which
# needs 'rw' as boot parameter, to avoid delay in boot-time. 'fsck' needs to be
# removed from 'mkinitcpio.conf' to make 'systemd-fsck' work.
# See also Arch-Wiki: https://wiki.archlinux.org/index.php/Fsck#Boot_time_checking
#GRUB_ROOT_FS_RO=true

GRUB_THEME="/boot/grub/themes/dedsec/theme.txt"

Get rid of all of that.

1 Like

i ran this command again after i removed those section parts

sudo grub-mkconfig -o /boot/grub/grub.cfg

and i got this output

Generating grub configuration file ...
Found theme: /boot/grub/themes/dedsec/theme.txt
Found linux image: /boot/vmlinuz-6.1-x86_64
Found initrd image: /boot/amd-ucode.img /boot/initramfs-6.1-x86_64.img
Found initrd fallback image: /boot/initramfs-6.1-x86_64-fallback.img
Found linux image: /boot/vmlinuz-6.0-x86_64
Found initrd image: /boot/amd-ucode.img /boot/initramfs-6.0-x86_64.img
Found initrd fallback image: /boot/initramfs-6.0-x86_64-fallback.img
Found linux image: /boot/vmlinuz-5.15-x86_64
Found initrd image: /boot/amd-ucode.img /boot/initramfs-5.15-x86_64.img
Found initrd fallback image: /boot/initramfs-5.15-x86_64-fallback.img
Warning: os-prober will be executed to detect other bootable partitions.
Its output will be used to detect bootable binaries on them and create new boot entries.
Found Manjaro Linux (21.2.3) on /dev/sda3
Adding boot menu entry for UEFI Firmware Settings ...
Root filesystem isn't btrfs
If you think an error has occurred, please file a bug report at "https://github.com/Antynea/grub-btrfs"
Found memtest86+ image: /boot/memtest86+/memtest.bin
done

it says that it found the /dev/sda3 installation of manjaro but my main system is on /dev/sdb2, should it run fine or is there something i gotta do?

What is your partition layout?

lsblk -o name,fstype,size,type,mountpoints
[morning@core ~]$ lsblk -o name,fstype,size,type,mountpoints
NAME   FSTYPE   SIZE TYPE MOUNTPOINTS
sda           931.5G disk 
├─sda2 ext4   413.5G part /run/media/backupsda2
├─sda3 ext4    35.4G part 
├─sda4 ntfs   302.9G part /run/media/backupsda4
└─sda5 ext4   179.7G part /run/media/backupsda5
sdb           238.5G disk 
├─sdb1 vfat     300M part /boot/efi
├─sdb2 ext4   229.4G part /
└─sdb3 swap     8.8G part [SWAP]
sdc    ext4     7.5G disk 
sdd    ntfs     7.5G disk 

How did you install Manjaro?

What is the sda device?

Did you install another instance of Manjaro?

at first installed manjaro on a hard drive while waiting for an ssd

used it for a week then installed manjaro on the ssd when i got it

i still have the other instance encase i needed a linux environment to fix something in my system from it if it broke, because i have a lot of power outages and power went out while i was updating my kernel twice before and i had to reinstall the kernel

If that’s the case, seems like you should be fine now?

Did you try rebooting?

i’ll try rebooting rn

yup it works fine now, thank you mr. winnie :3

To satisfy your own curiosity, what does this reveal?

grep nvidia $HISTFILE | head -n -1

Perhaps you’ll find the culprit as to how nvidia-settings wrote into your Grub config file. :wink:


If it doesn’t yield the command that is responsible for this, then it means one of the following:

  • It was done via the GUI Nvidia Settings panel
  • It was done automatically under-the-hood by a process
  • You ran the nvidia-settings command as the root user
  • You accidentally copied+pasted into your Grub config while you still had Nvidia related things in your clipboard.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.