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).
i5 GTX 1080 16GB RAM 512GB SSD + 3TB HD Liquid-Cooled Gaming Computer RGB Remote
$495.00
Custom RGB Gaming Desktop PC Intel Core i7 3.40 Quad 32 GB SSD Nvidia RTX 3060
$626.00
HP RGB G3 Desktop Computer i7 32GB 2TB SSD 2TB HDD New 24" LED Built-in WiFi Pro
$164.99
SGIN 17.3" Laptop 8GB RAM 256GB SSD Celeron Quad-Core Up to 2.6GHz HD 1080P
$225.00
Intel Xeon E5-2667 V2 LGA 2011 3.3GHz 8 Core 130W 25MB 8GT/s CPU Processor
$11.99
AMD Ryzen 7 5700X3D 8-Core 16-Thread 4.1GHz Socket AM4 CPU
$194.99
AMD Ryzen 7 7800X3D - Ryzen 7 7000 Series 8-Core Socket AM5 120W CPU Processor
$488.99
Intel Core i9-12900KF Unlocked Desktop Processor
$279.99
RGB Gaming Desktop Computer i7 PC 32GB RAM 2TB SSD GTX 3050 W11P Custom Build
$649.99
New HP 24" Touchscreen All In One Computer i3-1115G4 Up To 32GB & 2TB SSD Win 11
$359.99