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 249 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.
-
Set the volume to a maximum of 2000GB.
-
Verify that the disk size was updated by running:
lsblk
-
Resize partition 2 of the disk nvme0n1 to occupy the empty space by running following commands:
parted /dev/nvme0n1
resizepart 2 100%
quit
-
Verify that the partition was updated by running:
lsblk
-
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
-
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
-
Verify that the logical volume is extended by running:
lsblk
-
Resize the file system to make use of the additional spaceby running:
resize2fs /dev/vg_algosec/data
-
Verify that the logical volume /data has been expanded to the desired size by running:
df -h
-
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.
-
Set the volume to a maximum of 6000GB.
-
Verify new 6 TB disk is added by running command:
fdisk -l
Note the name of the disk.
-
Run the following command:
parted /dev/nvme1n1
-
Run the following commands:
mklabel gpt
print
-
Run the following commands:
unit TB
mkpart primary xfs 0 6
print
quit
-
Verify the new partition is present inside the new disk nvme1n1 by running:
lsblk
-
Run the following command to create new physical volume:
pvcreate /dev/nvme1n1p1
-
Run the command:
vgdisplay
Note the VG Name.
-
Extend the volume group by running following command:
vgextend vg_algosec /dev/nvme1n1p1
-
To list details of logical volumes, run the command:
lvdisplay
-
Extend the logical volume by running following command.
lvextend /dev/vg_algosec/data /dev/nvme1n1p1
-
Resize the file system by running:
resize2fs /dev/vg_algosec/data
-
Verify the disk size has been expanded by running:
df -h
-
Reboot the system by running:
reboot