Difference between pages "Nx" and "Grub2"

From Linuxintro
(Difference between pages)
(MjM25AQEXb)
 
imported>ThorstenStaerk
 
Line 1: Line 1:
I'm in the mathematics siocetn most of the time, but I enjoy other siocetns. I sometimes answer in religion, horoscopes, politics and other siocetns. Over the years, this has often caused disagreements between my contacts from each of those siocetns.Or what about Y!A allowing members to control what siocetns they wish to see questions and answers from other contacts?I don't consider any siocetn on Y!A as nonsense, and because I answer on a particular siocetn doesn't imply whether I am pro or con on a particular issue. Please stay on topic.
+
To configure the GRUB2 bootloader on SUSE Linux, use the file /etc/grub2/grub.cfg. I can be generated by the command
 +
grub2-mkconfig -o /boot/grub2/grub.cfg
 +
from /etc/default/grub and the files in /etc/default/grub
 +
 
 +
/etc/grub.d/*____
 +
                  \
 +
                    --- (grub2-mkconfig -o /boot/grub2/grub.cfg --->  /etc/grub2/grub.cfg
 +
                  /
 +
/etc/default/grub
 +
 
 +
 
 +
The best way to add a menu item to your grub2 boot menu is to add the command menuentry to the end of /etc/grub.d/40_custom like this:
 +
* change /etc/grub.d/40_custom to look like:
 +
<pre>
 +
#!/bin/sh
 +
exec tail -n +3 $0
 +
# This file provides an easy way to add custom menu entries.  Simply type the
 +
# menu entries you want to add after this comment.  Be careful not to change
 +
# the 'exec tail' line above.
 +
 
 +
menuentry linuxintro{
 +
}
 +
</pre>
 +
* call grub2-mkconfig:
 +
<pre>
 +
# grub2-mkconfig -o /boot/grub2/grub.cfg
 +
Generating grub.cfg ...
 +
Found theme: /boot/grub2/themes/openSUSE/theme.txt
 +
Found linux image: /boot/vmlinuz-3.7.10-1.40-desktop
 +
Found initrd image: /boot/initrd-3.7.10-1.40-desktop
 +
Found linux image: /boot/vmlinuz-3.7.10-1.16-desktop
 +
Found initrd image: /boot/initrd-3.7.10-1.16-desktop
 +
  No volume groups found
 +
error: syntax error.
 +
</pre>
 +
* woops ;) Add a volume to the configuration in /etc/grub.d/40_custom:
 +
<pre>
 +
#!/bin/sh
 +
exec tail -n +3 $0
 +
# This file provides an easy way to add custom menu entries.  Simply type the
 +
# menu entries you want to add after this comment.  Be careful not to change
 +
# the 'exec tail' line above.
 +
 
 +
menuentry linuxintro{
 +
  set hd=(hd0,0)
 +
}
 +
</pre>
 +
* and run mkconfig again:
 +
# grub2-mkconfig -o /boot/grub2/grub.cfg

Revision as of 13:59, 18 January 2016

To configure the GRUB2 bootloader on SUSE Linux, use the file /etc/grub2/grub.cfg. I can be generated by the command

grub2-mkconfig -o /boot/grub2/grub.cfg

from /etc/default/grub and the files in /etc/default/grub

/etc/grub.d/*____
                 \
                   --- (grub2-mkconfig -o /boot/grub2/grub.cfg --->  /etc/grub2/grub.cfg
                 /
/etc/default/grub


The best way to add a menu item to your grub2 boot menu is to add the command menuentry to the end of /etc/grub.d/40_custom like this:

  • change /etc/grub.d/40_custom to look like:
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

menuentry linuxintro{
}
  • call grub2-mkconfig:
# grub2-mkconfig -o /boot/grub2/grub.cfg 
Generating grub.cfg ...
Found theme: /boot/grub2/themes/openSUSE/theme.txt
Found linux image: /boot/vmlinuz-3.7.10-1.40-desktop
Found initrd image: /boot/initrd-3.7.10-1.40-desktop
Found linux image: /boot/vmlinuz-3.7.10-1.16-desktop
Found initrd image: /boot/initrd-3.7.10-1.16-desktop
  No volume groups found
error: syntax error.
  • woops ;) Add a volume to the configuration in /etc/grub.d/40_custom:
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

menuentry linuxintro{
  set hd=(hd0,0)
}
  • and run mkconfig again:
# grub2-mkconfig -o /boot/grub2/grub.cfg