logo smart home family kruse

Kruse Smart Home

Easy living in our smart home & Garden

Store Piwigo data on a separate drive (Raspberry Pi, SSD)

Store Piwigo data on a separate drive (Raspberry Pi, SSD)

15 February 2026

Jan-Willem

1. Introduction

We have installed on a Raspberry Pi with 2 NVMe SSD’s running an Apache webserver under Virtualmin. It makes sense to store Piwigo data on a separate drive (cache, photos and videos) to prevent the often lower capacity of the boot drive becomes an issue.

 

This article describes how to configure the Webmin based server and Piwigo to store the data on a second data SSD.

2. Requirements

The following is required to store Piwigo data on a separate drive:

3. Setup

Execute the followings steps, whereby in the instructions the /home/gallery.fotokruse.eu/public_html needs to be replaced by your path to the piwigo folder. Also the mounted data drive /mnt/data-ssd needs to be replaced by your own mounted second drive.

  1. Go to Webmin and select Tools > Terminal
  2. Prepare the data SSD with the required folders :

    This will create the following folder structure:
  3. Set the required permissions for the web server user (here www-data, but replace with your web server user):

    This will change the permissions from (also for the upload folder):

    into www-data:www-data under the blurred section:
  4. Now the Piwigo data needs to be copied from the boot drive to the data drive. Before doing this the web server needs to be stopped to prevent new files are being written while copying.
  5. Copy the Piwigo galleries folder from the first SSD to the second SSD:
  6. Copy the Piwigo _data folder from the first SSD to the second SSD:
  7. Copy the Piwigo upload folder from the first SSD to the second SSD:
  8. Backup the original folders:

    Check with the file manager that this indeed has been done.
  9. Create new folders within the Piwigo website folder:
  10. Ensure the new folders have the correct website owner:
  11. Create the bind mounts
  12. Restart the Apache webserver
  13. Make the binds mount permanent so they are recreated when rebooting the Webmin / Virtual min based webserver. Open the Webmin Filemanager and go to the folder /etc
  14. Find the file fstab, right mouse click and select Edit. Add the following instructions (of course modified for your situation):

    Save and close the editor.
  15. Use the command below to mount all filesystems listed in /etc/fstab that are not currently mounted. If no errors are shown it is working.
  16. Check the site is working. If the Piwigo site works the backup folders on the first SSD can be removed.

This concludes the setup to store Piwigo data on a separate drive. The following articles might also be of interest:

Article by <a href="https://smarthome.familykruse.eu/author/iamjwk/" target="_self">Jan-Willem</a>

Article by Jan-Willem

Position

Writen by the website owner

0 Comments

Submit a Comment

Your email address will not be published. Required fields are marked *