Increase disk space of an Azure instance

The following topic explains how to increase the disk space of a deployed Azure instance by extending your out-of-the-box storage device.

The AlgoSec Azure image comes with 241 GB in the data partition. After you deploy it in a Azure environment, according to your sizing, you may need to increase the disk space of your deployed Azure instance.

Procedure preconditions:

Only run this procedure if the following two conditions are true:

  1. The Azure virtual machine has never had snapshots taken.

  2. When running the command lsblk you see the following structure:

    sda should contain both sda1 and sda2.

Do the following:

  1. On the Azure instance, click Disks. The Disks page opens.

  2. On the Disks page, click on the Disk Name that you want to extend disk size. The DIsk page appears.

  3. On the Disk's page, click on Size + Performance. The Size + Performance page appears.

  4. In the Custom Disk Size field, enter the disk size you want (maximum is 2TB).

    Tip: To increase storage capacity beyond 2TB, introduce an additional disk. To integrate this new disk into the Linux data partition, execute steps 6 through 9, substituting the disk identifier with the appropriate one (e.g., sdb) for the newly added disk.

  5. Click Save.

  6. Restart the machine and run the following command:

    fdisk /dev/sda

    Press n

    Command (m for help): n

    Press p

    Command action
    l   logical (5 or over)
    p   primary partition (1-4)
    p

    Press 3

    Partition number (1-4): 3

    Hit <enter>

    First sector (….): <enter>

    Hit <enter>

    Last sector (...): <enter>

    Press t

    Command (m for help): t

    Press 3

    Partition number (1-3, default 3): 3

    Press 8e

    Hex code (type L to list codes): 8e
    Changed system type of partition 3 to 8e (Linux LVM)

    Press w

    Command (m for help): w
    The partition table has been altered!
  1. Run the command:

    partprobe
  1. To Increase the logical volume, run the following commands:

    pvcreate /dev/sda3
    vgextend centos /dev/sda3
    lvextend /dev/centos/data /dev/sda3
    xfs_growfs /dev/centos/data

  2. check using the df -h command that the /data partition shows the additional storage.