Fedora Linux Support Community & Resources Center
  #1  
Old 21st October 2011, 10:24 AM
roboss Offline
Registered User
 
Join Date: Oct 2011
Posts: 3
linuxfirefox
Post update grub

Hello.
How to update grub?
(Equivalent this command in Ubuntu : #sudo update-grub)
Reply With Quote
  #2  
Old 21st October 2011, 11:08 AM
bob Offline
Administrator (yeah, back again)
 
Join Date: Jul 2004
Location: Colton, NY; Junction of Heaven & Earth (also Routes 56 & 68).
Age: 69
Posts: 22,177
linuxfirefox
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.
Reply With Quote
  #3  
Old 22nd October 2011, 01:23 PM
Stanca Offline
Registered User
 
Join Date: Apr 2010
Location: Bucharest,Romania,EU.
Age: 45
Posts: 31
linuxfirefox
Re: update grub

For grub2 in Fedora:
Quote:
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:
Reply With Quote
  #4  
Old 4th November 2011, 12:32 PM
pabloguevara Offline
Registered User
 
Join Date: Apr 2005
Location: Buenos Aires
Posts: 98
linuxfirefox
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
#
Reply With Quote
  #5  
Old 4th November 2011, 12:51 PM
Dutchy Offline
Registered User
 
Join Date: Aug 2011
Posts: 1,048
linuxfirefox
Re: update grub

Quote:
Originally Posted by Stanca View Post
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.
Reply With Quote
  #6  
Old 4th November 2011, 01:36 PM
pabloguevara Offline
Registered User
 
Join Date: Apr 2005
Location: Buenos Aires
Posts: 98
linuxfirefox
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
Reply With Quote
  #7  
Old 22nd November 2011, 03:13 PM
sgtguthrie Offline
Registered User
 
Join Date: Jul 2011
Posts: 1
linuxchrome
Re: update grub

Quote:
Originally Posted by Stanca View Post
For grub2 in Fedora:

Thanks, that works perfectly.
Reply With Quote
  #8  
Old 23rd November 2011, 09:29 PM
StephenH Offline
Registered User
 
Join Date: Jul 2004
Location: Wake Forest, NC
Age: 60
Posts: 1,385
linuxfirefox
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.

__________________
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

Last edited by StephenH; 24th November 2011 at 06:40 PM. Reason: Additional information-success!
Reply With Quote
  #9  
Old 24th November 2011, 08:39 PM
synic Offline
Registered User
 
Join Date: Mar 2005
Location: Brisbane, Australia
Age: 43
Posts: 266
linuxopera
Re: update grub

Quote:
Originally Posted by StephenH View Post
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.

Quote:
[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.
__________________
Discourse and Diatribe

Last edited by synic; 24th November 2011 at 10:12 PM.
Reply With Quote
  #10  
Old 25th November 2011, 04:53 PM
StephenH Offline
Registered User
 
Join Date: Jul 2004
Location: Wake Forest, NC
Age: 60
Posts: 1,385
linuxfirefox
Re: update grub

Quote:
Originally Posted by synic View Post
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
Reply With Quote
  #11  
Old 25th November 2011, 07:22 PM
pabloguevara Offline
Registered User
 
Join Date: Apr 2005
Location: Buenos Aires
Posts: 98
linuxfirefox
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
Reply With Quote
  #12  
Old 25th November 2011, 07:32 PM
synic Offline
Registered User
 
Join Date: Mar 2005
Location: Brisbane, Australia
Age: 43
Posts: 266
linuxopera
Re: update grub

Quote:
Originally Posted by StephenH View Post
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 View Post
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...
__________________
Discourse and Diatribe
Reply With Quote
Reply

Tags
grub, update

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

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


Current GMT-time: 23:28 (Saturday, 25-10-2014)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat
Anand - Sasel Photos on Instagram - Waddinxveen Travel Photos on Instagram