For the complete documentation index, see llms.txt. This page is also available as Markdown.

Increasing the MikoPBX Storage Disk Size

Use this guide when the disk that contains the local MikoPBX storage has been expanded in the hypervisor or on the physical server, but the /storage/usbdisk1 partition still shows the old size.

The local storage contains call recordings, call history, system logs, additional modules, backups, and system caches. In a standard installation, the storage is mounted at /storage/usbdisk1.

When to Use This Guide

Use this scenario if:

  • MikoPBX is installed on a virtual machine or a physical server;

  • the storage disk has already been expanded at the hypervisor, RAID controller, or storage subsystem level;

  • df -h /storage/usbdisk1 still shows the old file system size;

  • the disk has unallocated space after the current storage partition.

This guide does not apply to Docker installations. In Docker, the size of the /storage directory is managed by the host operating system and volume settings.

Check the Current Storage Disk

Connect to MikoPBX over SSH for diagnostics only, or open the MikoPBX console and run:

Instructions for connecting via SSH are available here.

lsblk -f
df -h /storage/usbdisk1
mount | grep /storage/usbdisk1
cat /etc/fstab
sqlite3 /cf/conf/mikopbx.db "select id,name,device,uniqid,filesystemtype,media from m_Storage;"

Find the disk listed in the m_Storage table. For example:

In this example, the storage disk is /dev/vdc, and the storage partition is /dev/vdc1.

Save the disk name to a variable:

Check the disk size and unallocated free space:

After the disk has been expanded in the hypervisor, the output must show that the disk itself is larger and that Free Space appears after the existing partition.

Example state before resizing:

If there is no free space, first expand the disk in the hypervisor or check that you selected the correct disk.

Fix GPT After Expanding the Disk

On GPT disks, after expanding a virtual disk, parted may show this warning:

In this case, first move the backup GPT header to the end of the new disk size:

Then repeat the check:

The Not all of the space... warning should disappear. The free space after the partition should still be visible.

Run Storage Resize

Open the local MikoPBX console or the virtual machine console.

In the console menu, select:

Confirm stopping processes:

Enter y.

MikoPBX will run the standard scenario:

  • stop services that use storage;

  • unmount /storage/usbdisk1;

  • expand the storage partition to the end of the disk;

  • run e2fsck;

  • run resize2fs;

  • reboot the system.

If you need to run the same scenario as a command from the console, use:

Check the Result After Reboot

After MikoPBX boots, identify the storage disk again and run the checks:

In a correct state:

  • /storage/usbdisk1 is mounted from the same storage partition;

  • the size of /storage/usbdisk1 has increased;

  • there is no free space after the storage partition, or only a minimal technical gap remains;

  • the UUID in /etc/fstab matches the UUID of the storage partition;

  • the m_Storage table points to the same storage disk.

Example result after a successful resize:

Check that the data is accessible:

The correct response for the call history database is:

Check services:

Immediately after reboot, some monit checks may be in the Initializing state. Wait 1-2 minutes and repeat the check.

If the Size Did Not Change

If Resize storage reported success but df -h /storage/usbdisk1 still shows the old size, check GPT and free space:

If the Not all of the space... warning is present, run:

Then run the resize operation again from the console:

If the free space is less than 5% of the disk size, the standard script may finish without resizing. In this case, check whether the disk was actually expanded enough.

Rollback

If the system does not boot or storage is not mounted after resizing, use the backup or snapshot created before the operation.

If MikoPBX boots but storage is not mounted, check the UUID and database record:

If needed, connect the storage disk again using the standard script:

Last updated

Was this helpful?