Results 1 to 9 of 9

Thread: grub2 error: command 'gfxmode' not found

  1. #1
    Join Date
    Dec 2005
    Beans
    66

    grub2 error: command 'gfxmode' not found

    I have installed Xubuntu 12.04 64 bit with windows 7 recently. After using Grub customiser to add a background picture to the menu and other tweaks, after selecting xubuntu in the grub menu "Grub error: command gfxmode not found, Press any key to continue" is displayed. Xubuntu loads after pressing a key. I am using Ubuntu/Xubuntu since many years without any such problem. Browsing the forum/web has not yielded any solution. Kindly help.
    AMD Phenom XT1090T, NVidia GT 520, 8GB.

  2. #2
    Join Date
    Jun 2011
    Location
    Netherlands
    Beans
    146
    Distro
    Ubuntu

    Re: grub2 error: command 'gfxmode' not found

    Before trying anything else you should try if updating your GRUB helps
    Code:
    sudo update-grub
    Also posting your /boot/grub/grub.cfg might help.
    Have you modified any files in /etc/grub.d/ ?

  3. #3
    Join Date
    Dec 2005
    Beans
    66

    Re: grub2 error: command 'gfxmode' not found

    Yes, I have tried it without solving the problem. (I have only used grub customiser) My grub.cfg is pasted below please:

    #
    # DO NOT EDIT THIS FILE
    #
    # It is automatically generated by grub-mkconfig using templates
    # from /etc/grub.d and settings from /etc/default/grub
    #

    ### BEGIN /etc/grub.d/00_header ###
    if [ -s $prefix/grubenv ]; then
    set have_grubenv=true
    load_env
    fi
    set default="Windows 7 (loader) (on /dev/sda1)"
    if [ "${prev_saved_entry}" ]; then
    set saved_entry="${prev_saved_entry}"
    save_env saved_entry
    set prev_saved_entry=
    save_env prev_saved_entry
    set boot_once=true
    fi

    function savedefault {
    if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
    fi
    }

    function recordfail {
    set recordfail=1
    if [ -n "${have_grubenv}" ]; then if [ -z "${boot_once}" ]; then save_env recordfail; fi; fi
    }

    function load_video {
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
    }

    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos8)'
    search --no-floppy --fs-uuid --set=root f15229a0-6645-4c14-b90f-dc17afdf3947
    if loadfont /usr/share/grub/unicode.pf2 ; then
    gfxmode=800x600x8
    load_video
    insmod gfxterm
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos8)'
    search --no-floppy --fs-uuid --set=root f15229a0-6645-4c14-b90f-dc17afdf3947
    set locale_dir=($root)/boot/grub/locale
    set lang=en_US
    insmod gettext
    fi
    terminal_output gfxterm
    if [ "${recordfail}" = 1 ]; then
    set timeout=-1
    else
    set timeout=5
    fi
    play 480 440 1
    ### END /etc/grub.d/00_header ###

    ### BEGIN /etc/grub.d/05_debian_theme ###
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos8)'
    search --no-floppy --fs-uuid --set=root f15229a0-6645-4c14-b90f-dc17afdf3947
    insmod jpeg
    if background_image /home/sri/Pictures/RedFlower800x600.jpg; then
    set color_normal=white/black
    set color_highlight=green/black
    else
    set menu_color_normal=white/black
    set menu_color_highlight=black/light-gray
    fi
    ### END /etc/grub.d/05_debian_theme ###

    ### BEGIN /etc/grub.d/10_linux_proxy ###
    menuentry "Ubuntu, with Linux 3.2.0-24-generic" --class ubuntu --class gnu-linux --class gnu --class os {
    recordfail
    gfxmode $linux_gfx_mode
    insmod gzio
    insmod part_msdos
    insmod ext2
    set root='(hd0,msdos8)'
    search --no-floppy --fs-uuid --set=root f15229a0-6645-4c14-b90f-dc17afdf3947
    linux /boot/vmlinuz-3.2.0-24-generic root=UUID=f15229a0-6645-4c14-b90f-dc17afdf3947 ro quiet splash $vt_handoff
    initrd /boot/initrd.img-3.2.0-24-generic
    }
    ### END /etc/grub.d/10_linux_proxy ###

    ### BEGIN /etc/grub.d/30_os-prober_proxy ###
    menuentry "Windows 7 (loader) (on /dev/sda1)" --class windows --class os {
    insmod part_msdos
    insmod ntfs
    set root='(hd0,msdos1)'
    search --no-floppy --fs-uuid --set=root 925A4E745A4E555F
    chainloader +1
    }
    ### END /etc/grub.d/30_os-prober_proxy ###
    Last edited by murthy; May 3rd, 2012 at 02:50 PM.

  4. #4
    Join Date
    Aug 2009
    Location
    ~/
    Beans
    Hidden!
    Distro
    Xubuntu Development Release

    Re: grub2 error: command 'gfxmode' not found

    Check out the How to in my signature. Step 1 has gfxmode and if you like you can simplify your grub2 menu with it.
    There are several examples of what the screen will look like. My current screen is on post #105.

    I have these three menu items that display:

    Ubuntu Lucid Lynx
    Ubuntu Lucid Lynx (Recovery)
    Windows 7

    I think the problem is gfxmode=800x600x8

    That says 800x600 with a color bit depth of 8 bit. Mine is set to 32.
    Check the How to.

  5. #5
    Join Date
    Aug 2009
    Location
    ~/
    Beans
    Hidden!
    Distro
    Xubuntu Development Release

    Re: grub2 error: command 'gfxmode' not found

    Something I might mention is that I have had to take jpgs into Gimp and then select Image (at the top) and then select Scale Image.
    Then I selected at the bottom Quality Interpolation: linear.
    Then click save and click on the + to show Advanced Options.
    I make sure quality is 100% at the top and change Subsampling to best quality and then click Save.

    Sometimes, prior to doing this, the picture would not show on the grub screen. It would just display black and white.

  6. #6
    Join Date
    Jun 2011
    Location
    Netherlands
    Beans
    146
    Distro
    Ubuntu

    Re: grub2 error: command 'gfxmode' not found

    It looks like you are missing this part:
    Code:
    function gfxmode {
    	set gfxpayload="$1"
    	if [ "$1" = "keep" ]; then
    		set vt_handoff=vt.handoff=7
    	else
    		set vt_handoff=
    	fi
    }
    if [ ${recordfail} != 1 ]; then
      if [ -e ${prefix}/gfxblacklist.txt ]; then
        if hwmatch ${prefix}/gfxblacklist.txt 3; then
          if [ ${match} = 0 ]; then
            set linux_gfx_mode=keep
          else
            set linux_gfx_mode=text
          fi
        else
          set linux_gfx_mode=text
        fi
      else
        set linux_gfx_mode=keep
      fi
    else
      set linux_gfx_mode=text
    fi
    export linux_gfx_mode
    if [ "$linux_gfx_mode" != "text" ]; then load_video; fi
    which should be just below the line
    Code:
    ### BEGIN /etc/grub.d/10_linux_proxy ###
    This results into setting gfxmode to a NULL value on the line
    Code:
    gfxmode $linux_gfx_mode
    I think you can fix it by replacing the following line in /etc/grub.d/10_linux_proxy
    Code:
            gfxmode \$linux_gfx_mode
    with
    Code:
            gfxmode keep
    or
    Code:
            gfxmode text
    depending on what you prefer.

    Then run
    Code:
    sudo update-grub
    Altough I think it would be better to restore all files in /etc/grub.d/ to their original state.

  7. #7
    Join Date
    Dec 2005
    Beans
    66

    Re: grub2 error: command 'gfxmode' not found

    Thanks for the immediate reply. However, my /etc/grub.d/10_linux_proxy does not contain any entry as mentioned. The files have been changed by Grub Customiser and there are no backups. Please inform how I can restore all files in /etc/grub.d/ to their original state.

  8. #8
    Join Date
    Jun 2011
    Location
    Netherlands
    Beans
    146
    Distro
    Ubuntu

    Re: grub2 error: command 'gfxmode' not found

    I attached my files to this post.
    I don't know why you have a file named 10_linux_proxy instead of 10_linux, but usually it's called 10_linux.
    Before running
    Code:
    sudo update-grub
    you need to make sure that you have copied 10_linux to /etc/grub.d/ and made it executable.
    Attached Files Attached Files

  9. #9
    Join Date
    Dec 2005
    Beans
    66

    Re: grub2 error: command 'gfxmode' not found

    The problem has been solved. I had uncheked the option '(script code)' in the 'linux (custom)' section. After checking it, the problem did not reappear. Details at:
    http://www.ubuntugeek.com/grub-custo...comment-125825

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
  •