Skip to main content
MZBZ
Staff
Staff
November 14, 2024

Technical Tip: Increasing Linux disk space for FortiClient EMS running on Linux

  • November 14, 2024
  • 0 replies
  • 5435 views
Description

This article explains how to increase free disk space on a Linux system running FortiClient EMS on Ubuntu 22.04 LTS. One scenario where this guide is useful is when the error message 'Failed to create Deployment Package: Not enough disk space' appears in the FortiClient EMS WebUI during the creation of an installer.

 

This error is often due to the system not having sufficient resources allocated (system requirements) during the initial creation and installation of the virtual machine.

Scope FortiClient EMS on Linux.
Solution

As a general rule, it is crucial to have a healthy, recoverable backup (either as a full disk or as VM snapshots) of the server before proceeding with these changes.

 

To increase the root disk size of the original OVF VM image (EMS v7.4+), start directly from step 4. If the virtual disk space is increased (changing the VM settings, for example, to a 200 GB disk), start from step 1. Step 1 forces the Linux kernel to rescan and read the updated disk size, which makes it possible to increase the disk size without a reboot.

 

  1. Force a disk rescan on the kernel (must be done from the root shell by sudo -s or sudo -i).

 

echo 1>/sys/class/block/sda/device/rescan

 

  1. Use cfdisk or growpart to expand the sda3 partition (or any other partition needed. The name can be found with the lsblk command) and use unallocated space. The growpart allocates all possible free space by default. cfdisk has a TUI environment that allows custom allocation of the available free space.

 

sudo cfdisk

 

Or:

 

sudo growpart /dev/sda 3 <----- There should be a space between sda and 3.

 

When the tool opens, select sda3, then use the Resize function, and do not forget to write before quitting.

  1. Make sure the new partition size is applied for sda3:

 

sudo lsblk

 

  1. Increase the PV (Physical Volume) size:

sudo pvresize /dev/sda3

 

  1. Extend the LV (Logical Volume) size to 100% FREE space:

sudo lvextend -l +100%FREE /dev/mapper/ubuntu--vg-ubuntu--lv

 

  1. Expand the EXT4 filesystem:

 

sudo resize2fs /dev/mapper/ubuntu--vg-ubuntu--lv

 

  1. Confirm the free disk space:

 

df -Th

 

  1. Reboot and ensure the system is bootable and the changes are applied after the reboot by running df -Th again.

 

The following commands can be used for confirmation and deletion of old log files if the FortiClient EMS logs directory is consuming most of the disk space:

1. To check disk usage of directories under / (root directory):  'sudo du -h -d 1 /'.

2. To check disk usage of directories under /var/log:  'sudo du -h -d 1 /var/log'.

3. To print AND delete any log file older than 10 days under /var/log/forticlientems/: 'sudo find /var/log/forticlientems/ -type f -name "*.log*" -mtime +10 -exec rm -v {} \;'.

 

References for more information on Logical Volume Management (LVM):

 

FortiClient EMS v7.4 (Linux-based) system requirements:

 

Increasing Disk Space on FortiClient EMS 7.4.5 VM.

Starting with version 7.4.5, FortiClient EMS has added support for OVA template VM deployment, which also brought an ability to provision more disk space during or after installation via the EMS CLI utility.

For detailed instructions on how to do this, refer to Technical Tip: Resizing disk space on FortiClient EMS v7.4.5 installed on VMWare ESX article.

 

In addition, see FortiClient EMS 7.4.5 Adding and expanding disks on EMS VMs official documentation.