Change root volume partition table format
The default partition table format of the root volume disk for VM instances used as Kubernetes Engine nodes is MBR (Master Boot Record).
The MBR partitioning scheme supports up to 4 partitions and works only with disks smaller than or equal to 2TB.
If a Kubernetes Engine node needs to use a root volume larger than 2TB, the partition table must be changed to GPT (GUID Partition Table), which has no such limitations.
When changing the partition table format of an existing volume, back up your data before proceeding. If GRUB installation fails after changing the partition table to GPT, the node may fail to reboot. Review the procedure carefully before starting.
Step 1. Check and modify Kubernetes Engine node volume size
To use a volume larger than 2TB on a Kubernetes Engine node, modify the current volume size accordingly.
-
Go to the KakaoCloud console > Container Pack > Kubernetes Engine.
-
In the Cluster menu, select your cluster and go to the Node tab to select a specific node.
-
On the node detail page, select the Instance ID to view the instance details.
Node detail page -
In the Volume tab of the instance detail page, select the [More] icon next to the volume and select Edit volume.
-
In the Edit volume popup, check and modify the volume size to greater than 2TB and save the changes.
Edit volume popup
Step 2. Check current disk and partition information
Check the disk and partition information of the Kubernetes Engine node.
-
Use the
fdiskcommand to check current disk information.
In the example below, the disk /dev/vda is about 10GB in size.Check current partition info with fdisksudo fdisk -l
Disk /dev/vda: 10.7 GB, 10737418240 bytes, 20971520 sectors // The disk is approximately 10GB
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: dos
Disk identifier: 0x0009b542
Device Boot Start End Blocks Id System
/dev/vda1 * 2048 20971486 10484719+ 83 Linux
-
Use the
gdiskcommand to verify the current partition table format.Check partition format with gdisksudo gdisk -l /dev/vda
GPT fdisk (gdisk) version 0.8.10
Partition table scan: // The disk uses an MBR partition table
MBR: MBR only
BSD: not present
APM: not present
GPT: not present
***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory.
***************************************************************
Disk /dev/vda: 20971520 sectors, 10.0 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 79C4C601-BF62-45E4-97F8-AB21F158EED7
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 20971486
Partitions will be aligned on 2048-sector boundaries
Total free space is 2014 sectors (1007.0 KiB)
Number Start (sector) End (sector) Size Code Name
1 2048 20971486 10.0 GiB 8300 Linux filesystem
- If the output shows “MBR only”, the disk is using an MBR partition table.
Step 3. Change partition table
-
Use
gdiskto convert the partition table from MBR to GPT.Convert to GPT and create boot partitionsudo gdisk /dev/vda
GPT fdisk (gdisk) version 0.8.10
Partition table scan:
MBR: MBR only
BSD: not present
APM: not present
GPT: not present
***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory. THIS OPERATION IS POTENTIALLY DESTRUCTIVE! Exit by
typing 'q' if you don't want to convert your MBR partitions
to GPT format!'
***************************************************************
-
When converting to GPT, a boot partition must be created.
Use the following command sequence to create a GPT BIOS boot partition:Field Value Partition numberEnter 2(or leave default)First sectorEnter 34(or leave default)Last sectorEnter 2047(or leave default)Partition type code Enter ef02Create BIOS boot partitionCommand (? for help): n
Partition number (2-128, default 2): 2
First sector (34-1455966, default = 34): 34
Last sector (34-1455966, default = 2047): 2047
Hex code or GUID (L to show codes, Enter = 8300): ef02
Command (? for help): w
Do you want to proceed? (Y/N): y -
Install GRUB on the new partition.
Install GRUBsudo partprobe
sudo grub-install /dev/vda -
Reboot the system to apply changes.
Rebootsudo reboot -
After rebooting, confirm that the disk has been converted to GPT.
Check disk layout with lsblksudo lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
vda 252:0 0 3T 0 disk
├─vda1 252:1 0 3T 0 part /
└─vda2 252:2 0 1007K 0 part
sudo fdisk -l
WARNING: fdisk GPT support is currently new, and therefore in an experimental phase. Use at your own discretion.
Disk /dev/vda: 3221.2 GB, 3221225472000 bytes, 6291456000 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk label type: gpt
Disk identifier: D9C42684-E18C-4B8F-9388-C2F2CDC093ED
# Start End Size Type Name
1 2048 6291455965 3T Linux filesyste Linux filesystem
2 34 2047 1007K BIOS boot BIOS boot partition
- You should see
Disk label type: gptand the BIOS boot partition (vda2) listed with ~1007K size.