Hi, been a while posting but got into a situation where i have purchaced a new ASUS 550 with EFI boot + GPT installed.
It took a while to get grub2 working, but have somewhat.
Manual install is needed if you
1) want to EFI boot off GPT type hd's and dont want to destroy existing partitions or data (in my case an existing Windows Install)
2) If you have a USB style install to your HD, ie with a KNOPPIX/knoppix-data.img setup.
I have been using a USB install to HD since about knoppix 6.4. I also wanted to keep windows for one and only one reason (Turbo Tax) which i have been using for years.
Plus with usb sticks protruding out of the side of my PC is a matter of time until bump/breakage.
So I needed to manually install grub2 (of which i knew nothing about until this EFI/GPT PC).
With a USB style install to HD you need to have a bootable usb stick or mmc boot. To this day i rarely use lilo boot, but came in handy with GPT.
I still use all the syslinux/*.cfg files as a basis for grub entries.
And the linux/linux64 files. So my /mnt-system looks like the following:
# /dev/sda2 aka (hd0,1) aka (hd1,gpt2) EFI boot on GPT partition 2
# I duplicate this also to /dev/sda4 (hd0,3) and on grub2 (hd1,gpt4) which is big enough to hold 3 DVD KNOPPIX versions which is aka /mnt-system after boot
# /mnt-system is what grub-* cmds wiill alter for the ones that will work with --boot-directory
boot/isolinux -> syslinux # compatibility with lilo (important again with EFI+GPT) # symlink on fs that support it, eg ext2-4, etc just a copy on fs such as VFAT that do not support symlinks.
boot/syslinux -> syslinux74 # defaults to latest # symlink on fs that support it, eg ext2-4, etc just a copy on fs such as VFAT that do not support symlinks.
boot/syslinux72 # Knoppix 7.0 syslinux dir
boot/syslinux70 # Knoppix 7.2 syslinux dir
boot/syslinux74 # Knoppix 7.4 syslinux dir
boot/grub # prior to grub2 this only had menu.lst but with grub2 now al the files that come with grub2 (modules, etc) + grub.cfg
boot/grub/menu.lst # legacy grub <= 0.97 file for reference and "master copy from combining syslinux*.cfg entries into grub-legacy entries
boot/grub/grub.cfg # generated grub-menulst2cfg or by grub-pc.postinst using menu.lst in same dir
# This goes in the first partition with enough size along with a duplicate boot partition above, which is /dev/sda4 - aka grub legacy: (hd0,3) and grub2: (hd1,gpt4)
KNOPPIX -> KNOPPIX74 # symlink on fs that support it, eg ext2-4, etc just a copy on fs such as VFAT that do not support it.
KNOPPIX70 # entries with knoppix_dir=KNOPPIX70
KNOPPIX72 # entries with knoppix_dir=KNOPPIX70
KNOPPIX74 # entries with knoppix_dir=KNOPPIX70
/boot/grub/menu.lst # prior to grub2 install this is the only file in boot grub
boot/syslinux* # duplicate of all above dirs
Rememeber to apt-get install -t testing util-linux to update fdisk to even see your GPT properly. Do ths for each usb drive and knoppix-data.img you have.
1.99 grub2 is not compatible with 2.02 grub2. The difference between apt-get install grub2 grub-pc and apt-get install -t testing grub-pc as of 3/30/2015
The format is basically the same except 1.99 has entries like this:
grub2 2.02 grub2 1.99 grub 0.97
linux legacy_kernel vs kernel legacy grub <= 0.97
initrd legacy_initrd vs initrd
vi /mnt-system/boot/grub/*.cfg
:%s@legacy_kernel@linux@
:%s@legacy_initrd@initrd@
:%s@hd0,1@hd1,gpt2@ # this maps to /dev/sda2 the GPT efi boot/partition which may be different on your system
The errors on 1.99 and 2.02 are the same on any usb style install:
apt-get install [-t testing] grub2 grub-pc has many errors on install
Wether grub2 v1.99 or grub2 v2.02
You must edit the /var/lib/dpkg/info/grub-pc.postinst script and add this to beginning of 1st executable line:
root=/mnt-system # set to "" to get default behaviour
sudo vi grub-pc.postinst and substituted every /boot with /mnt-system/boot by making $root/boot...:
:%s@/boot@$root/boot#@g # many of these in script
:%s@ / /@ $root/ /@ # there's one lonesome root without /boot in the grub-pc.postinst script
:%s@grub-install@grub-install --boot-directory=/mnt-system@
:wq
then sudo ./grub-pc.postinst configure # this will run the command within
After this change you can simple change export root="/mnt-system" to "fix" for knoppix usb installs or "" to restore original script to it's regular operation
Even with this change grub-probe will return with an grub-probe error that it cant find the device for /boot,
but well after it's done most of the installation (and conversion of menu.lst to grub.cfg and many other conversion steps).
Even with this change, until grub2 supports an enviroment var, eg export ROOT_BOOT=/mnt-system, manyl grub2 cmds will report errors.
An alternative is to add --boot-directory=/mnt-system/boot to the grub-install commands and all that will accept it but this is only a few that I have found.
Note that you may try this with export root="" at beginning of grub-pc.postinst
then run: sudo grub-pc.postinst configure to convert those in the /boot/grub stuff as well (although i dont think it will be a complete conversion, it should remove all those legacy stage files and create a new grub.cfg from menu.lst).
after this error you can now rsync /mnt-system/boot /media/sda2 (after mounting /dev/sda2) to get a dup of the resulting files. Remember i am using /dev/sda2
as gpt2 on my primary hard drive since it's EFI/grub_boot partition.
setting grub_boot flag on GPT partition via parted or gdisk (a fdisk replacement) is much different from legacy boot flag of ATA drives/partitions.
you may need to set this flag on your EFI/fat partition if not already set (via gdisk or parted).
Supermicro 4U 36 Bay Storage Server 2.4Ghz 8-C 128GB 1x1280W Rails TrueNAS ZFS
$712.98
CSE-118 Supermicro 1U 3x GPU Server 2.6Ghz 20-C 128GB CX353A 2x1600W PSU Rails
$454.03
Dell PowerEdge R630 8SFF 2.6Ghz 20-Core 128GB Mem 2x10G+2x1G NIC 2x750W PSU
$399.04
Dell Poweredge R640 Server | 2x Xeon Gold 6132 | 128GB | H730P | 8x HDD Trays
$1849.00
Intel Xeon Gold 6140 SR3AX 2.3GHz 18-Core Processor CPU
$39.99
Intel Xeon E5-2697A V4 2.6GHz CPU Processor 16-Core Socket LGA2011 SR2K1
$39.99
Intel Xeon E5-2680 v4 2.4GHz 35MB 14-Core 120W LGA2011-3 SR2N7
$17.99
SR1XP Intel Xeon E5-2680 v3 12 Core 30MB 2.5GHz LGA 2011-3 A Grade Processor
$5.09
Dell Precision T5600/t5610 Xeon E5-2670 2.6Ghz 16GB DDR3 RAM NO HDD Nvidia
$90.00
Rare WaterCooled HP Z800 Workstation Dual Xeon X5680 16GB RAM 120GB SSD Nvidia
$279.56