0

I am very new in ubuntu and this will be my first question :) My laptop has an nvidia graphic card and on every boot I have to include the line nouveau.modeset=0 Is there a way to include it permanent in the kernel to have the boot automatic without having to type it everytime?

I have dual partition windows/ubuntu, not sure if this could affect on something.

Thanks

  • It is a kernel boot option see https://askubuntu.com/questions/19486/how-do-i-add-a-kernel-boot-parameter – Panther Aug 05 '18 at 16:49

1 Answers1

0

You can do that in two ways:

  1. Use a grub-customizer to edit Ubuntu's grub menu entry Enter the following commands in your terminal:

    sudo add-apt-repository ppa:danielrichter2007/grub-customizer
    sudo apt-get update
    sudo apt-get install grub-customizer
    grub-customizer
    

When it finishes loading all scripts, click right mouse button on your Ubuntu's entry and select Edit or select this menu entry and click on pencil over tabs. In the new window append the second one line with your parameter. Confirm all changes and close program saving all changes. I'm not sure if it'll survive kernel and grub update because this method is similar to editing /boot/grub/grub.cfg file manually what is not recommended.

Inspiration: Is it possible to edit grub.cfg?

  1. Edit /etc/grub.d/10_linux file and update grub

Run in your terminal:

    sudo nano /etc/grub.d/10_linux

Then look for the following lines:

if test -d /sys/firmware/efi && test -e "${linux}.efi.signed"; then
    sed "s/^/$submenu_indentation/" << EOF
    linux   ${rel_dirname}/${basename}.efi.signed root=${linux_root_device_thisversion} ro ${args}
EOF
else
    if [ x"$GRUB_FORCE_PARTUUID" = x ]; then
        sed "s/^/$submenu_indentation/" << EOF
        linux   ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}
EOF
    else
        sed "s/^/$submenu_indentation/" << EOF
        linux   ${rel_dirname}/${basename} root=PARTUUID=${GRUB_FORCE_PARTUUID} ro ${args}
EOF

And append this one (from "if [ x"$GRUB_FORCE_PARTUUID" = x ]; then" section):

    linux   ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args}

with your desired parameter. Close file saving changes and use in terminal:

    sudo update-grub

And that's all. In my opinion this way is much more reliable.

Inspiration: Changing bootparameters in Ubuntu Grub

  • Hi Simaus, thanks for the step by step its great. Just one question, I do not understand the last line for the second option, what should I append and where, should I copy the last section? I see this: linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${args} –  Aug 07 '18 at 22:03