Results 1 to 7 of 7

Thread: Edit the grub file in /etc/default/

  1. #1

    Default Edit the grub file in /etc/default/

    Hi, I'm trying to edit the /etc/default/grub file and add pci=noaer in the line GRUB_CMDLINE_LINUX_DEFAULT="splash=silent resume=/dev/disk/by-label/Swap mitigations=auto quiet" but when I save it I get an error "The document could not be saved, as it was not possible to write to /etc/default/grub. Check that you have write access to this file or that enough disk space is available. The original file may be lost or damaged. Don't quit the application until the file is successfully written."

    How do I fix it?

  2. #2
    Join Date
    Sep 2013
    Location
    Norfolk, UK
    Posts
    1,570

    Default Re: Edit the grub file in /etc/default/

    How are you editing it, are you using YaST -> Bootloader -> Kernel Parameters ?
    Regards, Paul

    2x Tumbleweed (Snapshot: 20201025) KDE Plasma 5
    2x Leap 15.2 KDE Plasma 5

  3. #3
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    27,152

    Default Re: Edit the grub file in /etc/default/

    Hello and welcome.

    When you are bit used to Linux, you will have experienced that there are often many ways to achieve the same goal. Others can not really know which way you have chosen when you do not explain that. Thus saying "trying to edit" is very vague information.

    So please explain better what you did with what tool, etc. When this is in the CLI, then please copy/paste that (inclusing the line with the command, so we can see what you did) in between CODE tags in your post. You get CODE tags using the # button in the tool bar of the post editor. When applicable copy/paste complete, that is including the prompt, the command, the output and the next prompt.

    An example is here: Using CODE tags Around your paste.

    @Tannington already hints to this and also hints in what probably is the best way to edit the kernel parameter list in Grub.
    Henk van Velden

  4. #4
    Join Date
    Jun 2008
    Location
    Yorkshire
    Posts
    368

    Default Re: Edit the grub file in /etc/default/

    You also need to be root to amend system files (such as /etc/default/grub) using su or sudo. Also as root you have to run
    Code:
    grub2-mkconfig -o <path/to/grub.cfg>
    after the amendment to the grub file.
    Pete

  5. #5
    Join Date
    Feb 2010
    Location
    Germany
    Posts
    3,373

    Cool Re: Edit the grub file in /etc/default/

    Quote Originally Posted by ya_sg View Post
    I'm trying to edit the /etc/default/grub file
    Welcome to the openSUSE Forums!

    Looking at the error message your editor is emitting, at a guess, I would say that, there's an ownership and privileges issue here.

    Please be aware that, Linux has a strict ownership and access rights scheme / policy.
    Code:
     # cd /
     # l -d .
    drwxr-xr-x 23 root root 4096 19. Aug 11:01 ./
     # l -d /etc
    drwxr-xr-x 141 root root 12288  1. Okt 13:26 /etc/
     # l -d /etc/default
    drwxr-xr-x 2 root root 4096  8. Sep 17:35 /etc/default/
     # l /etc/default/grub
    -rw-r--r-- 1 root root 1742 10. Sep 18:43 /etc/default/grub
     #
    The symbols “drwxr-xr-x” indicate that, the files “/”, “etc” and “default” – which are all owned by the user “root” –
    • are directories and,
    • the owner – “root” – read, write and execute rights on these directories and,
    • the users who are members of the group “root” have read and execute rights on these directories and,
    • everyone else – “others” – have read and execute rights on these directories.

    For the case of the file “grub” which is located in the directory “/etc/default/” and owned by the user “root”, the symbols “-rw-r--r--” indicate that:
    • it's a regular file and,
    • the owner – “root” – can read from and write to the file and,
    • the users who are members of the group “root” can read from the file – they can not write to the file and,
    • everyone else, can read from the file – they can not write to the file …

  6. #6

    Default Re: Edit the grub file in /etc/default/

    I was using Dolphin file manager and simple notepad to edit the file. However, I used terminal this time and acquired ROOT permission and successfully edited the file now. Thanks!

  7. #7
    Join Date
    Jun 2008
    Location
    Netherlands
    Posts
    27,152

    Default Re: Edit the grub file in /etc/default/

    Nevertheless, my advice would be to use the system management tool YaST for these things as long as you are not 1000% sure that you are understanding all the implications of what you are doing.
    Henk van Velden

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •