Monday, March 6, 2017

Grub saving default OS Centos/RHL

Here is an example grub configuration file which saves the default OS based on the last picked OS.
/boot/grub/grub.conf

Don't use the full file. The OS arguments will probably not work on your system directly. There are two important pieces so this will work.

default=saved

which lets grub know it should save the default and use that instead of a hard coded default.

savedefault

which needs to be in the configuration for each OS that you want to save over the current default when it is selected.

Full example:

default=saved
timeout=5
splashimage=(hd0,1)/grub/splash.xpm.gz
hiddenmenu

rd_NO_LUKS LANG=en_US.UTF-8 rd_NO_MD SYSFONT=latarcyrheb-sun16 crashkernel=128M rd_LVM_LV=vg_rhent529/lv_swap rd_LVM_LV=vg_rhent529/lv_root  KEYBOARDTYPE=pc KEYTABLE=us rd_NO_DM rhgb quiet nouveau.modeset=0 rdblacklist=nouveau
initrd /initramfs-2.6.32-504.12.2.el6.x86_64.img
savedefault

title Windows 7
rootnoverify (hd1,0)
chainloader +1
savedefault

No comments:

Post a Comment