22.07.2016 12:22, Carlos E. R. пишет:
Hi,
I have finally upgraded my main hard disk, grom 500GB to 2000GB. So I had to also migrate my 13.1 system with grub1 to a GPT disk. Worked fine. The problem is elsewhere.
The computer is oldish, BIOS only. The main disk is GPT. The protective MBR has "Syslinux GPTMBR (4.04-5.01)", which boots the partition that has the flag legacy_boot.
In that partition there is a grub 2 boot system pertaining to a Leap 42.1 install. This system, instead of automatically generating entries for other systems, has manual entries in /boot/grub2/custom.cfg like:
menuentry 'Main (with uuid)' { insmod part_gpt insmod ext2 set root='hd0,gpt5' if search --no-floppy --fs-uuid --set=root e99d9dcb-869d-4a24-94cf-cba32f169b8d ; then chainloader +1 else echo Could not find this OS instance, will not boot (3) sleep 1 fi }
(thanks to Andrei Borzenkov and others for setting up that idea)
So that the menu writes entries to the boot screen (from memory) like these:
Leap 42.1 Advanced options for Leap Main (with uuid) 11.4 (with uuid)
etc. Well, the question is whether it is possible to change the default entry, which now is the first line (automatically generated) to the third one (manually generated).
Assuming you are using grub-mkconfig and not editing grub.cfg manually ... set GRUB_DEFAULT in /etc/default/grub and run grub2-mckconfig. It can be set to entry number, entry title or entry ID. Entry number is the worst - it can change next time grub-mkconfig runs. Entry title is not unique enough, although in your case it may be enough. ID is recommended way to refer to menu entries. Just add --id some-unique-string like menuentry 'Main (with uuid)' --id something-that-is-unique { ... For ID string you can simply use uuidgen which is supposed to return Universally Unique ID. grub-mkconfig scripts usually prefix it with some indication where it comes from (like linux-$uuid or os_prober-$uuid etc). So something like carlos-$uuid would be good :) And do not forget that if you use submenus, you need to define full path, i.e. for submenu "My own menus" --id unique-1 { menuentry "First submenu entry" --id unique-2 { ... } ... } you need to set GRUB_DEFAULT="unique-1>unique-2"