Extending root disk of Cloud Director appliance
search cancel

Extending root disk of Cloud Director appliance

book

Article ID: 380554

calendar_today

Updated On:

Products

VMware Cloud Director

Issue/Introduction

Extending root disk of Cloud Director appliance

Environment

Cloud Director 10.x appliance

Cause

Need to expand the root partition of a Cloud Director appliance.

Resolution

Before beginning, take a backup of the Cloud Director appliance.  Note that there must not be any snapshots present for the appliance in order to expand the disk.
 
  1. Resize Hard disk 1 in vCenter
  2. SSH into the Cloud Director appliance
  3. Rescan the SCSI bus for disk changes
    echo 1 > /sys/class/block/sda/device/rescan

  4. Validate that OS sees the change
    root@cell [ ~ ]# fdisk -l
    ....
    GPT PMBR size mismatch (83886079 != 94371839) will be corrected by write.
    The backup GPT table is not on the end of the device. This problem will be corrected by write.
    Disk /dev/sda: 45 GiB, 48318382080 bytes, 94371840 sectors  << New disk size

  5. Install the parted package to resize the disk partition
    root@cell [ /etc/yum.repos.d ]#  tdnf install parted
    Refreshing metadata for: 'VMware Photon Linux 3.0 (x86_64)'
    Refreshing metadata for: 'VMware Photon Linux 3.0 (x86_64) Updates'
    Refreshing metadata for: 'VMware Photon Extras 3.0 (x86_64)'
    photon-extras                              123    100%
    Installing:
    parted          x86_64     3.2-9.ph3   photon-updates   1.12M 1170933

    Total installed size:   1.12M 1170933
    Is this ok [y/N]:
    y
    Downloading:
    parted                                  423548    100%
    Testing transaction
    Running transaction
    Installing/Updating: parted-3.2-9.ph3.x86_64

    Complete!
    root@cell [ /etc/yum.repos.d ]#

  6. View the partitions.  Type Fix when prompted (Note that sizes of the partitions may vary from this example).
    # parted /dev/sda
    GNU Parted 3.2
    Using /dev/sda
    Welcome to GNU Parted! Type 'help' to view a list of commands.

    (parted) print
    print
    Warning: Not all of the space available to /dev/sda appears to be used, you can
    fix the GPT to use all of the space (an extra 10485760 blocks) or continue with
    the current setting?

    Fix/Ignore? Fix   <<
    Fix
    Model: VMware Virtual disk (scsi)
    Disk /dev/sda: 48.3GB
    Sector size (logical/physical): 512B/512B
    Partition Table: gpt
    Disk Flags:

    Number  Start   End     Size    File system     Name  Flags
     1      1049kB  3146kB  2097kB                        bios_grub
     2      3146kB  137MB   134MB   ext3
     4      137MB   272MB   134MB   linux-swap(v1)
     3      272MB   42.9GB  42.7GB  ext3

  7. Resize partition and quit (root partition on Cloud Director appliance is 3)
    (parted) resizepart 3
    resizepart 3
    Warning: Partition /dev/sda3 is being used. Are you sure you want to continue?
    (YES/no) yes
    (42.9GB) 100%
    (parted) quit

  8. Resize filesystem
    root@cell [ /etc/yum.repos.d ]# resize2fs /dev/sda3
    resize2fs 1.45.5 (07-Jan-2020)
    Filesystem at /dev/sda3 is mounted on /; on-line resizing required
    old_desc_blocks = 5, new_desc_blocks = 6
    The filesystem on /dev/sda3 is now 11730171 (4k) blocks long.

  9. See the updated size
    root@cell [ /etc/yum.repos.d ]# df -l /
    Filesystem     1K-blocks     Used Available Use% Mounted on
    /dev/sda3       45922128 13317084  30295188  31% /