[squid-users] Cache pfSense fix

Amos Jeffries squid3 at treenet.co.nz
Mon Jan 12 16:51:13 UTC 2026


Nice. Thank you.

Would you mind adding this to the Squid wiki?

IMO it should go as a new file in this part of the wiki repository:
  <https://github.com/squid-cache/squid-cache.github.io/tree/main/docs/ConfigExamples/Caching>

(you can use the existing WindowsUpdates page there as an 
example/template layout to match the rest of the ConfigExamples section).



Cheers
Amos

On 10/01/2026 09:07, Jonathan Lee wrote:
> Great find
> 
> pfSense Squid Cache on NVMe (Persistent Across Reboots)
> ======================================================
> 
> Goal:
> -----
> Use an existing directory on an already-mounted NVMe drive
> as Squid’s cache, while satisfying pfSense’s requirement
> that the cache live under /var/squid.
> 
> This method:
> - Works across reboots
> - Survives pfSense & Squid upgrades
> - Does NOT use symlinks (which do not work)
> - Does NOT destroy existing data on the drive
> 
> --------------------------------------------------------
> 
> Prerequisites:
> --------------
> - NVMe drive already mounted (example: /nvme)
> - Existing cache directory on the drive:
>    /nvme/LOGS_Optane/Squid_Cache
> - Squid package installed
> 
> --------------------------------------------------------
> 
> Step 1: Create the mount point under /var/squid
> ------------------------------------------------
> (Only creates an empty directory if it doesn’t exist)
> 
> mkdir -p /var/squid/cache
> 
> --------------------------------------------------------
> 
> Step 2: Bind-mount (nullfs) the existing directory
> --------------------------------------------------
> (This makes the NVMe directory appear inside /var/squid)
> 
> mount_nullfs /nvme/LOGS_Optane/Squid_Cache /var/squid/cache
> 
> NOTE:
> - No data is moved or copied
> - Existing cache contents are used directly
> 
> --------------------------------------------------------
> 
> Step 3: Make the mount persistent (IMPORTANT)
> ------------------------------------------------
> pfSense GUI:
> 
> 1. Go to:
>     System → Advanced → fstab
> 
> 2. Click "Add"
> 
> 3. Set the following:
>     - Type:        nullfs
>     - Device:      /nvme/LOGS_Optane/Squid_Cache
>     - Mount point: /var/squid/cache
>     - Options:     rw
> 
> 4. Save
> 5. Apply Changes
> 
> --------------------------------------------------------
> 
> Step 4: Configure Squid to use the new path
> -------------------------------------------
> pfSense GUI:
> 
> Services → Squid Proxy Server → Local Cache
> 
> Set:
> Cache directory:
>    /var/squid/cache
> 
> Save and restart Squid.
> 
> --------------------------------------------------------
> 
> Step 5: Verify
> --------------
> Check that the mount is active:
> 
> df -h | grep squid
> mount | grep nullfs
> 
> You should see the NVMe filesystem mounted at:
>    /var/squid/cache
> 
> --------------------------------------------------------
> 
> Behavior After Reboot:
> ----------------------
> - Mount persists across reboots
> - pfSense package manager no longer complains
> - Squid cache cleanup works normally
> - No manual remounting required
> 
> --------------------------------------------------------
> 
> Important Notes:
> ----------------
> - Symlinks do NOT work (pfSense resolves real paths)
> - nullfs is the correct and supported workaround
> - MSDOS/FAT filesystems work but are not ideal long-term
> - UFS or ZFS is recommended if you ever reformat
> 
> --------------------------------------------------------
> 
> End of file
> 
> Sent from my iPhone
> _______________________________________________
> squid-users mailing list
> squid-users at lists.squid-cache.org
> https://lists.squid-cache.org/listinfo/squid-users



More information about the squid-users mailing list