- Ubuntu server 14.04 efi-gpt disk with three partitions, 1=boot, 2=main, 3=recovery
I want: default boot on gpt2, grub fallback to gpt3, and grub-reboot to reboot into recovery from main.
What I get is no boot at all, just an instant reboot loop.
I am a bit confused by the GNU docs. And I need to be able to do all changes from the 40_custom file and /etc/default/grub to be repeatable and robust.
heres some links: http://www.gnu.org/software/grub/manual/grub.html#Simple-configuration https://www.gnu.org/software/grub/manual/legacy/Booting-fallback-systems.html "wiki.ubuntuusers.de/ GRUB_2/ Skripte/#Fallback-Skript"
here is /etc/default/grub:
# If you change this file, run 'update-grub' afterwards to update
# /boot/grub/grub.cfg.
# For full documentation of the options in this file, see:
# info -f grub -n 'Simple configuration'
GRUB_DEFAULT=0
#GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR=""
GRUB_CMDLINE_LINUX_DEFAULT=""
GRUB_CMDLINE_LINUX=""
# fallback addition
export GRUB_FALLBACK="1 2"
GRUB_DEFAULT=saved
GRUB_SAVEDEFAULT=true
# Uncomment to enable BadRAM filtering, modify to suit your needs
# This works with Linux (no patch required) and with any kernel that obtains
# the memory map information from GRUB (GNU Mach, kernel of FreeBSD ...)
#GRUB_BADRAM="0x01234567,0xfefefefe,0x89abcdef,0xefefefef"
# Uncomment to disable graphical terminal (grub-pc only)
#GRUB_TERMINAL=console
# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
#GRUB_GFXMODE=640x480
# Uncomment if you don't want GRUB to pass "root=UUID=xxx" parameter to Linux
GRUB_DISABLE_LINUX_UUID=true
# Uncomment to disable generation of recovery mode menu entries
GRUB_DISABLE_RECOVERY="true"
# Uncomment to get a beep at grub start
#GRUB_INIT_TUNE="480 440 1
"
here is the relevant part of grub.cfg:
## BEGIN /etc/grub.d/40_custom ###
# 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 'ITH Robot Base Main (on /dev/sda2)' {
recordfail
load_video
gfxmode $linux_gfx_mode
insmod gzio
insmod part_gpt
insmod ext2
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 208a7546-da6b-4d07-82ab-0f04e8db6fd0
else
search --no-floppy --fs-uuid --set=root 208a7546-da6b-4d07-82ab-0f04e8db6fd0
fi
linux /boot/vmlinuz
initrd /boot/initrd.img
savedefault fallback
}
menuentry 'ITH Robot Base Recovery(on /dev/sda3)' {
insmod part_gpt
insmod ext2
set root='hd0,gpt3'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt3 --hint-efi=hd0,gpt3 --hint-baremetal=ahci0,gpt3 89ad84a4-3fe5-4409-a702-96ae698872d2
else
search --no-floppy --fs-uuid --set=root 89ad84a4-3fe5-4409-a702-96ae698872d2
fi
linux /boot/vmlinuz
initrd /boot/initrd.img
savedefault fallback
}
### END /etc/grub.d/40_custom ###
sudo update-grub
after making the changes? It needs to be executed every time you want to apply the grub changes. – E.F. Nijboer Feb 09 '16 at 23:50sudo parted -l
output) would be helpful, too. – Rod Smith Feb 10 '16 at 15:28