Enlarging the root or var partition
This article describes how to increase the size of the root (/) or var (/var) partition when Airlock Gateway is operated on virtualized platforms or cloud instances.
Supported scenarios
- Enlarging an LVM partition after hypervisor disk growth
- Reallocating space from
/varto/(root) on LVM - Enlarging partitions on non-LVM cloud images
- Enlarging an LVM partition using a new virtual disk
Preconditions and safety
- Back up your configuration and take a VM snapshot where possible.
- Expect a reboot for some paths.
- For online rescan after hypervisor resize, use the following command:
- For non-LVM cloud images, only partition/filesystem growth is applicable.
- Ensure the filesystem you intend to shrink has enough free space. The amount to be reallocated must be smaller than the available free space on
/varto ensure the shrink can succeed. - Shrinks may require downtime and an
fsck.
Enlarging an LVM partition after hypervisor disk growth
- Identify the LVM partition to grow (EFI vs. BIOS may differ). On most installations, the target is the last partition with the
lvmflag set (e.g.,/dev/sda3): - Grow the partition to the new end of disk:
- Refresh the PV to use the new partition size:
- Choose one of the following, depending on which partition you need to enlarge.
To enlarge
/var:To enlarge
/(root):- Verify the result by checking the LV sizes with
lvdisplayand confirming the updated filesystem usage withdf -h:
Reallocating space from /var to / (root) on LVM
Before starting, ensure that all services using the /var partition are stopped. The /var partition must be unmounted before the shrink operation. Perform the following steps on the system console, as network access is not available in single-user mode.
- Switch to single-user mode:
- Unmount the
/varpartition: - Determine how much space should be reallocated from
/varto/(e.g., 2 GB). - Shrink the
/varLV and its filesystem by that amount: Note: If
fsckreports issues that it cannot fix, resolve them before retrying.- Extend the
rootLV and its filesystem by the same amount: - Reboot the system to restart all services and ensure stable operation:
- Verify the result by checking the LV sizes with
lvdisplayand confirming the updated filesystem usage withdf -h:
Enlarging partitions on non-LVM cloud images
- Grow the partition to use the new end of disk (e.g., the first partition):
- Grow the filesystem:
- Verify the result by inspecting the partition layout with
lsblkand confirming the updated filesystem usage withdf -h:
Enlarging an LVM partition using a new virtual disk
In the following example commands, the newly added disk is identified by the device name /dev/sdb. On your system, the device name may differ (e.g., /dev/vdb, /dev/nvme0n1, or similar). Adjust the commands accordingly.
- Create a new PV and extend the existing VG:
- Extend the target LV and its filesystem by directly consuming the new PV choosing one of the following two options, depending on which partition you want to enlarge.
- To enlarge
/var: - To enlarge
/(root):
- To enlarge
Alternatively, you can also specify the amount of additional space to allocate to the target LV and its filesystem (e.g., as in the following, 50 GB).
- To enlarge
/var: - To enlarge
/(root):
- To enlarge
- Verify the result by checking the LV sizes with
lvdisplayand confirming the updated filesystem usage withdf -h.