Combine GRUB2, GPT, UEFI and NanoBSD on Ubuntu 11.04 ?


1. Installing Ubuntu 11.04
  • please change sources.list with apt-get install from ... 
  • tw.archive.ubuntu.com  ->  mirror.nttu.edu.tw
2. Installing ufsutils/gdisk package ...

  • apt-get install ufsutils
  • apt-get install gdisk
3. Partition your hard drive
  • my plan as follows.
    • /dev/sdb1 -> EFI system partition "EF00"
    • /dev/sdb2 -> NanoBSD #1 "A500"
    • /dev/sdb3 -> NanoBSD #1 "A500"
    • /dev/sdb4 -> Data "A503"
  • gdisk /dev/sdb 
  • ...
  • mkfs.vfat -F32 /dev/sdb1
  • mkfs.ufs -O 2 /dev/sdb2
  • mkfs.ufs -O 2 /dev/sdb3
  • mkfs.ufs -O 2 /dev/sdb4
4. Mount EFI system partition
  • mkdir /boot/efi
  • mount /dev/sdb1 /boot/efi
  • mkdir -p /boot/efi/efi
5. Install grub for efi
  • apt-get install grub-efi-amd64
6. Setup your grub2 into the EFI system partition
  • modprobe dm-mod
  • grub-install --boot-directory=/boot/efi/efi --bootloader-id=GRUB2 --no-floppy --recheck
  • cp /usr/share/grub/unicode.pf2 /boot/efi/efi/grub/
  • cp /boot/grub/grub.cfg /boot/efi/efi/grub/grub.cfg
    • grub.cfg context as follows.
      • insmod ufs2
      • set root='(hd0,1,a)'
      • search --no-floppy --fs-uuid --set 4ea7f1272cbdb23e
      • echo Loading kernel of FreeBSD kernel ...
      • kfreebsd /boot/kernel/kernel
      • kfreebsd_loadenv /boot/device.hints
      • set kFreeBSD.vfs.root.mountfrom=ufs:/dev/ad0s1a
      • set kFreeBSD.vfs.root.mountfrom.options=rw
      • ...
7. Copy my old grub.cfg and seting up the EFI boot entry.
  • modprobe efivars
  • efibootmgr --create --gpt --disk /dev/sdb --part 1 --write-signature --label "GRUB2" --loader "\\EFI\\grub\\grub.efi"
note. GRUB2 is the entry that would appear on the EFI bootloader










Linux_Windows_BIOS_UEFI_boot_USB


https://gitorious.org/tianocore_uefi_duet_builds/pages/Linux_Windows_BIOS_UEFI_boot_USB



Manual setup of UEFI, GPT and GRUB2

http://jkyamog.blogspot.com/2011/09/manual-setup-of-uefi-gpt-and-grub2.html

虹光大成就-密教灌頂(一)