If your server has multiple disks, you can save valuable space on your main system drive by mounting a secondary disk as a storage folder for XenForo file uploads. Below is a step-by-step guide to configure this on Linux with XenVn addon.
Step 1: Identify Your Secondary Drive
First, list all available drives and partitions:
lsblk
You’ll see something like:
Code:
You must log in to view
(4 lines)
Step 2: Create a Mount Point
Choose a directory where the external drive will be mounted. For example:
mkdir -p /var/www/xenforo/storage
It must be in the same directory where Xenforo is installed.
Make sure the directory is owned by the same user that runs your web server (usually www-data):
BASH:
You must log in to view
(2 lines)
Step 3: Mount the Drive
Mount the secondary disk to the folder:
mount /dev/sdb1 /var/www/xenforo/storage
You can verify the mount with:
df -h
Step 4: Auto-Mount on Boot
To make the mount persistent after reboot:
1. Find the UUID of the drive:
blkid /dev/sdb1
Example output:
Code:
You must log in to view
(1 lines)
2. Edit /etc/fstab:
nano /etc/fstab
3. Add this line at the end:
UUID=1234-ABCD /var/www/xenforo/storage ext4 defaults 0 2
Save and test:
mount -a
Step 5: Configure XenVn Storage Settings
1. Go to XenVn Setting → Storage in your XenForo Admin Panel.
2. Enable External Storage Connection.
3. In External Storage Type, select: Path to External Storage Folder
4. In External Storage URL / Path, enter the mount path you created, for example:
storage
It must be in the same directory where Xenforo is installed. Then its path will be:
/var/www/xenforo/storage
The
/var/www/xenforo/
part will be automatically added by XenVn. Why? Because PHP by default will not have access to directories outside the directory where it is installed. You should use it like that to ensure system security.5. Save the settings.
See more detailed instructions at the following link:
https://xenvn.com/threads/enable-external-storage-connection-for-xenforo-2-attachments.5627/
Tips & Best Practices
- Make sure the external drive uses a Linux-friendly file system like ext4 for better performance and permission handling.
- If you’re running a high-traffic site, consider using SSDs or NVMe drives for faster file access.
- Keep regular backups of the mounted storage to avoid data loss.
- If using SELinux or AppArmor, ensure the web server is allowed to read and write to the mounted folder.
Last edited: