ZFS, mount points, and LXCs

CygnusTM

New Member
Jan 18, 2025
2
0
1
I need some help understanding the interaction of LXCs and their mount points in regards to ZFS. I have a ZFS pool (rpool) for PVE, VM boot disks and LXC volumes. I have two other ZFS pools (storage and media) used for file share storage and media storage.

When I originally set these up, I started with Turnkey File Server and Jellyfin LXCs. When creating them, I created mount points on the storage and media pools, then populated them with my files and media. So now the files live on mount points named storage/subvol-103-disk-0 and media/subvol-104-disk-0, which, if I understand correctly, correspond to ZFS datasets. Since then, I've moved away from Turnkey and Jellyfin to Cockpit/Samba and Plex LXCs, reusing the existing mount points from the other LXCs.

If I remove the Turnkey and Jellyfin LXCs, will that remove the storage and media datasets? Are they linked in that way? If so, how can I get rid of the unused LXCs and preserve the data?
 
Hi!

If I understand correctly, you are using the existing 2 subvolumes from the old containers (Turnkey and Jellyfin) as mount points in the new 2 (Cockpit/Samba and Plex). I assume you've manually edited the configs of the containers for this? To avoid confusion for yourself and PVE regarding the subvolumes and their containers, I'd do the following:

  1. Shut down all containers
  2. Edit the configs in /etc/pve/lxc/... of the Cockpit/Samba and Plex LXCs and remove the mount points you manually added (I'm assuming you did, I'm not aware of any other way to do this)
  3. In the UI, go to your Turnkey File Server CT --> Resources, select the mount point and click Volume Action --> Reassign Owner and select the Cockpit/Samba CT
  4. Do the same for Jellyfin and Plex CTs
The mount points should now not be listed in the UI anymore for the 2 old CTs. You should be able to remove both of them and the subvolumes now belong to the new CTs. Of course, it's never a bad idea to make sure you have a copy of the data in the subvolumes before manipulating them.
 
Last edited:
Thanks for the info! I had a feeling that there was some kind of ownership involved with these. One thing though, I added the mount points to the other LXCs using the pct command. I didn't manually edit the configs. Does that change the procedure?
 
Sorry, I missed the fact that you could also set it using pct, but it's still just a config change. The procedure remains the same.