<---- template headericclude ----->
update grub
FedoraForum.org - Fedora Support Forums and Community
Results 1 to 12 of 12
  1. #1
    Join Date
    Oct 2011
    Posts
    3
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Post update grub

    Hello.
    How to update grub?
    (Equivalent this command in Ubuntu : #sudo update-grub)

  2. #2
    Join Date
    Jul 2004
    Location
    Colton, NY; Junction of Heaven & Earth (also Routes 56 & 68).
    Age
    78
    Posts
    24,772
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: update grub

    If you're using legacy grub, then log into a terminal as full root (su -), password, then "gedit /boot/grub/grub.conf" and make your additions or changes. Save, close and reboot to test. Legacy grub on Fedora won't recognize other distros, so you'd have to make manual entries.
    Linux & Beer - That TOTALLY Computes!
    Registered Linux User #362651


    Don't use any of my solutions on working computers or near small children.

  3. #3
    Join Date
    Apr 2010
    Location
    Bucharest,Romania,EU.
    Age
    54
    Posts
    38
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: update grub

    For grub2 in Fedora:
    su -c 'grub2-mkconfig -o /boot/grub2/grub.cfg'

    Fedora 16 Verne x86_64,
    Linux user # 492560
    "This is Linux land.In silent nights you can hear Windows machines rebooting!":cool:

  4. #4
    Join Date
    Apr 2005
    Location
    Buenos Aires
    Posts
    98
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: update grub

    I was having a similar issue updating my grub2 FC16, and I was about to post a question here, but while doing it, I found the solution to my problem. Here it is...

    I added a script to update grub to /etc/grub.d/:

    Code:
    #! /bin/sh
    set -e
    
    echo "Adding Mint Linux on /dev/sda7"
    
    cat << EOF
    menuentry "Linux Mint /dev/sda7" {
    set root=(hd0,7)
    linux /boot/vmlinuz
    initrd /boot/initrd.img
    }
    EOF
    But when I tried executing both update-grub and update-grub2, but I get always the same error:

    line 3: exec: grub-mkconfig: not found

    Also, the path to this cmd seems not set on my root user:

    Code:
    # update-grub
    bash: update-grub: command not found...
    # find / -name update-grub*
    /root/mint/usr/lib/grub-legacy/update-grub
    /root/mint/usr/lib/grub/update-grub_lib
    /root/mint/usr/sbin/update-grub
    /root/mint/usr/sbin/update-grub-gfxpayload
    /root/mint/usr/sbin/update-grub2
    So, I looked on update-grub:

    Code:
    # cat /root/mint/usr/sbin/update-grub2
    #!/bin/sh
    set -e
    exec grub-mkconfig -o /boot/grub/grub.cfg "$@"
    And it turns out that we also have grub2-mkconfig and grub-mkconfig, but only grub2-mkconfig is set on my root user path variable:

    Code:
    # find / -name grub-mkconfig
    /root/mint/usr/sbin/grub-mkconfig
    # find / -name grub2-mkconfig
    /sbin/grub2-mkconfig
    # echo $PATH
    /usr/lib/qt-3.3/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
    If I edit both update-grub and update-grub2 to use grub2-mkconfig (you can update only one, since they both do the same) it works:

    Code:
    # /root/mint/usr/sbin/update-grub
    Generating grub.cfg ...
    Found linux image: /boot/vmlinuz-3.1.0-0.rc9.git0.0.fc16.i686
    Found initrd image: /boot/initramfs-3.1.0-0.rc9.git0.0.fc16.i686.img
    Found linux image: /boot/vmlinuz-3.1.0-0.rc8.git0.1.fc16.i686
    Found initrd image: /boot/initramfs-3.1.0-0.rc8.git0.1.fc16.i686.img
    Found linux image: /boot/vmlinuz-3.1.0-0.rc6.git0.3.fc16.i686
    Found initrd image: /boot/initramfs-3.1.0-0.rc6.git0.3.fc16.i686.img
      No volume groups found
    Found Microsoft Windows XP Professional on /dev/sda1
    Found Linux Mint 11 Katya (11) on /dev/sda7
    done
    #

  5. #5
    Join Date
    Aug 2011
    Location
    ~
    Posts
    2,110
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: update grub

    Quote Originally Posted by Stanca
    For grub2 in Fedora: su -c 'grub2-mkconfig -o /boot/grub2/grub.cfg'
    I'm used to Ubuntu's update-grub way of updating grub2.
    Quite confusing that it uses stdout without the -o option so it looks like it has updated your grub but it turns out that it only displays the new config instead of saving it.
    Think this is more fool proof though.

  6. #6
    Join Date
    Apr 2005
    Location
    Buenos Aires
    Posts
    98
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: update grub

    I guess something like that happened, when I boot.... my /dev/sda7 was not there!

    I did "grub2-mkconfig -o /boot/grub2/grub.cfg" as root, then reboot... and now it's working.

    BTW, with "grub2-mkconfig -o /boot/grub2/grub.cfg", grub2 found /dev/sda7 automatically, so no need for the script on /etc/grub.d. Now I have 2 entries for /dev/sda7, one that I created manually, and one that was automatically created by grub. I will delete the manual entry later, but it's working.

    Thanks

  7. #7
    Join Date
    Jul 2011
    Posts
    1
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: update grub

    Quote Originally Posted by Stanca
    For grub2 in Fedora:

    Thanks, that works perfectly.

  8. #8
    Join Date
    Jul 2004
    Location
    Wake Forest, NC
    Age
    69
    Posts
    1,491
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: update grub

    Okay, I did the grub2-mkconfig -o /boot/grub2/grub.cfg as root after adding elevator=noop to my /etc/default/grub file since other threads indicate it would be helpful for when one is running on an SSD drive. However, when I look at the /boot/grub2/grub.cfg file generated, I do not see the entry for elevator=noop even though I verified that it is in the /etc/default/grub file.

    What's going on?

    Later edit:

    Okay, I'm still confused. I tried going a different route. I added the line elevator=noop to the end of the /etc/grub.d/40_custom file. When it was compiled with the grub2-mkconfig -o /boot/grub2/grub.cfg command, I saw the elevator=noop, but not at the end of the linux /vmlinuz line of the /boot/grub2/grub.cfg file that was generated. Instead it was in a separate section at the bottom. Is this added and is it running? Is there any way to check? Is this the proper place to put this command, or is it supposed to go elsewhere?

    Even later edit:

    I'm no longer confused!

    I found out what I was doing wrong. When I edited the /etc/default/grub file, I did not see the little quotation mark at the end of the line. I added the elevator=noop after it. I just looked again (now fully awake) and realized that I needed to put it inside the quotation mark. Once I did that, it generated the line just fine.

    Even though I never did get a reply, the information from previous posts was helpful. I had never worked with grub2 before. I did learn a few things in the process, so that is a good thing.

    Last edited by StephenH; 24th November 2011 at 07:40 PM. Reason: Additional information-success!
    StephenH

    "We must understand the reality that just because our culture claims certain things are true it does not mean they are!" --M. Liederbach

    http://pilgrim-wanderings.blogspot.com

  9. #9
    Join Date
    Mar 2005
    Location
    Brisbane, Australia
    Age
    51
    Posts
    272
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: update grub

    Quote Originally Posted by StephenH
    Okay, I did the grub2-mkconfig -o /boot/grub2/grub.cfg as root after adding elevator=noop to my /etc/default/grub file since other threads indicate it would be helpful for when one is running on an SSD drive. However, when I look at the /boot/grub2/grub.cfg file generated, I do not see the entry for elevator=noop even though I verified that it is in the /etc/default/grub file.

    What's going on?

    Later edit:

    Okay, I'm still confused. I tried going a different route. I added the line elevator=noop to the end of the /etc/grub.d/40_custom file. When it was compiled with the grub2-mkconfig -o /boot/grub2/grub.cfg command, I saw the elevator=noop, but not at the end of the linux /vmlinuz line of the /boot/grub2/grub.cfg file that was generated. Instead it was in a separate section at the bottom. Is this added and is it running? Is there any way to check? Is this the proper place to put this command, or is it supposed to go elsewhere?

    Even later edit:

    I'm no longer confused!

    I found out what I was doing wrong. When I edited the /etc/default/grub file, I did not see the little quotation mark at the end of the line. I added the elevator=noop after it. I just looked again (now fully awake) and realized that I needed to put it inside the quotation mark. Once I did that, it generated the line just fine.

    Even though I never did get a reply, the information from previous posts was helpful. I had never worked with grub2 before. I did learn a few things in the process, so that is a good thing.

    It it possible to post the output / a copy of YOUR /etc/default/grub file please? Mine doesn't appear to have much in it and I'm afraid to just start inserting things ad hock. I'm actually trying to configure some fstab boot options for SSD as being discussed in STEVA's SSD thread.

    EDIT:

    This is the output of my /etc/default/grub file.

    [root@study ~]# cat /etc/default/grub
    GRUB_TIMEOUT=2
    GRUB_DISTRIBUTOR="Fedora"
    GRUB_DEFAULT=0
    GRUB_CMDLINE_LINUX="rd.md=0 rd.lvm=0 rd.dm=0 KEYTABLE=us quiet SYSFONT=latarcyrheb-sun16 rhgb rd.luks=0 LANG=en_US.UTF-8"
    [root@study ~]#
    EDIT:

    You answered my question in this thread.
    Last edited by synic; 24th November 2011 at 11:12 PM.

  10. #10
    Join Date
    Jul 2004
    Location
    Wake Forest, NC
    Age
    69
    Posts
    1,491
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: update grub

    Quote Originally Posted by synic
    It it possible to post the output / a copy of YOUR /etc/default/grub file please? Mine doesn't appear to have much in it and I'm afraid to just start inserting things ad hock. I'm actually trying to configure some fstab boot options for SSD as being discussed in STEVA's SSD thread.

    EDIT:

    This is the output of my /etc/default/grub file.



    EDIT:

    You answered my question in this thread.
    Your /etc/default/grub file looks fine. The one from my desktop system which has not been modified looks like this:

    GRUB_TIMEOUT=5
    GRUB_DISTRIBUTOR="Fedora"
    GRUB_DEFAULT=saved
    GRUB_CMDLINE_LINUX="rd.md=0 rd.lvm=0 rd.dm=0 KEYTABLE=us quiet SYSFONT=latarcyrheb-sun16 rhgb rd.luks.uuid=luks-e5a066cc-814f-445f-ac4f-b3637bfdde35 rd.luks.uuid=luks-e957178c-cc46-4f0c-87c5-2c29f459e0df LANG=en_US.UTF-8"


    When I modified it for the SSD, I just added elevator=noop after the LANG=en_US.UTF-8, inside the quotation mark so that it looked like this:

    GRUB_CMDLINE_LINUX="rd.md=0 rd.lvm=0 rd.dm=0 KEYTABLE=us quiet SYSFONT=latarcyrheb-sun16 rhgb rd.luks.uuid=luks-e5a066cc-814f-445f-ac4f-b3637bfdde35 rd.luks.uuid=luks-e957178c-cc46-4f0c-87c5-2c29f459e0df LANG=en_US.UTF-8 elevator=noop"

    I think the /etc/default/grub file only contains the information that the grub2-mkconfig command tacks on when installing a new kernel. It looks like it does not need to be a full copy of grub.cfg. Any other parts come from the /etc/grub.d directory. I need to learn a whole lot more about grub2 before I start messing with those though.
    StephenH

    "We must understand the reality that just because our culture claims certain things are true it does not mean they are!" --M. Liederbach

    http://pilgrim-wanderings.blogspot.com

  11. #11
    Join Date
    Apr 2005
    Location
    Buenos Aires
    Posts
    98
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: update grub

    When you do
    Code:
    grub2-mkconfig -o /boot/grub2/grub.cfg
    Grub builds the grub.cfg file based on /etc/default/grub and all the scripts that are located at:
    Code:
    [pablo:~]$ ls -l /etc/grub.d/
    total 48
    -rwxr-xr-x. 1 root root 6709 Oct 26 22:19 00_header
    -rwxr-xr-x. 1 root root 5959 Oct 26 22:19 10_linux
    -rwxr-xr-x. 1 root root 5875 Oct 26 22:19 20_linux_xen
    -rwxr-xr-x. 1 root root 5960 Oct 26 22:19 30_os-prober
    -rwxr-xr-x. 1 root root  214 Oct 26 22:19 40_custom
    -rwxr-xr-x. 1 root root   95 Oct 26 22:19 41_custom
    -rwxr-xr-x. 1 root root 1259 Oct 26 22:19 90_persistent
    -rw-r--r--. 1 root root  483 Oct 26 22:19 README
    Here you have a good tutorial: http://www.dedoimedo.com/computers/grub-2.html

  12. #12
    Join Date
    Mar 2005
    Location
    Brisbane, Australia
    Age
    51
    Posts
    272
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: update grub

    Quote Originally Posted by StephenH
    Your /etc/default/grub file looks fine. The one from my desktop system which has not been modified looks like this:

    GRUB_TIMEOUT=5
    GRUB_DISTRIBUTOR="Fedora"
    GRUB_DEFAULT=saved
    GRUB_CMDLINE_LINUX="rd.md=0 rd.lvm=0 rd.dm=0 KEYTABLE=us quiet SYSFONT=latarcyrheb-sun16 rhgb rd.luks.uuid=luks-e5a066cc-814f-445f-ac4f-b3637bfdde35 rd.luks.uuid=luks-e957178c-cc46-4f0c-87c5-2c29f459e0df LANG=en_US.UTF-8"

    When I modified it for the SSD, I just added elevator=noop after the LANG=en_US.UTF-8, inside the quotation mark so that it looked like this:

    GRUB_CMDLINE_LINUX="rd.md=0 rd.lvm=0 rd.dm=0 KEYTABLE=us quiet SYSFONT=latarcyrheb-sun16 rhgb rd.luks.uuid=luks-e5a066cc-814f-445f-ac4f-b3637bfdde35 rd.luks.uuid=luks-e957178c-cc46-4f0c-87c5-2c29f459e0df LANG=en_US.UTF-8 elevator=noop"
    I stuck the elevator=noop towards the front just after all the 'md' stuff

    Quote Originally Posted by StephenH
    I think the /etc/default/grub file only contains the information that the grub2-mkconfig command tacks on when installing a new kernel. It looks like it does not need to be a full copy of grub.cfg. Any other parts come from the /etc/grub.d directory. I need to learn a whole lot more about grub2 before I start messing with those though.
    I know. It is a whole new ballgame now. I barely had my head around grub in the first place because it usually just worked, but now all this is new.

    I had trouble understanding the concept of Grub2 till I figured out that its not good to change grub2 directly; that in fact you need to change the parrameters you give to grub2 every time and then make grub2 build with the new parameters; rather than taking control of grub2 by editing its settings directly. It's simpler now that I understand that. But now there is a whole new world of settings to learn in order to be able to configure grub2's parameters.

    I've got a thread re the grub 2 keyboard layout settings that grub2 will accept. Do you know anything about what keyboard layout, keytable=us, the grub2 keytable setting, or which keyboard layout it can use to set as default? I'm wanting to have it boot to the Colemak keyboard layout when I get to the grub2 boot screen.

    EDIT:

    Yeah, what pabloguevara said...

Similar Threads

  1. grub prompt after update
    By GoinEasy9 in forum F15 Development
    Replies: 13
    Last Post: 27th March 2011, 04:09 PM
  2. did a large post preupgrade yum update, Grub now just says "GRUB"
    By marko in forum Installation, Upgrades and Live Media
    Replies: 4
    Last Post: 2nd July 2008, 07:34 PM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
[[template footer(Guest)]]