Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save Richard-Barrett/991a75679070891f8c647794f4f083d9 to your computer and use it in GitHub Desktop.

Select an option

Save Richard-Barrett/991a75679070891f8c647794f4f083d9 to your computer and use it in GitHub Desktop.
GHES Root Disk Grow VMWare

GHES 3.8.17 Root A/B Partition Expansion Runbook

Purpose

This runbook expands the GHES root A/B partitions on a VMware-backed GHES 3.8.17 appliance.

This procedure applies when:

  • The VMware root VMDK has already been expanded.
  • Linux detects the larger /dev/sda disk.
  • The GHES A/B root partitions still only consume the original space.

Example current state:

/dev/sda = 500 GiB

/dev/sda1 = ~100 GiB ext4 /
/dev/sda2 = ~100 GiB ext4 fallback

Remaining free space exists after sda2

Target state:

/dev/sda = 500 GiB

/dev/sda1 = ~250-270 GiB ext4 /
/dev/sda2 = ~250-270 GiB ext4 fallback

Important Notes

Do Not Use

Do not use:

ghe-storage-extend

This command expands /data/user, not the root disk.

Do not use:

ghe-upgrade

as a GHES version upgrade command for this procedure.

Root Layout

GHES 3.8.17 uses an A/B root layout:

/dev/sda

+-- sda1
|   Active root filesystem (/)
|
+-- sda2
    Fallback root filesystem

The active root partition cannot safely be resized while mounted.

The procedure requires booting from the fallback partition first.


Pre-Change Checklist

  • Replication stopped on all replicas
  • VMware root VMDK expansion completed
  • Backup validated
  • Maintenance window approved
  • Console access available through VMware
  • Root disk confirmed as /dev/sda
  • Fallback filesystem verified healthy

Step 1 - Verify Current Layout

Run:

lsblk -o NAME,SIZE,FSTYPE,LABEL,MOUNTPOINT

Example:

NAME   SIZE FSTYPE LABEL      MOUNTPOINT
sda    500G
├─sda1 100G ext4   /
└─sda2 100G ext4   fallback

Verify partition table:

sudo fdisk -l /dev/sda

Expected:

Disklabel type: dos

Check free space:

sudo parted /dev/sda print free

Expected:

sda1   ~107GB
sda2   ~107GB
Free   remaining disk space

Step 2 - Validate Fallback Partition

Check filesystem state:

sudo tune2fs -l /dev/sda2 | grep "Filesystem state"

Expected:

Filesystem state: clean

Run filesystem validation:

sudo e2fsck -n /dev/sda2

Expected:

fallback: clean

Do not continue if the fallback filesystem is unhealthy.


Step 3 - Boot From Fallback Partition

The current active root is:

mount | grep ' on / '

Example:

/dev/sda1 on / type ext4

Reboot:

sudo reboot

Open the VMware console.

During boot:

  • Press Esc to access GRUB.
  • Select the fallback/recovery boot entry.

The menu name depends on the GHES build.

Possible names:

Fallback
GHES fallback
Recovery

After boot, verify:

mount | grep ' on / '

Expected:

/dev/sda2 on / type ext4

Confirm:

lsblk -o NAME,SIZE,FSTYPE,LABEL,MOUNTPOINT

Step 4 - Backup Partition Table

Create a partition table backup:

sudo sfdisk -d /dev/sda > /tmp/sda-partition-backup.txt

Review:

cat /tmp/sda-partition-backup.txt

Save this output with the change record.


Step 5 - Expand Partition 1

Open parted:

sudo parted /dev/sda

Display layout:

print

Resize the active root partition.

Example target:

resizepart 1 268GB

Confirm:

Yes

Exit:

quit

Reload partition information:

sudo partprobe /dev/sda

If the kernel cannot reread the table, reboot while still running from fallback.


Step 6 - Expand Root Filesystem

Grow /dev/sda1:

sudo resize2fs /dev/sda1

Validate:

sudo dumpe2fs -h /dev/sda1 | grep "Block count"

Step 7 - Expand Partition 2

Open parted:

sudo parted /dev/sda

Display:

print

Resize fallback partition:

resizepart 2 537GB

Confirm:

Yes

Exit:

quit

Reload:

sudo partprobe /dev/sda

Step 8 - Expand Fallback Filesystem

Grow fallback:

sudo resize2fs /dev/sda2

Validate:

sudo dumpe2fs -h /dev/sda2 | grep "Block count"

Step 9 - Reboot Normally

Reboot:

sudo reboot

Confirm normal boot uses sda1:

mount | grep ' on / '

Expected:

/dev/sda1 on / type ext4

Step 10 - Validate Expansion

Check disk layout:

lsblk -o NAME,SIZE,FSTYPE,LABEL,MOUNTPOINT

Expected:

sda
├─sda1 ~268G ext4 /
└─sda2 ~268G ext4 fallback

Check filesystem:

df -h /

Validate GHES:

ghe-version
ghe-check-disk-usage

Confirm:

  • GHES boots normally
  • Web UI loads
  • SSH works
  • /data/user remains unchanged
  • Fallback partition exists

Step 11 - Repeat Across Topology

Perform in this order:

  1. Secondary replica
  2. Geo-replica
  3. Primary

After each node:

  • Confirm successful boot
  • Confirm root size
  • Confirm fallback size
  • Confirm GHES health

Step 12 - Restart Replication

After all nodes are complete:

On replicas:

ghe-repl-start

Validate:

ghe-repl-status -vv

Wait until replication is healthy before returning traffic.


Rollback

Do not shrink partitions.

If boot failure occurs:

  1. Power off the VM.
  2. Restore original VMDK if required.
  3. Restore original partition layout.
  4. Validate GHES boot.
  5. Engage GitHub Enterprise Support if recovery fails.

Final Checklist

  • VMware root disk expanded
  • Replication stopped
  • Fallback filesystem validated
  • Booted from fallback
  • Partition table backed up
  • sda1 expanded
  • sda1 filesystem expanded
  • sda2 expanded
  • sda2 filesystem expanded
  • Normal boot validated
  • Secondary completed
  • Geo-replica completed
  • Primary completed
  • Replication restarted
  • Replication healthy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment