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).
DDR3 Memory 16GB (2 x 8GB) PC3-12800U desktop Memory
$16.99
Sandisk 16GB 32GB 64GB 128GB Cruzer Blade Flash Drive Memory Stick USB Lot Pack
$5.50
Mixed Brands 8GB DDR4-3200 Laptop SODIMM RAM Memory
$10.95
Crucial DDR3L 16GB 1600 8GB 16GB PC3-12800 Laptop SODIMM Memory RAM PC3 16G DDR3
$14.00
A-Tech 16GB 2 x 8GB PC3-12800 Laptop SODIMM DDR3 1600 Memory RAM PC3L 16G DDR3L
$23.98
Sandisk 8GB 16GB 32GB 64GB 128GB Cruzer Blade Flash Drive Memory Stick USB Lot
$138.99
HyperX FURY RAM DDR4 16GB 8GB 32GB 4GB 3200 2666 2400 2133 Desktop Memory DIMM
$8.99
A-Tech 8GB DDR3 1600 PC3-12800 Laptop SODIMM 204-Pin Memory RAM PC3L DDR3L 1x 8G
$11.99
USB Flash Drive Memory Stick Pendrive Thumb Drive 4GB, 8GB, 32GB, 64GB 128GB LOT
$239.38
A-Tech 256GB 8x 32GB 2Rx4 PC4-19200R DDR4 2400 ECC REG RDIMM Server Memory RAM
$271.92