This is documented elsewhere on the web, but I thought since I had run into it yesterday, I would put it here too.
I am upgrading my server so I have a new Mobo, CPU, and RAM to get running. I wiped a small SSD for the OS, leaving the big drives for the storage pool. When attempting to install Ubuntu server, it failed at installing GRUB. Now, I could go into my BIOS, enable EFI mode, figure out how to install rEFInd or some other boot manager and move on without GRUB, but this is a server. It only boots one OS and frankly, I wasn't in the mood to learn EFI at the time.
Installing grub to a GPT disk works fine if you take a small step before attempting the install. You have to create a special partition for GRUB to use of the type EF02. The nice thing is it takes zero usable space away from your drive. Here's the steps to create this partition. Use the correct drive letter in place of sda in the following example. I have included the terminal output along with all the commands.
As an explanation of what you've done, the gdisk commands/entries are:
*** If you want to create other partitions at the same time, you must go back to the expert menu (x) and change the sector alignment back to 2048. ***
I am upgrading my server so I have a new Mobo, CPU, and RAM to get running. I wiped a small SSD for the OS, leaving the big drives for the storage pool. When attempting to install Ubuntu server, it failed at installing GRUB. Now, I could go into my BIOS, enable EFI mode, figure out how to install rEFInd or some other boot manager and move on without GRUB, but this is a server. It only boots one OS and frankly, I wasn't in the mood to learn EFI at the time.
Installing grub to a GPT disk works fine if you take a small step before attempting the install. You have to create a special partition for GRUB to use of the type EF02. The nice thing is it takes zero usable space away from your drive. Here's the steps to create this partition. Use the correct drive letter in place of sda in the following example. I have included the terminal output along with all the commands.
Code:
user@mypc:~$sudo gdisk /dev/sda GPT fdisk (gdisk) version 0.8.10 Partition table scan: MBR: protective BSD: not present APM: not present GPT: present Found valid GPT with protective MBR; using GPT. Command (? for help): x Expert command (? for help): l Enter the sector alignment value (1-65536, default = 2048): 34 Expert command (? for help): m Command (? for help): n Partition number (1-128, default 1): 1 First sector (34-3907029134, default = 34) or {+-}size{KMGTP}: 34 Last sector (34-2101247, default = 2101247) or {+-}size{KMGTP}: 2047 Current type is 'Linux filesystem' Hex code or GUID (L to show codes, Enter = 8300): EF02 Changed type of partition to 'BIOS boot partition' Command (? for help): p Disk /dev/sda: 3907029168 sectors, 1.8 TiB Logical sector size: 512 bytes Disk identifier (GUID): FA7FD45C-E141-4DB3-A867-D80C4B41C281 Partition table holds up to 128 entries First usable sector is 34, last usable sector is 3907029134 Partitions will be aligned on 34-sector boundaries Total free space is 2099343 sectors (1.0 GiB) Number Start (sector) End (sector) Size Code Name 1 34 2047 1007.0 KiB EF02 BIOS boot partition Command (? for help): w
x - enable expert mode.
l - change the sector alignment value so you can use otherwise wasted space.
34 - is the first truly free sector in the first 2 megs of your GPT disk.
m - returns you to the main menu.
n - create new partition.
1 - the new partition number - could be another number if you wish or already have other partitions on this disk.
34 - the beginning of the new partition (likely, this will show as the default so ENTER works).
2047 - the end of the new partition.
EF02 - the partition type code for a GRUB partition.
w - write the changes and exit.
You will now be able to install grub to your GPT disk.l - change the sector alignment value so you can use otherwise wasted space.
34 - is the first truly free sector in the first 2 megs of your GPT disk.
m - returns you to the main menu.
n - create new partition.
1 - the new partition number - could be another number if you wish or already have other partitions on this disk.
34 - the beginning of the new partition (likely, this will show as the default so ENTER works).
2047 - the end of the new partition.
EF02 - the partition type code for a GRUB partition.
w - write the changes and exit.
*** If you want to create other partitions at the same time, you must go back to the expert menu (x) and change the sector alignment back to 2048. ***
Comment