Skip to main content

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.

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.

  1. Go to the KakaoCloud Console > Container Pack > Kubernetes Engine.

  2. In the Cluster menu, select your cluster and go to the Node tab to select a specific node.

  3. On the node detail page, click the Instance ID to view the instance details.

    Node detail page Node detail page

  4. In the Volume tab of the instance detail page, click the [More] icon next to the volume and select Edit volume.

  5. In the Edit volume popup, check and modify the volume size to greater than 2TB and save the changes.

    Edit volume popup Edit volume popup

Step 2. Check current disk and partition information

Check the disk and partition information of the Kubernetes Engine node.

caution

If changing the partition table format of an existing volume, be sure to back up your data before proceeding.

  1. Use the fdisk command to check current disk information.
    In the example below, the disk /dev/vda is about 10GB in size.

    Check current partition info with fdisk
    sudo fdisk -l
  2. Use the gdisk command to verify the current partition table format.

    Check partition format with gdisk
    sudo gdisk -l /dev/vda
    • If the output shows “MBR only”, the disk is using an MBR partition table.

Step 3. Change the partition table

  1. Use gdisk to convert the partition table from MBR to GPT.

    Convert to GPT and create boot partition
    sudo gdisk /dev/vda
  2. When converting to GPT, a boot partition must be created.
    Use the following command sequence to create a GPT BIOS boot partition:

    FieldValue
    Partition numberEnter 2 (or leave default)
    First sectorEnter 34 (or leave default)
    Last sectorEnter 2047 (or leave default)
    Partition type codeEnter ef02
    Create BIOS boot partition
    Command (? 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
  3. Install GRUB on the new partition.

    caution

    If GRUB is not installed after switching to GPT, the node may fail to reboot. Install GRUB before rebooting.

    Install GRUB
    sudo partprobe
    sudo grub-install /dev/vda
  4. Reboot the system to apply changes.

    Reboot
    sudo reboot
  5. After rebooting, confirm that the disk has been converted to GPT.

    Check disk layout with lsblk
    sudo lsblk
    Check partition table with fdisk
    sudo fdisk -l
    • You should see Disk label type: gpt and the BIOS boot partition (vda2) listed with ~1007K size.