Article: GNU Grub2 Command Help/Config Editor - Version: 2.01

openSUSE 12.2 and 12.3 is using Grub2 by default and Grub2 has a whole new command set to learn. In order to help us all better use Grub2, I have put together a small script that shows all 24 commands I have found. When a command is selected, its default help, if present, will be displayed for you. You can then enter any command options for that command and press the enter key for them to be executed, as root, or just press the enter key to look at another command. In addition, I have found and allow you to view the included Grub2 manuals if you select Help. Grub2Cmd will detect if you have Grub2 or Grub2-efi installed and use the properly located menu file.

And Now, you have the option to edit any of the grub2 configuration files from the following menu. Your desktop will be determined, the correct SU command used and the proper Text Editor will be selected. I have added the ability to add a new script, to be executed on each update of your grub.cfg file. You can also delete a script file if you wish, but be careful to not delete existing script files here.

I have added a new function that allows you to select the default Grub 2 boot menu selection, even if it is included in the Advanced menu section. When changing the default Grub 2 boot selection, I have made some assumptions. The value “GRUB_DEFAULT=” can only exist once in the /etc/default/grub text file with no commented out duplicate entries that contain this same string value. I assume you still have/use the Advanced openSUSE grub 2 menu and have not removed it. Any grub 2 Linux Kernel menu entry used for Recovery can not be set as the default. Finally, when reverting back to the openSUSE grub 2 default for menu option 1, “GRUB_DEFAULT=saved” will be used.

The main menu allows you to determine just what framebuffer video modes are supported by grub 2. If you select the same and final resolution as used by your desktop, some slight speed up will be noticed. This is a list of fram buffer modes supported on my PC.

If you are not using a GPT Disk to boot Grub 2 in EFI mode and you still have an installed copy of Windows, you can use my new option to create a custom Windows boot menu option for Grub 2. Your hard disk(s) will be scanned for bootable NTFS partitions using fdisk.

So, if you are running openSUSE 12.2 and grub2 is detected as being installed, you can use the grub2cmd helper bash script I have written. This bash script I call grub2cmd can be obtained from SUSE Paste. I have written the grub2cmd bash script to reside in the ~/bin folder. Select the Download option in the top right using the link shown below and select open with Kwrite or another text editor. Then save the following text into the file called grub2cmd (as in /home/username/bin/grub2cmd):

GNU Grub2 Command Help/Config Editor - Version: 2.01

It is possible to directly download the script from SUSE Paste using the following commands (You must delete the old version of grub2cmd first should one exist). Just open up a terminal session and copy the text from any code block show here and past it after the terminal prompt and then press enter:

rm ~/bin/grub2cmd
wget -nc -O ~/bin/grub2cmd

Next, you need to mark the file grub2cmd as executable with the following command:

chmod +x ~/bin/grub2cmd

You can add all three commands above and run it as one. Just copy and paste the following command into a terminal session:

rm ~/bin/grub2cmd ; wget -nc -O ~/bin/grub2cmd ;  chmod +x ~/bin/grub2cmd

To use grub2cmd run the terminal command:


Grub2Cmd now creates a desktop icon if it finds you are running the KDE desktop and a KDE menu icon. Settings for these icons exist at the top of the script should you wish to disable them.

In my grub2cmd bash script I have the frame buffer command there to determine what is supported. You then go into YaST / System Boot loader, or use the same option from my bash script, then Boot Loader Options, and enter the VGA mode number in the VGA Mode number block (I use 0x034d), right after the number of seconds the menu is to wait. Then on the bottom left, I enter the equivalent Console Resolution number, I am using 1920x1200, that equates to the mode number. I use the highest resolution the Frame Buffer command finds, which may not be the highest supported by your monitor if you are then loading a Proprietary Video Driver I have found. But, it must be a supported Frame Buffer Mode on your setup to work properly. Following this method allows the Plymouth display to work I have found.

The new openSUSE 12.2 Documentation has a nice write up on using Grub 2 that is worth reading which you can find here:

openSUSE 12.2: Chapter 8. The Boot Loader GRUB2

We have some additional Great Articles about Grub 2 you can find here:

Booting openSUSE on UEFI BIOS with ELILO and Grub2 (part I)


Booting openSUSE on UEFI BIOS with ELILO and Grub2 (part II - Windows dual-boot )


Re-install Grub2 from DVD Rescue

If you have any questions or comment about using the bash script grub2cmd, just leave me a comment here.

Thank You,

Blogs: asroot : Bash : Packet Filter : C.F.U. : GPU’s : fewrup : F.S.M. : H.I. : nVIDIA : LNVHW : N.S.F. : S.A.K.C. : MMCHECK
S.A.S.I. : S.C.L.U. : S.G.T.B. : S.K.I.M. : S.L.A.V.E. : S.L.R.C. : S.T.A.R.T. : S.U.F.F. : SYSEdit : systemd : YaST Power

Hi jdmcdaniel3,
I have a peculiar installation of 12.3. The hardware is Dell Dimension C521 AMD 64 AthlonX2 with the internal 160 GB HDD dedicated to Vista, with a “non-bootable” 2TB external drive on USB 2. The BIOS boot sequence is USB drive, CD/DVD Drive and then sda. I boot off a pen drive 1GB with EXT 3 file system and the /boot is on this. The rest of the installation, that is swaap, / and home is on the extended partition on the external hdd.
I do need to install Grub2 Command. Following are my querries:
a) Do I need to carry out installation as root?
b) I read that the file is to be installed in the home directory. Is it root home or any other user home?
c) Will Grub2 Command work in this cross-disk installation?

Please let me know if any more details are needed in respect of my set up.


  1. To install Grub 2, you must be root.
  2. for a non-GPT disk Grub 2 can be installed into either the MBR or root / partition (if partition 1, 2, 3 or 4 only)
  3. Grub 2 must be loaded once from the designated boot disk MRB, root / drive partition or GPT disk Partition. The rest of the setup does not matter in booting and is mapped in accordance to your fstab file.

Thank You,

This is very nice. Is there a way to get it onto the distribution DVD?

I recently had Windoze wipe out my grub2 boot record, and I tried to rebuild it using SystemRescueCD; but it only had a tool to build grub, not grub2.

I ended up reinstalling because I couldn’t find a coherent description of the steps to use from the command line.

Boot maintenance is not something that one does often (I never had had occasion to do so before), so a tool like grub2cmd will be a real boon to many of us.