Quotas
Per-user disk limits with quota-aware display in the dashboard Storage widget and the ruTorrent diskspace plugin.
The Quotas package enables Linux kernel-level user disk quotas on QuickBox Pro. Once installed, each user’s storage consumption is capped at their assigned limit. The dashboard Storage widget gains a Quota view showing per-user consumption against the cap, and ruTorrent’s built-in diskspace display reports each user’s quota allocation instead of the raw filesystem size.
Kernel-level enforcement
Uses Linux quota with usrjquota journal support (vfsv1). Limits are hard — once a user hits their cap, writes are refused at the filesystem level.
Per-user assignment
Each user gets an individual limit managed via qb user quota -u <user> -o <size>. Sizes use human-readable units: MB, GB, or TB. A server-wide default fills the gap for users whose limit is not yet set.
Dashboard Storage widget
When quotas are installed, the App Dashboard Storage widget shows a Quota view alongside System and Cloud. The Quota view shows how much of the assigned cap the user has consumed.
Quota-aware ruTorrent diskspace
The ruTorrent diskspace plugin is replaced with a quota-aware override that reports each user's quota total and free space instead of the full filesystem, giving accurate per-user capacity figures in the ruTorrent UI.
Fstab-safe installation
The installer backs up /etc/fstab before editing, edits the target mount with field-aware awk (no sed escaping issues), and restores the backup on removal.
Default quota from system configuration
The server_default_quota_size key in system_configuration sets the fallback limit applied to users whose per-user quota has not been explicitly assigned.
When to use Quotas
Good fit
- You share the server with multiple users and want to prevent one user from consuming all available disk
- You want the ruTorrent diskspace display to show each user their own cap rather than the full filesystem size
- You want the dashboard Storage widget to show per-user quota consumption
- You need hard disk limits enforced at the kernel level, not just monitored
Not needed
- You have a single-user server with no need to cap storage
- Your storage is managed at the volume or container level and kernel quotas would conflict
- The filesystem hosting user data does not appear as a distinct mount point in fstab
- You only need disk monitoring — Netdata or the System Dashboard provide usage data without enforced limits
Installation
Dashboard install (recommended)
Install Quotas from App Dashboard → Package Management. No per-install options form is shown — the system reads the primary mount point from dashboard_disk_mount in system_configuration automatically.
CLI install
qb install quotaBy default the installer uses the server’s primary disk mount (the value stored in dashboard_disk_mount in system_configuration). To target a different mount point, pass the -qm flag:
qb install quota -qm /mnt/data-qm <mount>, --quota-mount <mount>Mount point to enable quotas on. Defaults to the server's primary mount from dashboard_disk_mount in system_configuration.
qb install quota -qm /mnt/dataOther CLI commands:
qb reinstall quota # Re-run the install sequence (re-edits fstab, re-applies limits)
qb remove quota # Stop quota service, restore original fstab, purge the quota packageThe quota package enables quotas on one mount point. If your server uses multiple data volumes, install quotas once for the primary data mount and pass -qm to target the correct path. Running a second install on a different mount will reinstall the package against the new target.
How the system works
Fstab modification
The installer:
- Backs up
/etc/fstabto/root/.quickbox/backups/fstab - Copies
/etc/fstabto a working file and edits the target mount’s options field to addusrjquota=aquota.user,jqfmt=vfsv1(using field-aware awk to preserve original whitespace) - Writes the modified fstab back, then remounts the target:
mount -o remount <mount> - Runs
quotacheck -auMF vfsv1to build the quota database files - Enables quotas:
quotaon -uv <mount>
On removal, /root/.quickbox/backups/fstab is restored and the quota package is purged.
Sudoers grant for the dashboard
The installer copies /opt/quickbox/config/system/sudoers/dashboard to /etc/sudoers.d/dashboard, granting the qbxdashboard service user the ability to run repquota without a password. This is what lets the dashboard Storage widget and the ruTorrent diskspace plugin read per-user quota data.
Per-user quota assignment
At install time, the system iterates all users. For each user it reads quota_size from user_information. If the value is empty or 0, it falls back to server_default_quota_size from system_configuration. The limit is then applied via setquota.
To assign or update a user’s quota limit at any time after install:
qb user quota -u <username> -o <size>Valid size formats: MB, GB, TB (e.g. 50GB, 500GB, 2TB). Do not use decimal values.
# Examples
qb user quota -u alice -o 100GB
qb user quota -u bob -o 2TB
qb user quota -u charlie -o 500MBSizes must be whole numbers followed immediately by MB, GB, or TB. Decimals are not supported — 1.5TB will produce an error. Use 1500GB instead.
Dashboard Storage widget
With quotas installed, the App Dashboard Storage widget shows a Quota view. Selecting the Quota view displays a gauge of how much of the user’s assigned cap they have consumed. The System / Quota / Cloud toggle appears for admin users when more than one view is available.
See the App Management docs for full Storage widget details.
ruTorrent diskspace integration
When the quota package is installed and ruTorrent is also present on the server, the installer copies a quota-aware action.php to /srv/rutorrent/plugins/diskspace/action.php. This override replaces the default diskspace plugin behaviour:
- It reads the primary disk mount from
system_configurationvia the shared database - It runs
repquota(via the sudoers grant) to look up the authenticated user’s quota data - If the user has quota data, it returns the quota total and free values — so ruTorrent shows the user’s cap and remaining space
- If no quota data is found (quota not active for that user), it falls back to PHP
disk_total_space/disk_free_spaceagainst the full filesystem
The net effect: ruTorrent’s disk-space indicator in the bottom status bar reflects each user’s personal quota, not the shared filesystem.
Alongside the action.php override, the installer also deploys a PHP-FPM systemd drop-in at /etc/systemd/system/php<VERSION>-fpm.service.d/quickbox-quota.conf. This drop-in sets PrivateDevices=no on the PHP-FPM service. The default PHP-FPM service unit ships with PrivateDevices=true, which prevents FPM workers from seeing block device nodes — causing repquota to return nothing and the diskspace plugin to fall back to whole-filesystem totals. The drop-in corrects this by restoring block-device visibility to PHP-FPM.
Both the action.php override and the PHP-FPM drop-in are applied automatically when both quota and ruTorrent are installed. If you install quota before ruTorrent, run qb reinstall quota after ruTorrent is present to apply both.
Directory layout
Service management
The Linux quota subsystem runs as quota.service:
# Check quota service status
systemctl status quota.service
# Start / stop / restart
systemctl start quota.service
systemctl stop quota.service
systemctl restart quota.service
# Check quota usage for all users on all filesystems
repquota -a
# Check quota for a specific user
repquota -u / # replace / with your mount point if different
# Check whether quotas are active on a mount
quotaon -p / # prints "user quotas on / ... are on/off"Troubleshooting
If the installer reports that the specified mount point was not found in fstab, verify the target mount with df -h or mount | grep <mount>. The installer requires an exact match against the mount point column in fstab. Pass the correct path via -qm and reinstall.
Step 1 — Confirm the quota system itself is working.
Check two things before looking at the plugin:
- Does
/etc/fstabhaveusrjquota=aquota.user,jqfmt=vfsv1on your data mount? - Does the dashboard Storage widget show the Quota view with correct per-user consumption?
If both are yes, the kernel quota subsystem is working correctly and the problem is isolated to the ruTorrent diskspace plugin. If either is missing, see the other troubleshooting entries on this page.
Step 2 — Verify which action.php is installed.
Check whether the QuickBox override is in place:
grep -c "quota-aware" /srv/rutorrent/plugins/diskspace/action.phpA result of 1 means the QuickBox override is present. A result of 0 means the file is the stock upstream ruTorrent plugin — a ruTorrent update or reinstall can overwrite it.
Step 3 — Check the PHP-FPM drop-in is present.
The quota installer also deploys a systemd drop-in that allows repquota to run inside PHP-FPM workers. Without it, repquota returns nothing and the plugin falls back to whole-filesystem totals even if action.php is the correct version.
Find your active PHP version first:
find /etc/php -maxdepth 3 -name "rutorrent.conf" -path "*/fpm/pool.d/*" | awk -F/ '{print $4}' | head -1Then verify the drop-in exists (replace <VERSION> with the output above):
cat /etc/systemd/system/php<VERSION>-fpm.service.d/quickbox-quota.confIt should contain PrivateDevices=no. If the file is missing or contains different content, the drop-in was not applied.
Step 4 — Restore both files.
If either check in Step 2 or Step 3 showed a missing or incorrect file, restore them now.
Path A — manual restore (surgical):
# 1. Restore the quota-aware diskspace plugin
cp -f /opt/quickbox/config/software/rutorrent/plugins/diskspace/action.php \
/srv/rutorrent/plugins/diskspace/action.php
# 2. Restore the PHP-FPM drop-in
# Replace <VERSION> with the value returned in Step 3
mkdir -p /etc/systemd/system/php<VERSION>-fpm.service.d
cp -f /opt/quickbox/config/software/quota/php-fpm-quota.conf \
/etc/systemd/system/php<VERSION>-fpm.service.d/quickbox-quota.conf
# 3. Reload systemd and restart PHP-FPM
systemctl daemon-reload
systemctl restart php<VERSION>-fpmAfter these commands, re-run the Step 2 and Step 3 checks to confirm both files are in place. The PHP-FPM restart is required for the drop-in to take effect and also clears PHP’s opcode cache so the restored action.php is picked up immediately.
Path B — one command:
qb reinstall quotaqb reinstall quota re-applies the action.php override and the PHP-FPM drop-in and restarts PHP-FPM in a single operation. The end state is identical to Path A.
Step 5 — If the problem persists after reinstalling quota.
Collect the following and open a support request:
- Output of
grep -c "quota-aware" /srv/rutorrent/plugins/diskspace/action.php - Output of
cat /etc/systemd/system/php<VERSION>-fpm.service.d/quickbox-quota.conf - Your ruTorrent version (shown in the dashboard Package Management tab)
If repquota shows no data for a user, the user’s quota may not have been set. Run qb user quota -u <username> -o <size> to assign a limit. Also confirm the quota service is running (systemctl status quota.service) and that quotas are active on the mount (quotaon -p /).
If your server had user quotas enabled before QuickBox was installed, the fstab options line may already contain usrjquota. The installer detects this and skips the fstab edit for that mount to avoid duplicating options. In this case the installer still installs the quota package and applies per-user limits.
Best practices
Do
- Set a sensible
server_default_quota_sizein the dashboard General Settings before installing quotas — every new user will inherit it automatically. - After adding a new user, assign their quota explicitly with
qb user quota -u <user> -o <size>if their allocation differs from the default. - Run
repquota -aperiodically to review actual usage against assigned limits before users hit their caps. - If you reinstall ruTorrent after quotas are already installed, run
qb reinstall quotaafterward to restore the quota-aware diskspace override. - Use whole-number sizes (e.g.
100GB,2TB) — decimal values are not supported by the quota assignment command.
Don't
- Do not edit
/etc/fstabmanually while quotas are enabled — always runqb reinstall quotato let the installer manage the options field safely. - Do not run
quotaoff -amanually while the quota service is enabled — usesystemctl stop quota.serviceto stop quotas cleanly. - Do not set per-user limits below the amount of data the user has already stored — this will immediately make their account exceed quota and may affect running services.
- Do not confuse the quota mount limit with storage monitoring — the Netdata integration and System Dashboard track disk usage independently of kernel quota enforcement.
FAQ
Resources
Join the Community
Media server operators sharing configs, getting support, and shaping the future of QuickBox Pro.