GPT is a type of partition table for large drives that exceed the 2 TiB size limit of MBR.
Disk partitioning and filesystem creation for GPT drives using disk tools are no different from MBR. However, to install GRUB on it we need to create a
BIOS Boot Partition partition specifically for GRUB.
Here are the practical steps on the /dev/sdb drive
1) Create GPT partition table
Before creating the partition table, you should use wipefs to wipe the signatures to avoid warning. All commands here are run as the
wipefs -a /dev/sdb
parted /dev/sdb mklabel gpt
The partition table had label
gpt. The drive /dev/sdb has 976773164 sectors ie 976773164/2048 = 476940 MiB.
2) Create the partition BIOS Boot Partition
The reasonable size for this partition is 1 MiB, that is, 2048 sectors by default
parted /dev/sdb mkpart primary 1 2
3) Create a root partition
We use the entire remaining disk space to create a partition as the root partition to try installing GRUB later. That is, from sector 4096 to the end of the drive, ie from MiB 2 to MiB 476940
parted /dev/sdb unit MiB mkpart primary 2 476940
An easier way to create partitions is to use
4) Set the partition type for the BIOS Boot Partition
This partition needs to have proper type so that GRUB can automatically find it, then write the image to it
parted /dev/sdb set 1 bios_grub on
5) Create filesystem for the root partition
Create the filesystem, label it ROOT-GPT
mkfs.ext4 -L ROOT-GPT /dev/sdb2
6) Install GRUB
We install GRUB on /dev/sdb to ensure that the above steps are correct, GRUB finds the BIOS Boot Partition and the installation is successful
mount /dev/sdb2 /mnt
grub-install /dev/sdb --boot-directory=/mnt/boot
Share on Twitter Share on Facebook
Can't see mail in Inbox? Check your Spam folder.