You are not logged in.

#1 2016-09-29 10:20:06

peanutbutter
Member
Registered: 2016-09-29
Posts: 14

Cant configure Grub, changes to /etc/default/grub dont produce changes

Hi,
    I just installed Arch but I wanted to configure a lower timeout and add some kernel parameters but I make changes to  /etc/default/grub and run grub-mkconfig -o /boot/grub/grub.cfg but nothing changes

I have made only 3 changes to default : removed quiet added a kernel parameter for backlight and reduced timeout.

my /etc/default/grub 

GRUB_DEFAULT=0
GRUB_TIMEOUT=1
GRUB_DISTRIBUTOR="Arch"
GRUB_CMDLINE_LINUX_DEFAULT=" acpi_backlight=video"
GRUB_CMDLINE_LINUX=""

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

# Uncomment to enable Hidden Menu, and optionally hide the timeout count
#GRUB_HIDDEN_TIMEOUT=5
#GRUB_HIDDEN_TIMEOUT_QUIET=true

# 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 `vbeinfo'
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 and set to the desired menu colors.  Used by normal and wallpaper 
# modes only.  Entries specified as foreground/background.
#GRUB_COLOR_NORMAL="light-blue/black"
#GRUB_COLOR_HIGHLIGHT="light-cyan/blue"

# Uncomment one of them for the gfx desired, a image background or a gfxtheme
#GRUB_BACKGROUND="/path/to/wallpaper"
#GRUB_THEME="/path/to/gfxtheme"

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

#GRUB_SAVEDEFAULT="true"

my /boot/grub/grub.cfg 

#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

### BEGIN /etc/grub.d/00_header ###
insmod part_gpt
insmod part_msdos
if [ -s $prefix/grubenv ]; then
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

terminal_input console
terminal_output console
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=1
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
  set timeout=1
fi
play 480 440 1
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Arch Linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-6adcc8b0-b4cb-4f44-92f1-0f4f48519723' {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_msdos
	insmod ext2
	set root='hd0,msdos3'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3  6adcc8b0-b4cb-4f44-92f1-0f4f48519723
	else
	  search --no-floppy --fs-uuid --set=root 6adcc8b0-b4cb-4f44-92f1-0f4f48519723
	fi
	echo	'Loading Linux linux ...'
	linux	/boot/vmlinuz-linux root=UUID=6adcc8b0-b4cb-4f44-92f1-0f4f48519723 rw   acpi_backlight=video
	echo	'Loading initial ramdisk ...'
	initrd  /boot/initramfs-linux.img
}
submenu 'Advanced options for Arch Linux' $menuentry_id_option 'gnulinux-advanced-6adcc8b0-b4cb-4f44-92f1-0f4f48519723' {
	menuentry 'Arch Linux, with Linux linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-6adcc8b0-b4cb-4f44-92f1-0f4f48519723' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_msdos
		insmod ext2
		set root='hd0,msdos3'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3  6adcc8b0-b4cb-4f44-92f1-0f4f48519723
		else
		  search --no-floppy --fs-uuid --set=root 6adcc8b0-b4cb-4f44-92f1-0f4f48519723
		fi
		echo	'Loading Linux linux ...'
		linux	/boot/vmlinuz-linux root=UUID=6adcc8b0-b4cb-4f44-92f1-0f4f48519723 rw   acpi_backlight=video
		echo	'Loading initial ramdisk ...'
		initrd  /boot/initramfs-linux.img
	}
	menuentry 'Arch Linux, with Linux linux (fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-fallback-6adcc8b0-b4cb-4f44-92f1-0f4f48519723' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_msdos
		insmod ext2
		set root='hd0,msdos3'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos3 --hint-efi=hd0,msdos3 --hint-baremetal=ahci0,msdos3  6adcc8b0-b4cb-4f44-92f1-0f4f48519723
		else
		  search --no-floppy --fs-uuid --set=root 6adcc8b0-b4cb-4f44-92f1-0f4f48519723
		fi
		echo	'Loading Linux linux ...'
		linux	/boot/vmlinuz-linux root=UUID=6adcc8b0-b4cb-4f44-92f1-0f4f48519723 rw   acpi_backlight=video
		echo	'Loading initial ramdisk ...'
		initrd  /boot/initramfs-linux-fallback.img
	}
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
menuentry 'Windows 7 (loader) (on /dev/sda1)' --class windows --class os $menuentry_id_option 'osprober-chain-6ACA8814CA87DB29' {
	insmod part_msdos
	insmod ntfs
	set root='hd0,msdos1'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,msdos1 --hint-efi=hd0,msdos1 --hint-baremetal=ahci0,msdos1  6ACA8814CA87DB29
	else
	  search --no-floppy --fs-uuid --set=root 6ACA8814CA87DB29
	fi
	parttool ${root} hidden-
	chainloader +1
}
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

Last edited by peanutbutter (2016-09-29 12:32:04)

Offline

