alxpanel-setup-storage
Makes sure /srv/hosting is an XFS file system with project quotas, creating an image file for it when nothing is mounted there.
The install runs this once. Run it by hand, as root, only when alxpanel-setup says the storage is not ready. It is safe to repeat: it never reformats an existing image and never touches a mount of yours.
Usage
alxpanel-setup-storage
No options.
| Environment variable | Default | Meaning |
|---|---|---|
ALXPANEL_HOSTING_SIZE |
20G |
Size of the image, used only when the image is created. |
What it does
/srv/hosting is… |
Result |
|---|---|
| mounted, quotas on | Nothing to do. Exit 0, no output. |
| mounted, quotas off | Refuses and changes nothing. Exit 1: /srv/hosting is mounted but project quotas are not active. Mount it with the prjquota option. |
| not mounted | Creates the image and mounts it. Exit 0. |
Creating the image means:
- a sparse file
/var/lib/alxpanel/hosting.img, formatted as XFS, readable by root only; - a line in
/etc/fstab:/var/lib/alxpanel/hosting.img /srv/hosting xfs loop,prjquota 0 0; - the mount itself.
On success it prints:
alxpanel-setup-storage: XFS prjquota ready at /srv/hosting (loopback /var/lib/alxpanel/hosting.img, 20G sparse)
Example
A larger image on a server where the storage was never created:
ALXPANEL_HOSTING_SIZE=100G alxpanel-setup-storage
For an image that already exists, use alxpanel-resize-storage. For a partition of your own, see Customer storage.