Accessing App PVCs on TrueNAS SCALE
Where are my application files?
- Your files are held within the container
- They are not visible from your server’s file structure without first mounting that PVC
Mounting PVC Data
HeavyScript
One option is to use HeavyScript.
If you plan on mounting PVC storage more than just a couple of times this may be the best option for you.
- The script will list all of your PVC information for each application
- Safely shut down your application before mounting
- Mount your PVC to /mnt/temporary/STORAGE-NAME
Manual Method - New User Guide
Manually mounting PVC storage takes a little bit more time than the script method.
However, I know some users like to know exactly what commands they are running etc.
Recommended Items
- A terminal that allows copying and pasting
- An open notepad
1. STOP the application you plan on mounting
2. Run the following command to view your PVC data
3. Find the application you would like to mount
This can be confusing at first because many applications will have many different instances of PVC.
- You’ll see in this photo, Nextcloud has many different PVC’s.
- However, if you break it down by looking at the middle column, it’s not too confusing.
data-nextcloud-redis-0
- This is your Redis PVC
db-nextcloud-postgresql-0
- This is your PostgreSQL PVC
nextcloud-data
- This is your Data PVC
4. After finding which PVC you would like to mount, copy the far right column (The Volume) that starts with pvc- into a notepad for use in the next command
- If I was wanting to mount
nextcloud-data
, I would use: pvc-cd84394b-7812-43c3-a6d9-1a5693592cbe
5. Run the following command to find the full path to your applications PVC
- Going off of the Nextcloud example, I would simply replace
PVC_VOLUME
withpvc-cd84394b-7812-43c3-a6d9-1a5693592cbe
Example:
Here is what the output should look like
6. Mount your PVC
Example:
- This command will produce no output if it’s successful
- Now you should be able to do whatever you want within the app’s PVC
7. Remounting
Example:
Afterwards, I always like to rmdir
on the directory that was created when mounting
- In my case I would run:
-
This just helps keep your temporary folder clean, and lets you know what is or is not currently mounted.
-
Do not worry,
rmdir
cannot delete mounted folders, or folders with contents in them.
Manual Method - Advanced User Guide
ALWAYS MAKE SURE THE APP IS STOPPED WHILE MOUNTING THE PVC
To get the PVCNAME
To get the PVCPATH
If you want to mount the PVC content
Your PVC will be mounted under /mnt/temporary