#2 2016-09-29 11:46:42

ayekat
Member
Registered: 2011-01-17
Posts: 1,634

Re: Cant configure Grub, changes to /etc/default/grub dont produce changes

Welcome to the Arch Linux forums!

From what I see, your changes are correctly applied to /boot/grub/grub.cfg (I can see both the `acpi_backlight=video` and the timeout).
So what exactly "doesn't change"?

peanutbutter wrote:

Also I could edit /etc/default/grub without root permission is that normal ?

Not really... what are the permissions on that file? How exactly did you edit them?

P.S
When posting code snippets, you can use code tags

[code]like this[/code]

This way people don't need to browse to an external page just to look at your code, which is a lot more "reader-friendly". smile


pkgs │ hacks │ cfg │ blag

Offline

#3 2016-09-29 12:15:50

peanutbutter
Member
Registered: 2016-09-29
Posts: 14

Re: Cant configure Grub, changes to /etc/default/grub dont produce changes

hey ayekat,

     Thanks for taking the time to help

     I tried but I could not find the changes in grub.cnf, let me look again.

     When I boot none of these changes are reflected : it is still in quiet mode and the timeout is still 5 seconds

[mendu@mendu ~]$ ls -la /etc/default/grub
-rw-r--r-- 1 root root 1517 Sep 29 09:08 /etc/default/grub

this is my non root user and I just "nano /etc/default/grub" to edit it

Last edited by peanutbutter (2016-09-29 12:18:09)

Offline

#4 2016-09-29 12:23:58

ayekat
Member
Registered: 2011-01-17
Posts: 1,634

Re: Cant configure Grub, changes to /etc/default/grub dont produce changes

Those permissions seem to be alright. And you can successfully save the file afterwards? That's rather awkward, but I have no idea currently...

Are you using a system with UEFI by any chance?
Perhaps GRUB uses a different config that is in the EFI system partition, and if you haven't mounted it correctly, you might be updating the wrong grub.cfg.


pkgs │ hacks │ cfg │ blag

Offline

#5 2016-09-29 12:37:19

peanutbutter
Member
Registered: 2016-09-29
Posts: 14

Re: Cant configure Grub, changes to /etc/default/grub dont produce changes

Your right, I was only able to view but not save changes, my bad

I am fairly sure I am not using uefi because I tried and failed to install it on my laptop (6 years old) for hackintosh
and because :

[mendu@mendu ~]$ cd /boot/efi
bash: cd: /boot/efi: No such file or directory

Offline

#6 2016-09-29 12:50:08

ayekat
Member
Registered: 2011-01-17
Posts: 1,634

Re: Cant configure Grub, changes to /etc/default/grub dont produce changes

If /boot/efi does not exist, this could also mean that you have not properly mounted the partition into /boot, so that doesn't prove much.
However, "6 years old" is a strong indication that it is probably still the good ol' "classic" BIOS smile

When booting the system, if you edit one of the entries in the GRUB menu (by pressing 'e', I think), does the kernel line contain the right options from grub.cfg (e.g. the `acpi_backlight=video` option)?


pkgs │ hacks │ cfg │ blag

Offline

#7 2016-09-29 13:05:36

peanutbutter
Member
Registered: 2016-09-29
Posts: 14

Re: Cant configure Grub, changes to /etc/default/grub dont produce changes

I solved this problem by reinstalling grub more specifically i ran

# grub-install --target=i386-pc /dev/sdx
# grub-mkconfig -o /boot/grub/grub.cfg

thanks ayekat, I feel I learned a lot today. Is reinstalling anything buggy a good idea in general ?

Offline

#8 2016-09-29 13:22:40

ayekat
Member
Registered: 2011-01-17
Posts: 1,634

Re: Cant configure Grub, changes to /etc/default/grub dont produce changes

peanutbutter wrote:

thanks ayekat, I feel I learned a lot today.

You're welcome?

Although, actually I think you've rather robbed yourself of a chance to learn something (solving problems also consists of understanding them, not just making them go away smile).
As it stand, we don't know what the issue really was, and it might appear again.

The answer to this question,

Is reinstalling anything buggy a good idea in general ?

would thus be: No¹.

___
¹ Unless you know why you need to reinstall it.

Last edited by ayekat (2016-09-29 13:23:33)


pkgs │ hacks │ cfg │ blag

Offline

#9 2016-09-29 13:26:35

peanutbutter
Member
Registered: 2016-09-29
Posts: 14

Re: Cant configure Grub, changes to /etc/default/grub dont produce changes

I'm cool with it cause this installation is giving me enough "opportunities"

Last edited by peanutbutter (2016-09-29 13:26:54)

Offline

#10 2016-10-01 12:22:55

peanutbutter
Member
Registered: 2016-09-29
Posts: 14

Re: Cant configure Grub, changes to /etc/default/grub dont produce changes

Should this be marked solved ?

Offline

Board footer

Powered by FluxBB