alxpanel

alxpanel-resize-storage

Shows the size of the customer storage, or grows it while the sites keep running.

Works on the image file that alxpanel created at /var/lib/alxpanel/hosting.img. Run it as root.

Usage

alxpanel-resize-storage
alxpanel-resize-storage SIZE
alxpanel-resize-storage --force SIZE
Argument Meaning
(none) Show the current state and change nothing.
SIZE The new total size: a whole number and a unit, K, M, G or T (1024-based). 40G, 51200M.
--force Allow a size larger than the disk underneath can back.

Showing the state

# alxpanel-resize-storage
Customer storage /srv/hosting (image /var/lib/alxpanel/hosting.img)
  size:              20.0GiB (6.2GiB used, 13.8GiB free)
  image takes:       6.4GiB on the disk that holds it
  free on that disk: 61.3GiB
  largest size without --force: 67.7GiB

The image is sparse, so it takes only what customers have used. The largest safe size is what the image takes now plus what is free on the disk that holds it.

Growing

# alxpanel-resize-storage 40G
alxpanel-resize-storage: /srv/hosting grown from 20.0GiB to 40.0GiB (filesystem 40.0GiB)

Nothing is unmounted and no site stops. Raise the Disk value of your plans afterwards if accounts should get more.

Refusals

All exit 1 and change nothing.

Message Why
storage is … and cannot be made smaller XFS cannot shrink.
… is more than the disk holding the image can back … --force overrides. An oversized sparse image works until the disk underneath runs full; then every write to that disk fails.
/srv/hosting is mounted from …, not from the panel's image The storage is a partition of your own. Resize it with your own disk tools.
/srv/hosting is not mounted; run alxpanel-setup-storage first
must run as root

If growing stops half way (xfs_growfs failed; the image is … but the filesystem was not grown), run the same command again once the cause is fixed. Asking for the current size is never an error.

Exit codes

Exit code Meaning
0 Shown, grown, or already that size.
1 Refused or failed.
2 Wrong usage.