Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 21

Thread: Can't edit grub.cfg; Ubuntu will not save the file even though I use sudo

  1. #11
    Join Date
    Apr 2010
    Beans
    18

    Re: Can't edit grub.cfg; Ubuntu will not save the file even though I use sudo

    This is very frustrating. I do not regard locking the owner out of his own system to be a feature. I have never had a problem doing this before. I am trying to configure Karmic on a relatively new Toshiba laptop (which is a bit like trying to charge up a waterfall), and I must edit /boot/grub/grub.cfg in order to add 'acpi_osi="Linux"' to my kernel boot parameters, to see if the fan will work properly, as per recent troubleshooting instructions elsewhere in this very forum. The alternative is that the fan will never turn on or never turn off, depending on the distro/BIOS vers./configuration. I can't figure it out. Either way, this machine is essentially unusable with GNU+Linux, etc., etc. So a fix is proposed, and, come to find out, it cannot be done for security reasons. What madness. Every solution to every problem creates even more problems.

  2. #12
    Join Date
    Jan 2007
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Can't edit grub.cfg; Ubuntu will not save the file even though I use sudo

    Quote Originally Posted by JosephC View Post
    This is very frustrating. I do not regard locking the owner out of his own system to be a feature. I have never had a problem doing this before. I am trying to configure Karmic on a relatively new Toshiba laptop (which is a bit like trying to charge up a waterfall), and I must edit /boot/grub/grub.cfg in order to add 'acpi_osi="Linux"' to my kernel boot parameters, to see if the fan will work properly, as per recent troubleshooting instructions elsewhere in this very forum. The alternative is that the fan will never turn on or never turn off, depending on the distro/BIOS vers./configuration. I can't figure it out. Either way, this machine is essentially unusable with GNU+Linux, etc., etc. So a fix is proposed, and, come to find out, it cannot be done for security reasons. What madness. Every solution to every problem creates even more problems.
    Grub2 is configurable but you are trying to do it in an incorrect manner. To change the settings in grub.cfg, you change the information in the scripts which create it.

    Using "sudo" won't work on grub.cfg because the file is still not writable. To do what you want, which isn't recommended, you would have to "sudo chmod +w /boot/grub/grub.cfg" and then make the change.

    The way Grub 2 is designed, you should edit /etc/default/grub and add the "acpi" instruction to the linux kernel line:
    GRUB_CMDLINE_LINUX_DEFAULT=
    Make the change, save the file, and then update grub with "sudo update-grub" and your instruction will appear in the grub menu.

    To learn about Grub 2, check out the links in my signature line.
    GRUB2

    Retired.

  3. #13
    Join Date
    Apr 2010
    Beans
    18

    Re: Can't edit grub.cfg; Ubuntu will not save the file even though I use sudo

    Ah! Ok! Thank you very very much! I did not know that. I guess some people at the Toshiba forums also thought you could edit grub.cfg (or menu.lst) as root for Grub2 and mistakenly passed those instructions on as a possible fix for the fan problem.

    I apologize for losing my patience.
    Last edited by JosephC; April 14th, 2010 at 09:31 PM.

  4. #14
    Join Date
    Dec 2009
    Beans
    3

    Re: Can't edit grub.cfg; Ubuntu will not save the file even though I use sudo

    I hope I don't break rules by bumping this up.

    So I upgraded to Ubuntu 10.10 everything went fine however the entries of the previous Ubuntu version 9.10 remain there. This is what I get when I type upgrade-grub:

    Code:
    Found linux image: /boot/vmlinuz-2.6.35-22-generic
    Found initrd image: /boot/initrd.img-2.6.35-22-generic
    Found linux image: /boot/vmlinuz-2.6.31-22-generic
    Found initrd image: /boot/initrd.img-2.6.31-22-generic
    Found memtest86+ image: /boot/memtest86+.bin
    Found Windows NT/2000/XP (loader) on /dev/sda1
    done
    I tried Synaptic packet manager to delete the images and headers manually, but couldn't find them there. I also tried Ubuntu Tweak which couldn't find the files either. I'm pretty sure they have been deleted during the installation of the new version. Now I'm still a beginner and have a hard time to simply get rid off the entries. Googled for 3 hours for a solution. No success. Can you help me?

  5. #15
    Join Date
    Nov 2009
    Beans
    598
    Distro
    Ubuntu 11.04 Natty Narwhal

    Re: Can't edit grub.cfg; Ubuntu will not save the file even though I use sudo

    Quote Originally Posted by sisco311 View Post
    Nope, it's a security feature, gedit doesn't allows users (even root) to write read-only files.


    @OP see:
    community/Grub2
    Grub 2 - 5 Common Tasks
    Grub 2 Title Tweaks
    The Grub 2 Guide
    You can use 'gksudo gedit' to edit any file in GEdit, regardless of user permissions on the file.
    - Justin Reno
    Need an easy way to store files publicly or even privately without hassle over the internet to be accessed anywhere? Try Dropbox. Use this link to get an extra 250MB of storage!

  6. #16
    Join Date
    Jan 2007
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Can't edit grub.cfg; Ubuntu will not save the file even though I use sudo

    Quote Originally Posted by Trickymaster View Post
    I hope I don't break rules by bumping this up.

    So I upgraded to Ubuntu 10.10 everything went fine however the entries of the previous Ubuntu version 9.10 remain there. This is what I get when I type upgrade-grub:

    [CODE]
    Found linux image: /boot/vmlinuz-2.6.31-22-generic
    Found initrd image: /boot/initrd.img-2.6.31-22-generic

    Can you help me?
    If you ever had Grub legacy in 9.10 (or earlier if you did online updates) take a look in the /boot/grub folder for an old menu.lst file. Since the entries are coming up before memtest86+, it means Grub is finding them on your running Ubuntu partition.

    When grub runs it's updates, it looks for kernels but it also looks for old menu.lst and grub.cfg files. If there is still a menu.lst file in your system folder it might be getting the old kernels from there.

    If you don't find a file, so a search for the kernels that are showing up in the menu:
    Code:
    sudo find / -type f -name *2.6.31-22-generic
    GRUB2

    Retired.

  7. #17
    Join Date
    Dec 2009
    Beans
    3

    Re: Can't edit grub.cfg; Ubuntu will not save the file even though I use sudo

    Quote Originally Posted by drs305 View Post
    If you ever had Grub legacy in 9.10 (or earlier if you did online updates) take a look in the /boot/grub folder for an old menu.lst file. Since the entries are coming up before memtest86+, it means Grub is finding them on your running Ubuntu partition.

    When grub runs it's updates, it looks for kernels but it also looks for old menu.lst and grub.cfg files. If there is still a menu.lst file in your system folder it might be getting the old kernels from there.

    If you don't find a file, so a search for the kernels that are showing up in the menu:
    Code:
    sudo find / -type f -name *2.6.31-22-generic
    Hello,

    I couldn't find a menu.lst. However, I used the code above and got this
    Code:
    /boot/config-2.6.31-22-generic
    /boot/System.map-2.6.31-22-generic
    /boot/vmlinuz-2.6.31-22-generic
    /boot/abi-2.6.31-22-generic
    /boot/initrd.img-2.6.31-22-generic
    /boot/vmcoreinfo-2.6.31-22-generic

  8. #18
    Join Date
    Jan 2007
    Beans
    Hidden!
    Distro
    Ubuntu Development Release

    Re: Can't edit grub.cfg; Ubuntu will not save the file even though I use sudo

    Quote Originally Posted by Trickymaster View Post
    I couldn't find a menu.lst. However, I used the code above and got this
    Code:
    /boot/vmlinuz-2.6.31-22-generic
    /boot/initrd.img-2.6.31-22-generic
    These are the files that are triggering the menu entries. Don't know why Synaptic and Ubuntu Tweak aren't picking them up.

    If you are sure you don't need the files, you can remove them with a file browser opened as root. You can install "nautilus-gksu", which provides a right-click option to open a folder as root with Nautilus.

    This command will verify the kernel in use:
    Code:
    uname -r
    Run "sudo update-grub" after deleting or moving the old vmlinuz-2.6.31-22-generic kernel and initrd.img-2.6.31-22-generic
    GRUB2

    Retired.

  9. #19
    Join Date
    Dec 2009
    Beans
    3

    Re: Can't edit grub.cfg; Ubuntu will not save the file even though I use sudo

    Quote Originally Posted by drs305 View Post
    These are the files that are triggering the menu entries. Don't know why Synaptic and Ubuntu Tweak aren't picking them up.

    If you are sure you don't need the files, you can remove them with a file browser opened as root. You can install "nautilus-gksu", which provides a right-click option to open a folder as root with Nautilus.

    This command will verify the kernel in use:
    Code:
    uname -r
    Run "sudo update-grub" after deleting or moving the old vmlinuz-2.6.31-22-generic kernel and initrd.img-2.6.31-22-generic
    Yay! It worked. Thank you.

  10. #20
    Join Date
    Nov 2006
    Beans
    Hidden!

    Exclamation Re: Can't edit grub.cfg; Ubuntu will not save the file even though I use sudo

    Quote Originally Posted by oldfred View Post
    no, no, no

    you do not edit grub.cfg. The next update to anything kernel related will overwrite your changes.
    You edit /etc/default/grub see instructions:

    https://help.ubuntu.com/community/grub2
    the grub 2 guide (formerly grub 2 basics)
    http://ubuntuforums.org/showthread.php?t=1195275

    this is the best answer i have ever read all around web !!!!!!!!!
    You damn right man !!!!!!!
    Whatever i have done it returned back.
    I made the file writable.
    Also i tried to copy a modifed one from another directory.
    But it did not help.
    Some how the original file returned back after 5 minutes.
    But it stays as i changed for a short time.
    That's also weird.
    It seemed to me there is a backup file somewhere.
    Whenver it is changed, the system replaces from the backup in 5 minutes.
    I believed so many times i changed or replaced the damn file.
    But i noticed it returned back to the original state all the time after all...
    That is pointless.
    There is only one file can be edited as you mentioned.
    After grub update.
    Everything is as it is as i want to be !!!!!!!!!!!!!
    That's the best answer ever man !!!!!!!!!

    I congratulate you !!!!

Page 2 of 3 FirstFirst 123 LastLast

Tags for this Thread

Bookmarks

Posting Permissions

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