Increase disk space of a new AWS instance

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

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

Increase disk space (up to 2 TB)

Note: To increase disk space above 2TB, see below Increase disk space (above 2 TB).

Do the following:

During the Add Storage phase of the setup process, increase disk space on your AWS instance.

  1. Set the volume to a maximum of 2000GB.

  2. Verify that the disk size was updated by running:

    lsblk

  3. Resize partition 2 of the disk nvme0n1 to occupy the empty space by running following commands:

    parted /dev/nvme0n1

    resizepart 2 100%

    quit

  4. Verify that the partition was updated by running:

    lsblk

  5. After resizing the partition, resize the physical volume /dev/nvme0n1p2 to make use of the newly allocated space, by running the following command:

    pvresize /dev/nvme0n1p2

  6. Resize the logical volume vg_algosec-data to make use of the additional space in the volume group.

    lvresize --extents +100%FREE /dev/vg_algosec/data

  7. Verify that the logical volume is extended by running:

    lsblk

  8. Resize the file system to make use of the additional spaceby running:

    resize2fs /dev/vg_algosec/data

  9. Verify that the logical volume /data has been expanded to the desired size by running:

    df -h

  10. Reboot the system by running:

    reboot

Increase disk space (above 2 TB)

Do the following:

During the Add Storage phase of the setup process, add a new disk on your AWS instance.

  1. Set the volume to a maximum of 6000GB.

  2. Verify new 6 TB disk is added by running command:

    fdisk -l

    Note the name of the disk.

  3. Run the following command:

    parted /dev/nvme1n1

  4. Run the following commands:

    mklabel gpt

    print

  5. Run the following commands:

    unit TB

    mkpart primary xfs 0 6

    print

    quit

  6. Verify the new partition is present inside the new disk nvme1n1 by running:

    lsblk

  7. Run the following command to create new physical volume:

    pvcreate /dev/nvme1n1p1

  8. Run the command:

    vgdisplay

    Note the VG Name.

  9. Extend the volume group by running following command:

    vgextend vg_algosec /dev/nvme1n1p1

  10. To list details of logical volumes, run the command:

    lvdisplay

  11. Extend the logical volume by running following command.

    lvextend /dev/vg_algosec/data /dev/nvme1n1p1

  12. Resize the file system by running:

    resize2fs /dev/vg_algosec/data

  13. Verify the disk size has been expandedby running:

    df -h

  14. Reboot the system by running:

    reboot