Skip to main content

Thread: Grub 2 save default not working


hello all,

trying setup triple boot system save selection during boot. have ubuntu 11.10, windows 7, , centos 6.2. below find grub.cfg , grub files.

/boot/grub/grub.cfg
code:
#  # not edit file  #  # automatically generated grub-mkconfig using templates  # /etc/grub.d , settings /etc/default/grub  #    ### begin /etc/grub.d/00_header ###  if [ -s $prefix/grubenv ];    set have_grubenv=true    load_env  fi  set default="${saved_entry}"  if [ "${prev_saved_entry}" ];    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}" ];      saved_entry="${chosen}"      save_env saved_entry    fi  }    function recordfail {    set recordfail=1    if [ -n "${have_grubenv}" ]; if [ -z "${boot_once}" ]; 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='(hd4,msdos1)'  search --no-floppy --fs-uuid --set=root 48b87fd5-8f5c-42ef-91bc-9822a94c1085  if loadfont /usr/share/grub/unicode.pf2 ;    set gfxmode=auto    load_video    insmod gfxterm    insmod part_msdos    insmod ext2    set root='(hd4,msdos1)'    search --no-floppy --fs-uuid --set=root 48b87fd5-8f5c-42ef-91bc-9822a94c1085    set locale_dir=($root)/boot/grub/locale    set lang=en_us    insmod gettext  fi  terminal_output gfxterm  if [ "${recordfail}" = 1 ];    set timeout=-1  else    set timeout=5  fi  ### end /etc/grub.d/00_header ###    ### begin /etc/grub.d/05_debian_theme ###  set menu_color_normal=white/black  set menu_color_highlight=black/light-gray  if background_color 44,0,30;    clear  fi  ### end /etc/grub.d/05_debian_theme ###    ### begin /etc/grub.d/10_linux ###  if [ ${recordfail} != 1 ];    if [ -e ${prefix}/gfxblacklist.txt ];      if hwmatch ${prefix}/gfxblacklist.txt 3;        if [ ${match} = 0 ];          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" ]; load_video; fi  menuentry 'ubuntu, linux 3.0.0-14-generic' --class ubuntu --class gnu-linux --class gnu --class os {  	recordfail  	savedefault  	set gfxpayload=$linux_gfx_mode  	insmod gzio  	insmod part_msdos  	insmod ext2  	set root='(hd4,msdos1)'  	search --no-floppy --fs-uuid --set=root 48b87fd5-8f5c-42ef-91bc-9822a94c1085  	linux	/boot/vmlinuz-3.0.0-14-generic root=uuid=48b87fd5-8f5c-42ef-91bc-9822a94c1085 ro   quiet splash vt.handoff=7  	initrd	/boot/initrd.img-3.0.0-14-generic  }  submenu "previous linux versions" {  menuentry 'ubuntu, linux 3.0.0-12-generic' --class ubuntu --class gnu-linux --class gnu --class os {  	recordfail  	savedefault  	set gfxpayload=$linux_gfx_mode  	insmod gzio  	insmod part_msdos  	insmod ext2  	set root='(hd4,msdos1)'  	search --no-floppy --fs-uuid --set=root 48b87fd5-8f5c-42ef-91bc-9822a94c1085  	linux	/boot/vmlinuz-3.0.0-12-generic root=uuid=48b87fd5-8f5c-42ef-91bc-9822a94c1085 ro   quiet splash vt.handoff=7  	initrd	/boot/initrd.img-3.0.0-12-generic  }  menuentry 'ubuntu, linux 2.6.38-11-generic' --class ubuntu --class gnu-linux --class gnu --class os {  	recordfail  	savedefault  	set gfxpayload=$linux_gfx_mode  	insmod gzio  	insmod part_msdos  	insmod ext2  	set root='(hd4,msdos1)'  	search --no-floppy --fs-uuid --set=root 48b87fd5-8f5c-42ef-91bc-9822a94c1085  	linux	/boot/vmlinuz-2.6.38-11-generic root=uuid=48b87fd5-8f5c-42ef-91bc-9822a94c1085 ro   quiet splash vt.handoff=7  	initrd	/boot/initrd.img-2.6.38-11-generic  }  }  ### end /etc/grub.d/10_linux ###    ### begin /etc/grub.d/20_linux_xen ###  ### end /etc/grub.d/20_linux_xen ###    ### begin /etc/grub.d/40_custom ###  # file provides easy way add custom menu entries.  type  # menu entries want add after comment.  careful not change  # 'exec tail' line above.  menuentry "centos 6" {           savedefault          insmod part_msdos          insmod ext2          set root='(hd1,msdos1)'          chainloader +1  }    menuentry "windows 7" --class windows --class os {          savedefault          insmod part_msdos          insmod ntfs          set root='(hd3,msdos1)'          search --no-floppy --fs-uuid --set=root ec7afd927afd59b2          chainloader +1  }  ### end /etc/grub.d/40_custom ###    ### begin /etc/grub.d/41_custom ###  if [ -f  $prefix/custom.cfg ];    source $prefix/custom.cfg;  fi  ### end /etc/grub.d/41_custom ###
/etc/default/grub
code:
# if change file, run 'update-grub' afterwards update  # /boot/grub/grub.cfg.  # full documentation of options in file, see:  #   info -f grub -n 'simple configuration'    grub_default=saved  #grub_hidden_timeout=0  grub_hidden_timeout_quiet=true  grub_timeout=5  grub_distributor=`lsb_release -i -s 2> /dev/null || echo debian`  grub_cmdline_linux_default="quiet splash"  grub_cmdline_linux=""  grub_savedefault=true    # uncomment enable badram filtering, modify suit needs  # works linux (no patch required) , kernel obtains  # memory map information grub (gnu mach, kernel of freebsd ...)  #grub_badram="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"    # uncomment disable graphical terminal (grub-pc only)  #grub_terminal=console    # resolution used on graphical terminal  # note can use modes graphic card supports via vbe  # can see them in real grub command `vbeinfo'  #grub_gfxmode=640x480    # uncomment if don't want grub pass "root=uuid=xxx" parameter linux  #grub_disable_linux_uuid=true    # uncomment disable generation of recovery mode menu entries  grub_disable_recovery="true"    # uncomment beep @ grub start  #grub_init_tune="480 440 1"
any ideas how save selection when select windows 7 or centos next boot?

thank time , have great day!

regards,
jd

install grub customizer , wanna give small advice please dont touch grub.cfg file .

can grub customizer signature , can type of grub operations.


Forum The Ubuntu Forum Community Ubuntu Official Flavours Support General Help [SOLVED] Grub 2 save default not working


Ubuntu

Comments

Popular posts from this blog

How to set the order of FAQs instead of alphabetical

Thread: Get UK Keyboard working

how do I change the e-mail address for my merchant account